Carma-Tech API, built based on nest-starter
Build a modular REST API with NestJS framework.
- What is this?
- Run(Dev Mode)
- DB Migrations
- Tests
- Environment Configuration
- API Documentation
- Authentication
- License
- Maintainers
A REST API template based on NestJS with JWT auth, Open API 3.0 documentation, TypeORM integration already implemented.
cp .env.example .env
docker-compose up -d
Create dotenv file and fill it with proper values
cp .env.example .env
Install dependencies
yarn install
Run the application
yarn start:dev
HMR(Hot Module Reload) is configured with webpack, so you can use
yarn start
If you don't work on a production-ready project you can always change DB_SYNC
env variable to true so you can play with NestJS without the need to write actual migrations.
DB_SYNC
should not be set to true
in production. You may lose production data otherwise!
Make sure to use npm
for commands follow, because yarn
does not support $npm_config_name
.
npm run migration:generate --name=AddAgeColumnToUser
Or with docker:
docker exec -it nest npm run migration:generate --name=AddAgeColumnToUser
Migration files are placed under src/migrations
.
yarn migration:run
yarn migration:revert
# unit tests
yarn test
# e2e tests
yarn test:e2e
# test coverage
yarn test:cov
@nestjs/config
is used, so you can just inject ConfigService
to read environment variables from the dotenv file.
OpenAPI 3.0 is configured, and the API docs is hosted at BASE_URL/api/docs
.
JWT authentication is configured.
It would be greater to change the current password hashing to something more secure.
MIT