Setting up boiler plates when starting new projects is tedious sometimes and I often found myself setting it up from scratch 🥱
Hence I made this starterkit following some of the best patterns and practices I learnt from some of the larger codebase and fantastic developers I've had a chance to work with 🙌
The main purpose of this repository is to provide a scalable monorepo starterkit which follows good architecture patterns (might be opinionated) and code decoupling which becomes significant as the project grows or new developers are onboarded
This project is inspired by Karan Pratap Singh's Full-Stack Starterkit
-
Yarn Workspaces Monorepo This project is structured to maximise dependency hoisting using Yarn Workspaces
-
All in Typescript Because TypeScript is awesome, and types are important 😃
-
Eslint + Prettier This project uses Eslint with Prettier for beautiful & well linted code free of bugs & code smells
-
Husky + Lint-Staged Project uses automation powered by Husky & Lint-Staged in order to prevent you from pushing ugly code 😁
Please leave a ⭐ as motivation if you liked the idea 😄
The project is structured as a monorepo with the help of Yarn Workspaces. All the development dependencies are present in the tools package & are hoisted to the root of the project, while runtime dependencies for individual projects are there in respective projects.
monorepo
├── .husky
├── packages
│ ├── common <--- Common package for shared code
│ ├── server <--- NestJS application
│ ├── tools <--- All the development dependencies
│ └── web <--- Angular application
├── .eslintignore
├── .eslintrc.js
├── .prettierignore
├── .prettierrc.json
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── tsconfig.json
├── yarn.lock
└── package.json
Here is the folder structure for server
, it uses NestJS for the backend services, providing API endpoints for the front-end application.
server
├── src
├── test
├── nest-cli.json
├── tsconfig.build.json
├── tsconfig.json
└── package.json
Here is the folder structure for web
, it is a standard Angular CLI produced Angular application that interfaces with back-end's API
web
├── e2e
│ ├── src
│ ├── protractor.config.js
│ └── tsconfig.json
├── src
├── .browserslistrc
├── .editorconfig
├── angular.json
├── karma.config.js
├── tsconfig.app.json
├── tsconfig.spec.json
├── tsconfig.json
└── package.json
Install dependencies
I recommend using yarn
instead of npm
as this project heavily uses yarn workspaces
. All the project dependencies are hoisted to the root & will be automatically downloaded. A prepare script will build common's package required by both web
& server
along with setting up husky's pre-commit hook.
yarn
Running server
yarn start:server
Running web
yarn start:web
Contributions are welcome as always, before submitting a new PR please make sure to open a new issue so community members can discuss.
Additionally you might find existing open issues which can helps with improvements.
This project follows standard code of conduct so that you can understand what actions will and will not be tolerated.
📄 License
This project is MIT licensed, as found in the LICENSE
Built and maintained with 🌮 by Shubham