Back to Projects
Task Manager API
A RESTful API for task management built with Express and PostgreSQL. Features JWT authentication, role-based access control, and comprehensive test coverage.
November 12, 2023
Node.jsExpressPostgreSQLJWTJest
Overview
A production-ready REST API for managing tasks and projects, built as a backend service that can power any task management frontend. Designed with security and scalability in mind.
Key Features
- CRUD Operations: Full create, read, update, and delete for tasks and projects
- Authentication: JWT-based auth with refresh tokens
- Authorization: Role-based access control (admin, manager, member)
- Filtering & Pagination: Query tasks by status, assignee, due date, and priority
- Audit Logging: Track all changes with timestamps and user attribution
Technical Details
Built with Express.js and PostgreSQL using Knex.js for query building and migrations. The API follows REST conventions and includes input validation with Zod, rate limiting, and CORS configuration.
Testing
- Unit tests for all service layer functions
- Integration tests for API endpoints
- 94% code coverage with Jest
- CI/CD pipeline running tests on every push
Lessons Learned
Designing a clean API required careful thought about resource naming, pagination strategies, and error response formats. Implementing refresh token rotation was particularly tricky to get right securely.