A task management dashboard built with Express 5, TypeScript, and PostgreSQL.
- Runtime: Node.js + TypeScript (via
tsx) - Framework: Express 5
- Database: PostgreSQL with
pg(node-postgres) - Validation: Zod 4
- Frontend: Vanilla HTML/CSS/JS (served separately)
├── database/
│ ├── pool.ts DB connection pool
│ └── queries.ts SQL query functions
├── routes/
│ └── tasksRouter.ts Express route handlers for /api/tasks
├── src/
│ ├── schemas/
│ │ └── schema.ts Zod validation schemas
│ └── server.ts Express app entry point
├── test_routes.bat API endpoint test script
├── tsconfig.json
└── package.json
npm installCreate a .env file in the project root:
DB_USER=your_db_user
DB_HOST=localhost
DB_DATABASE=your_db_name
DB_PASSWORD=your_db_password
DB_PORT=5432
PORT=3000npm start # starts with tsx
npm run dev # starts with file-watch mode (auto-restart on changes)Server runs at http://localhost:3000.
Health check. Returns "server is running".
Fetch tasks with optional filters and pagination.
Query parameters:
| Param | Type | Default | Description |
|---|---|---|---|
name |
string | "" |
Filter by assignee (ILIKE) |
priority |
string | — | Filter by priority |
page |
number | 1 |
Page number |
limit |
number | 3 |
Items per page (max 100) |
Response:
{
"tasks": [ ... ],
"meta": {
"currentPage": 1,
"limit": 3,
"totalTasks": 10,
"totalPages": 4
}
}Create a new task.
Body:
{
"title": "Task title",
"assigned_to": "Person name",
"priority": "low",
"status": "pending",
"due_date": "2026-07-15"
}Update one or more fields of a task.
Body: Any subset of title, assigned_to, priority, status, due_date.
test_routes.batThe script:
- Auto-starts the server if not running
- Tests all 4 routes (GET, POST, PATCH, error cases)
- Reports pass/fail counts
- Exits with code 0 on success, 1 on failure
| Command | Description |
|---|---|
npm start |
Start server with tsx |
npm run dev |
Start server with file watching |
.\test_routes.bat |
Run API endpoint tests |