This is a single service backend for OHL LABPRO 2023. This service can be used alongside this frontend app. This service implements simple REST API for Item, Company, and User.
13521044 Rachel Gabriela Chen
- Copy
.env.example
into.env
and fill with your local env variables.
$ yarn install
# development
$ yarn run start
# watch mode
$ yarn run start:dev
$ docker-compose up -d
Services and other classes are defined as providers, are injected into the controllers that need them
Providers (services and controllers) are created as singleton. This pattern ensures that the state is consistent across the application, and resources are efficiently managed.
Decorators are used to mark classes as controllers, services, modules, etc., and to specify routes, middleware, guards, and other features. The decorator pattern allows for a clean and declarative way to extend and modify the behavior of components without modifying their core implementation. It is also used to add the messages to the response data.
- NodeJS v18.16.1
- NestJS framework
- PostgresSQL
Documented with swagger (access through localhost:3000/api/docs
)