API built using Nest.js, Typescript, Prisma for ORM, and PlanetScale (MySQL) that performs operation on case managers, cases, and related case notes. This API is a part of the project CS 673 - Care Management and Co-ordination.
Nest.js is a progressive Node.js framework for building efficient and scalable server-side applications.
The Case Manager API is built using the Active Record Pattern.
Using the Active Record approach, one can define all their query methods inside the model itself, and save, remove, and load objects using model methods.
Simply, the Active Record pattern is an approach to access database within the defined models. You can read more about the Active Record pattern on Wikipedia.
- Clone the repository to your local machine.
$ git clone https://github.com/Boro23-wq/case-manager-api.git
- Change directory into the repository you just cloned.
$ cd case-manager-api
- Open the repository in your favorite code editor. I'm using VSCode. The shortcut to open a directory in VSCode is:
$ code .
Please make sure you are inside the directory.
- Finally, run the command below based on your package manager:
# yarn
$ yarn
OR
# npm
$ npm install
Please create a .env
or .env.local
file to set the PlanetScale database string. The string would look something like this:
DATABASE_URL='mysql:*********************************'
# development
$ npm run start
# watch mode
# Watch mode will basically watch for any changes to your code and restart the server accordingly which is very convenient.
$ npm run start:dev
# production mode
$ npm run start:prod
I haven't implemented any tests yet, but once the tests are added you'd have more information on how to run it.
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
- Author - Sintu Boro
- Blog - https://sboro.vercel.app/blog
- Linkedin - Sintu Boro
This project is MIT licensed.