Skip to content

crimsonvspurple/hemonto

Repository files navigation

NPM Version Package License

Description

A rapid prototype of a REST API system for some slicing and dicing! docker-compose up and localhost:3000/api is all you need to get started.

Goals

  • Get hands wet with NestJS. Great framework for building scalable Node.js applications. Documentation is very good.
  • Use TypeORM, Class-Validator, Class-Transformer, and other libraries already familiar with.
  • Error handling and proper response codes. Would implement global exception filter later.
  • SQLite integration for development and testing.
  • Employee CRUD, partial User CRUD
  • DB Seeder endpoints
  • Use of NestJS CLI for best practices.
  • Proper DTO and Entity separation with validation.
  • Some usage of global pipes and interceptors. Need to use more for better code structure.
  • JWT Authentication (TBD: Refresh Token)
  • Role-based Authorization
  • Unit Tests
  • E2E Tests
  • Dockerize
  • CI/CD (Soon)
  • Serverless microservices with AWS Lambda (Near future)
  • Secrets management with AWS Secrets Manager
  • Add caching with Redis and search with ElasticSearch
  • Add scheduler and MQ processing
  • Base Models, Repositories, Services, and Controllers to reduce boilerplate code
  • Swagger API Documentation

Some Observations

  • Important things to follow: DRY, Separation of Concern and Clean Code.
  • Use of DTOs and Entities are very important. DTOs are used for validation and Entities are used for database operations.
  • Global pipes and interceptors can be used for logging, validation, and other purposes. Really important for better code structure.
  • Have to always be careful about DB query. Instead of querying the employees and calculating mean/min/max (SS), doing it over the DB is much faster/effective.
  • Code has to be well documented and efficient. Always have to think about edge cases and scalability.

Quick Start

$ docker-compose up # start the nodejs server at localhost:3000
$ yarn install  # install dependencies for dev
$ yarn run start:dev  # watch mode dev
$ yarn run test # unit tests
$ yarn run test:e2e # e2e tests
$ yarn run test:cov # test coverage

License

MIT licensed.

About

Making something with NestJS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published