Nx workspace is around for quite a time now amongst the others such as Yarn workspaces and Turbo repo that aims to take an approach on having enhanced collaboration through visibility by allowing teams to better communicate and collaborate. In a large team, this is specially beneficial. Developers can see the entire codebase, understand the context of their work better and make cross-project changes effortlessly.
The repo is maintained with new projects in NextJS, ReactJs, NestJs and React Native. Here are list of projects;
- AI Content Generator app build with
NextJS
,Clerk
for Authentication,Google GEMINI
for AI. Click here to visit the production app. - Banking build with
NextJS
,APPWRITE
for Authentication and DB. Click here to visit the production app.
Note
This repo contains other projects containing shareable components. Moreover, it holds list of re-usable components and utils which is aimed to be used throughout various projects.
Teams tend to choose mono repo over poly repo to have;
- Improved collaboration and code sharing: A monorepo makes it easier for teams to see all the codebase in one place, reuse code across projects, and work on related changes together.
- Simplified dependency management: With all code in one place, there is no need to worry about version conflicts between separate repositories.
- Standardization and visibility: A monorepo makes it easier to enforce coding practices and tooling across the entire codebase, as well as see how all the different parts of the system fit together.
Note
However, it's important to consider the potential drawbacks of monorepos as well like increased repository size and complexity overtime.
Let's get thorough understanding of workings of various JS projects inside Nx monorepo. We shall take gradual development approach where we will house various frontend and backend projects inside this repository. We shall aim for;
- How to house various projects inside Nx workspace
- How to implement the concept of reusable components and utilities
- How to prepare projects to production with CICD on github
We shall maintain this repository having some initial tech stack in mind, however we shall keep updating gradually as per our need.
- NextJS for frontend projects
- ReactJS for frontend proejcts
- NestJS for backend projects
- mongoDB for storing our data
- REST & Graphql API
- AuthJS or NextAuth for authentication and authorization
We shall keep up with the list as our tech stack grows or shrinks.
Have a look at detailed Nx API commands list for further info. We shall list commands that we used in this repo here.
Let's get started with the project.
Clone Repository
git clone https://github.com/arifshariati/monor.git
Install Dependencies The project uses bun. However, you can use npm also.
bun install
# if bun is not installed on your machine
bunx install
Run projects in DEV
# banking app
bun run banking:dev
# AI content generator app
bun run ai-content-generator:dev
# Next dashboard app
bun run next-dashboard:dev
Other commands
You can also scripts
section of package.json
for full list of scripts.
# Lint
bun run lint
# Test
bun run test
# build
bun run build