NodeJS: https://nodejs.org/en/
Nest: https://nestjs.com/
A progressive Node.js framework for building efficient and scalable server-side applications on top of TypeScript & JavaScript (ES6 / ES7 / ES8) heavily inspired by Angular
TypeORM: http://typeorm.io
TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap and Ionic platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7)
MariaDB: https://mariadb.org/
Docker: https://www.docker.com/
- https://docs.docker.com/installation
- https://docs.docker.com/compose/install/
- Manage Docker as a non-root user
You have to create your own .env
file, avoiding sharing password, and customizing depending on your own dev environment.
You can copy the default file, and have to update it. Or create your own.
cp .env.default .env
Set your DB_PASSWORD
and DB_ROOT_PASSWORD
(for dev environment).
./bin/dev-start.sh
It will starts 2 containers:
- MariaDB server for the API data on
3306
port. - Adminer to manage MariaDB data while programming on http://localhost:8080.
npm run start
# Watch for changes for automatic restart
npm run start:watch
The default URL is http://localhost:3000.
./bin/dev-clear.sh
# Build for production
npm run prestart:prod
# Start the production app version
npm run start:prod
# Start all stack
DB_PASSWORD={{your_pwd}} DB_ROOT_PASSWORD={{your_pwd}} ./bin/prod-start.sh
# Inject fixtures
docker exec rams-prod-app node dist/bin/fixtures-init.js
# Clear all prod data and containers
./bin/prod-clear.sh
# Insert fixtures data
npm run fixtures:init
# Remove all fixtures from DB
npm run fixtures:clear
# Run unit tests
npm test
# Run and watch unit tests
npm run test:watch
# Run unit tests coverage
npm run test:coverage
# Opn coverage html report
npm run open:coverage
# Run end-to-end tests
npm run e2e
# Run and watch end-to-end tests
npm run e2e:watch
- API: http://localhost:3000
- Swagger definitions: http://localhost:3000/swagger
- Adminer: http://localhost:8080
- Check the compatibility for
enum
in swagger nestjs library (Github issue). - Check the tests coverage for
constructor
with injection - Find a way to not expose URLs in Swagger (e.g. list of movies)
- The logger is logging duplication when a request is called.
NestJS
Docker
Misc
Tips
- TypeORM repositories for unit testing: here