A production-style REST API for managing tasks with JWT authentication.
This project was created as part of a technical writing portfolio to demonstrate documentation for a working REST API, including onboarding guides, reference material, and troubleshooting documentation.
Full documentation: see the /docs directory.
Start with:
➡ docs/index.md — Developer documentation entry point
- Documenting a functioning REST API
- Testing endpoints using Postman
- Designing developer onboarding workflows
- Structuring documentation using docs-as-code practices
- User signup and login with hashed passwords
- JWT-based authentication on all task endpoints
- Full task CRUD: create, read, update, delete
- Filter tasks by status or priority
- Centralized error handling
task-api/
├── src/
│ ├── server.js # App entry point
│ ├── db/
│ │ └── database.js # SQLite connection & table setup
│ ├── middleware/
│ │ ├── auth.js # JWT verification middleware
│ │ └── errorHandler.js # Global error handler
│ ├── controllers/
│ │ ├── authController.js # Signup & login logic
│ │ └── taskController.js # Task CRUD logic
│ └── routes/
│ ├── auth.js # Auth route definitions
│ └── tasks.js # Task route definitions
├── .env.example # Environment variable template
├── .gitignore
└── package.json
Create a task:
curl -X POST http://localhost:3000/api/tasks
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"
-d '{
"title": "Write documentation",
"priority": "high"
}'1. Install dependencies
npm install2. Set up environment variables
cp .env.example .env
# Edit .env and set a strong JWT_SECRET3. Start the server
npm run dev # with auto-reload (requires nodemon)
npm start # standard startThe server starts at http://localhost:3000.
Full developer documentation is available in the /docs folder.
Start here:
- docs/index.md — documentation overview
- docs/getting-started.md — onboarding guide
- docs/authentication-guide.md — JWT walkthrough
- docs/api-reference.md — full endpoint documentation
- docs/troubleshooting.md — common problems and fixes
This repository includes a working task management API used to demonstrate professional developer documentation practices.
The focus of this project is the documentation system, including onboarding guides, authentication walkthroughs, endpoint reference material, and troubleshooting documentation.
The API endpoints were tested using real HTTP requests via Postman and documented using a docs-as-code workflow.
| Method | Path | Auth Required | Description |
|---|---|---|---|
| GET | /health | No | Health check |
| POST | /api/auth/signup | No | Register new user |
| POST | /api/auth/login | No | Login, receive JWT |
| GET | /api/tasks | Yes | List your tasks |
| POST | /api/tasks | Yes | Create a task |
| GET | /api/tasks/:id | Yes | Get one task |
| PATCH | /api/tasks/:id | Yes | Update a task |
| DELETE | /api/tasks/:id | Yes | Delete a task |
After login, include the token in all task requests:
Authorization: Bearer <your_token_here>
| Field | Type | Values | Required |
|---|---|---|---|
| title | string | Any text | Yes |
| description | string | Any text | No |
| status | string | pending, in_progress, completed |
No |
| priority | string | low, medium, high |
No |
| due_date | string | ISO date, e.g. 2024-12-31 |
No |
MIT License — see the LICENSE file for details.