This API is meant as a basic API to learn how to implement REST CRUD actions into a front-end application.
It has basic CRUD actions for a task:
- Create a
taskwithPOST /tasks - Read a
taskwithGET /tasksorGET /tasks/:id - Update a
taskwithPATCH /tasks/:id - Delete a
taskwithDELETE /tasks/:id
- Node - The JavaScript runtime used to run the backend
- TypeScript - Language used to add static types on top of JavaScript
- Express - A framework used to build an API with Node
- Prisma - Used as the ORM for defining and accessing the Database
- SQLite - A small, fast, and portable SQL based Database
- Run
nvm useto use the supported version ofnode - Run
npm ito install the dependencies - Create a
.envfile located at./prisma/.envwith the contentsDATABASE_URL="file:./dev.db" - Run
npm run prisma:migrateto setup (or reset) the database - Run
npm startto start the API - Run
npm run prisma:studioto open the Prisma Studio UI
- Follow the Setup Instructions to get the API and Prisma Studio running locally
- If desired, manually add data to the Database by using Prisma Studio
- Once the API is running it can be accessed at
http://localhost:3001 - If you need to reset the Database you can use the script
npm run prisma:migrate - A list of routes is located at
docs/routes.md - A description of the different entities is located at
docs/entities.md
./src/index.ts- This file is where the Express server is located and where the routes are defined./prisma/schema.prisma- This is where the Database schema is defined./prisma/dev.db- This file is the actual SQLite database, it can be deleted to reset the DB