A task scheduling system built with Node, Express, TypeScript, Docker and PostgreSQL. Schedule tasks to run at specific times with priority handling and retry logic.
- Docker & Docker Compose v2
- Git
- Make (optional but recommended)
- Clone the repository
git clone https://github.com/0xironclad/Task-Scheduler-API.git
cd Task-Scheduler-API- Set up environment variables
cp .env.example .env- Start the development environment
make dev-up- API is now running at
http://localhost:3001
Test it:
curl http://localhost:3001
# {"message":"Hello World"}make dev-up # Start dev environment with hot reload
make dev-down # Stop dev environment
make dev-logs # View development logsmake up # Build & run production containers
make down # Stop production containers
make logs # View production logsThe PostgreSQL database is accessible in development mode only for debugging and inspection.
Host: localhost (or 127.0.0.1)
Port: 5433
Username: postgres
Password: postgres
Database: appdb
Host: host.docker.internal
Port: 5433
Username: postgres
Password: postgres
Database: appdb
Note: In production mode, the database is not exposed and only accessible internally by the API container.
The database schema (tables, types, indexes) is automatically created when the containers start for the first time. The initialization script is located at src/data/queries.sql.
If you need to reset the database:
# Development
make dev-down
docker volume rm task-scheduler_dev_pg_data
make dev-up
# Production
make down
docker volume rm task-scheduler_prod_pg_data
make upsrc/
├── config/ # Database configuration
├── controller/ # Request handlers
├── data/ # SQL schemas and test utilities
├── middlewares/ # Validation and error handling
├── models/ # Database queries
└── routes/ # API routes
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: PostgreSQL 16
- Validation: Joi
- Dev Tools: tsx for hot reload
- Fork the repo
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Test locally with
make dev-up - Submit a pull request
GET /- Health checkGET /api/v1/tasks- Get all tasks (with filters)POST /api/v1/tasks- Create a new task
More endpoints coming soon!