This is a simple user API that allows you to perform CRUD (Create, Read, Update, Delete) operations on users using Node.js, NestJS and a relational database. The API also supports department interfaces with the ability to create and delete departments.
For more information about the API endpoints and how to use them, please refer to the API documentation.
Link to prod swagger - The service provided by the link runs on a cold start, so it may take a few minutes before the page is fully loaded and visible.
- Full CRUD API support for users
- The Get Users API supports filters param
- An API that returns the department list with user counters
- Seeded the database with at least 10 users and 3 departments
- Proper error messages are returned
- Written in TypeScript for better readability and maintainability
- Unit tests to ensure adequate coverage
NodeJS, Zod, Typescript, pg , Turborepo
Before running the application, you need to set up the following environment variables:
PORT
: server portPOSTGRES_HOST
: database host defaults - "localhost"POSTGRES_PORT
: database port defaults - 5432POSTGRES_USER
: database username defaults - "root"POSTGRES_PASSWORD
: database password defaults - "example"POSTGRES_DB
database db defaults - "users-api"POSTGRES_SECURE
database db defaults - "false"