A simple RESTful CRUD API for managing tasks, built with Express.js and documented with Swagger UI.
SQLite was chosen because it is a single-file database, requires zero server setup, and keeps data on disk so task state survives app restarts.
- Database file:
db/tasks.db - It is created automatically when the app opens the database.
- This file is usually git-ignored so each clone starts with a fresh local dataset.
npm testThe server starts on http://localhost:3000. Open http://localhost:3000/docs for interactive Swagger UI.
| Method | Endpoint | Description | Body |
|---|---|---|---|
| Method | Endpoint | Description | Request Body |
| ---------- | --------------- | -------------------------- | ----------------------------- |
GET |
/tasks |
List all tasks | — |
GET |
/tasks/:id |
Get a task by ID | — |
POST |
/tasks |
Create a new task | { "title": "Buy milk" } |
PUT |
/tasks/:id |
Update a task | { "title": "...", "done": true } |
DELETE |
/tasks/:id |
Delete a task | — |
HTTP/1.1 200 OK
Content-Type: application/json
[
{"id": 1, "title": "Learn Express", "done": false},
{"id": 2, "title": "Build a CRUD API", "done": false},
{"id": 3, "title": "Push to GitHub", "done": true}
]
HTTP/1.1 201 Created
Content-Type: application/json
{"title": "Naming mg git message"}
HTTP/1.1 200 OK
Content-Type: application/json
{"id": 1, "title": "Learn Express", "done": false}
HTTP/1.1 200 OK
Content-Type: application/json
{"id": 2, "title": "Pooping in the toilet", "done": false}
HTTP/1.1 204 No Content
Try it out at http://localhost:3000/docs for interactive testing.
Screenshot of tasks.db opened in DB Browser for SQLite:
One SQL query used in Stage 4 verification:
SELECT id, title, done FROM tasks ORDER BY id;





