Appointment Management System is a project build upon the Node and Typescript.
The main purpose of this project is to create the playground for the unit testing learning.
- Typescript
- Node
- Express
- PostgreSQL
- Prisma (ORM)
- User Registration and Login
- Appointment Add, Read, Update, Delete
- Unit testing
- Clone the repo.
- Install the dependencies by running
npm install
. - Run
npm run prisma:migrate
to migrate schema. - Run
npm run prisma:generate
to install prisma client.
npm run start:dev
start the server in development mode.
npm run test:dev
to start Jest testing
- Run
npm run prisma:migrate
to migrate the prisma.schema. - Run
npm run prisma:generate
to update the prisma client with latest changes so that you get typechecking for latest changes to your schema.
Every time you make changes to prisma/schema.prisma
make sure to run above commands.
For seeding run npm run prisma:seed
-
Run app in watch mode
npm run start:dev
-
Run test
npm run test
-
Run test with coverage
npm run test:badges
-
Run production build
npm run build
You can find the postman collection of the available APIs here
The application architecture follows the following structure:
- Route
- Controller
- Service
- Repository
For the unit testing, one can begin mocking and spying the PrismaClient to test the repository layer.
-
For repository layer testing, it is recommended to use the jest-mock to mock the PrismaClient.
-
For Service layer testing, it is recommended to use the Jest/SinonJS for mocking and spying.
-
For API testing, it is recommended to use supertest.
- Eklak Dangaura
- Nirajan Bist
- Ishwar Gautam
- Bipin Poudel