Guardian is an API server for a toy project, where users can register themselves as guardians (for a temporary period of time) to pets that are registered in the service.
This project uses:
- Typescript as the main language
- Express as server framework
- MySQL as database
- tsoa for automated routes & swagger specification generation
- Jest as testing framework
-
Make sure to fill in the variables in the
.env
file to run or test this project.# .env.example # user of MySQL database DB_USERNAME="" # password of MySQL database DB_PASSWORD=""
-
Also make sure to run
npm run db:init
to initialize the database before running the server.
After cloning this repository, run:
npm install
To run the development server, run:
npm run dev
To run testing, run:
npm test
To generate swagger documentation only (to docs/swagger.json
), run:
npm run tsoa
To view swagger docs, run npm run dev
and visit localhost:3000/docs
in your browser.