A ready-to-use boilerplate for REST API Development with Node.js, Express, TypeScript and PostgreSQL.
This boilerplate uses the following libraries and tools:
.
├── .husky # Github hooks for husky
├── build # Built, ready-to-serve app.
├── config # Root folder for configurations.
│ └── index.ts # App configurations.
├── node_modules # Node Packages.
├── source # Source code.
│ ├── bootstrap # Root folder for bootstrapping the app.
│ │ ├── index.ts # Sets up basic middleware
│ │ └── db.config.ts # Sets up DB
│ ├── route # Folder for app routes.
│ │ └── index.ts # Root level routes
│ ├── interface # Folder for interfaces.
│ │ └── user.interface.ts # User interface
│ ├── service # Folder for services.
│ │ ├── index.ts # Common place to export other services
│ │ └── auth.service.ts # Auth service layer
│ └── middleware # Folder to hold all middleware functions
│ └── logging.ts # Middleware for logging into console.
├── .dockerignore # Tells docker which files to ignore.
├── .gitignore # Tells git which files to ignore.
├── .prettierignore # Tells prettier which files to ignore
├── .eslintrc.js # Eslint configuration
├── .prettierrc # Prettier configuration
├── commitlint.config.js # commitlint configuration for husky
├── Dockerfile # Dockerfile.
├── LICENSE # License file
├── package.json # Package configuration.
├── package-lock.json # Package lock
├── README.md # This file
└── tsconfig.json # TypeScript transpiler configuration.
You can clone from this repository and use the main branch.
$ git clone https://github.com/beevk/ts-express-postgres.git projectName
$ cd projectName
$ npm i
All commands default to the development environment. You can set NODE_ENV
to production
or use the shortcuts below.
# Running
$ npm run dev # This starts the app in development mode
# Starting it with the production build (todo)
$ NODE_ENV=production npm run start # or
# Building (todo)
$ npm run build # This builds the app in development mode
# Commands below builds the production build (todo)
$ NODE_ENV=production npm run build # or
$ npm run build:prod
# Testing (todo)
$ npm run test
# Testing with watch mode(todo)
$ npm run test:watch
# Too check test coverage (todo)
$ npm run coverage
This boilerplate is released under the MIT license.