A RESTful API for managing tasks, built with Express.js, Prisma ORM, and MySQL.
It provides a REST API for managing tasks, intended to be consumed by a Next.js frontend.
https://task-tracker-backend-qt3n.onrender.com/docs/
- RESTful API for CRUD operations on tasks
- Prisma ORM with MySQL database
- Dockerized development environment
- Type-safe TypeScript setup
.env
-driven config for environment flexibility
- Node.js
- TypeScript
- Express.js
- Prisma
- MySQL
- Docker
git clone git@github.com:Gad-Ongoro/Back-End.git
cd Back-End
DATABASE_URL=mysql://root@localhost:3306/task_tracker
PORT=8080
Use Docker to start a MySQL container locally:
docker run --name mysql-dev \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_DATABASE=task_tracker \
-p 3306:3306 \
-d mysql:latest
npm install
npx prisma generate
npx prisma migrate dev --name init
This will:
- Apply schema changes to the database
- Create a new migration
- Generate the Prisma client into node_modules/.prisma/client
npm run dev
Server will start on: http://localhost:8080
Method | Route | Description |
---|---|---|
GET | /tasks |
Get all tasks |
GET | /tasks/:id |
Get task by id |
POST | /tasks |
Create a new task |
PUT | /tasks/:id |
Update a specific task |
DELETE | /tasks/:id |
Delete a task |
docker build -t task-tracker-api .
docker run -p 8080:8080 --env-file .env task-tracker-api
Command | Purpose |
---|---|
npm run dev |
Start dev server with nodemon |
npx prisma studio |
Open Prisma Studio (GUI for DB) |
npx prisma migrate dev |
Run migrations |
npx prisma generate |
Regenerate Prisma client |