This project uses @nestjsx/crud to simplify and standardize the REST API
This backend is based on NestJS Framework V6 (https://nestjs.com/)
- DB: Postgres
- Websockets: Socket.io
- Synchronises sockets thourgh Redis adapter for horizontal scaling
Frontend is available here: https://github.com/avatsaev/angular-contacts-app-example
SERVER_PORT: 3000
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: contacts_db
POSTGRES_PASSWORD: contacts_db_pass
POSTGRES_DB: contacts_db
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_ENABLED: 'true'
docker-compose up --build
Server will be running on http://localhost:3000
GET /contacts
: returns an array ofContacts
GET /contacts/:id
: returns aContact
shapePOST /contacts
: Create a contact, returns aContact
shapePATCH /contacts/:id
: Partially update aContact
, returns aContact
shapeDELETE /contacts/:id
: Delete aContact
, empty response
interface Contact {
id?: number | string;
name: string;
email: string;
phone?: string;
}
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov