A secure, RESTful Task Manager API built with Node.js, Express, and PostgreSQL.
It supports user authentication, task CRUD operations, pagination, and ownership-based access control.
Live API URL https://task-manger-api-0uw7.onrender.com
- User authentication using JWT
- Create, read, update, and delete tasks
- Tasks scoped to authenticated users
- Pagination support for task listings
- PostgreSQL database with migrations
- Secure SQL queries using parameterized statements
- Backend: Node.js, Express
- Database: PostgreSQL
- Auth: JWT (JSON Web Tokens)
- Migration: Custom SQL migration runner
- Logging: Custom logger utility
git clone https://github.com/andrepryme/task-manager-api.git
cd task-manager-api
npm install
Create a .env file:
PORT=3000
JWT_SECRET=mysecretkey
DB_HOST=localhost
DB_PORT=5432
DB_NAME=task_manager_db
DB_USER=task_manager_user
DB_PASSWORD=taskmanagerpass432
-
Create PostgreSQL database and user
-
Grant permissions
- Run migrations
node db/runMigrations.js
npm start
Server runs on:
All task routes are protected.
Send JWT token in headers:
Authorization: Bearer < token >
Create Task
POST /tasks
Get Tasks (Paginated)
GET /tasks?limit=10&offset=0
Get Task by ID
GET /tasks/:id
Update Task
PATCH /tasks/:id
Delete Task
DELETE /tasks/:id
-
limit (default: 10, max: 50)
-
offset (default: 0)
Example:
GET /tasks?limit=5&offset=10
-
Users can only access their own tasks
-
SQL injection prevention via parameterized queries
-
Auth middleware applied globally to task routes
-
✅ Version 1.0.0
-
✅ Production-ready core features
-
🔒 Feature-locked (maintenance mode)
Built as a backend portfolio project to demonstrate real-world API design, database modeling, and security practices.