This is an example monorepo using Vercel's Turborepo library. It contains two React apps, namely "client" and "admin," and CRUD APIs using Express.
A monolithic repository, commonly known as a mono-repo, is a version control repository that houses multiple projects or components within a single repository. This approach stands in contrast to the traditional model of having separate repositories for each project.
In a mono-repo, all projects within the repository share the same version control history. This makes it easier to manage dependencies between projects, ensuring that they are always compatible.
Since all projects reside in the same repository, it's possible to enforce a consistent versioning strategy across all components. This can simplify the release process and make it more predictable.
Developers can easily share code between different projects within the mono-repo. This promotes code reuse and helps maintain a consistent coding style and standards across the entire codebase.
When making changes that span multiple projects, it's beneficial to have atomic commits that affect all related components simultaneously. Mono-repos facilitate this by allowing developers to make coordinated changes across the entire codebase.
This Turborepo includes the following packages/apps:
admin
: React-app app serves as a basic admin panel to create & delete products.client
: React-app app serves as a basic client panel to view products.api
: Simple CRUD APIs created using Express, used inside client and admin.packages
: This directory consists of common configs and UI components used in admin and client.
Each package/app is 100% TypeScript.
- Install dependencies using
npm i
on the root level. - Run all the projects using
npm run dev
. To run a single project, hit the same command by opening the particular repo in the terminal.
If you liked the approach, be sure to โญ the repository. Looking forward to connecting for any remote work opportunity!