Complete TypeScript, Express/Node.js application boilerplate setup along with error logger, linters, pre-commit hooks, and unit/integration tests using jest.
|-- migrations # Database migration dir
|-- tests # All unit and integration test files goes here
|-- .husky # Husky hooks for git pre-commits for lint check
|-- src
| index.js # App entry point
| app.js # Load express application modules
|-- config # Environment variables and configuration related stuff
|-- constants # App constants
|-- controllers # Express route controllers
|-- interfaces # TypeScript interfaces
|-- middlewares # Express middlewares
|-- models # Mongoose models
|-- routes # Express routes
|-- services # Service modules
|-- startup # Split the startup process into modules
|-- types # Shared TypeScript types
|-- utils # Shared utilities modules
- NodeJS >= 14.x
- Yarn >= 1.x
- MongoDB >= 5.x
First of all, you need to check if you're using the required versions of Node.js and npm
Then, please follow the instructions below:
$ git clone https://github.com/manjillama/typescript-node-boilerplate.git
$ cd typescript-node-boilerplate
Install dependencies:
$ yarn
Set environment variables:
$ cp .env.example .env
Import sample documents
$ yarn seed:import
$ yarn dev
In the project directory, you can run:
# lint code with ESLint
$ yarn lint
# try to fix ESLint errors
$ yarn lint:fix
# run all tests with Mocha
$ yarn test
# run lint and tests
$ yarn validate
$ yarn debug
$ yarn seed:import
$ yarn seed:delete
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes.
Licensed under the MIT License.