This template gets you started with Node.js TypeORM Postgres faster.
set up the development environment with the following steps
- clone the repository
- Run
npm i
command - create a
.env
file in the root directory and copy the contents of.env.example
into it - Run
npm run docker:build
command, to build the docker container - Run
npm run docker:run
command, to run the docker container
Commit messages must meet conventional commits format.
Run npm run prepare
to install husky hooks.
Set syncDatabase
to false
in data-source.ts to enable migrations. Then run the following commands
- Run
npm run migration:generate -- ./src/migrations/<migration-name>
to generate a migration file. For examplenpm run migration:generate -- ./src/migrations/create-users-table
- Run
npm run migration:run
to run migrations - Run
npm run migration:revert
to revert migrations