Node.js REST API for managing projects and tasks with MySQL and Redis.
- Node.js + Express - REST API (http://localhost:3000)
- MySQL 8.0 - Database (localhost:3306)
- Redis - Caching (localhost:6379)
- Sequelize - ORM
This REST API provides comprehensive project and task management capabilities with a clean, intuitive interface. The application offers full CRUD operations for both projects and tasks, including support for hierarchical task structures with subtasks.
- Project Management: Create, read, update, and delete projects with detailed information
- Task Management: Full task lifecycle management with project association
- Subtask Support: Create and manage subtasks within parent tasks for better organization
- GitHub Integration: Link GitHub repositories to projects and manage repository associations
- Redis Caching: High-performance caching for GitHub API responses (10-minute TTL)
- RESTful Design: Clean, predictable API endpoints following REST conventions
- Data Relationships: Proper linking between projects, tasks, subtasks, and GitHub repositories
The application includes interactive API documentation powered by Swagger UI, providing a comprehensive view of all available endpoints, request/response schemas, and the ability to test API calls directly from your browser.
To access the API Documentation, while running the application:
http://localhost:3000/api-docs
The Swagger interface allows you to:
- Browse all available endpoints organized by resource (Projects, Tasks, GitHub)
- View detailed request and response schemas
- Test API endpoints directly with sample data
- Understand required parameters and data types
- Explore the complete API functionality interactively
- Projects:
/api/projects- Complete project management - Tasks:
/api/tasks- Individual task operations - Project Tasks:
/api/projects/{id}/tasks- Project-specific task management - Subtasks:
/api/tasks/{id}/subtasks- Hierarchical task relationships - GitHub Integration:
/api/projects/{id}/github/{username}- Link and manage GitHub repositories
- Copy the environment template:
cp .env.template .env- Edit
.envfile with your preferred values:
DB_NAME=projects_db
DB_USER=root
DB_PASSWORD=rootpassword
MYSQL_ROOT_PASSWORD=rootpassword
# Redis Configuration
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD= (can be left empty...)
REDIS_TTL_GITHUB=600
Note: I has configured a Makefile on the project (which requires to be inside a linux enviroment). You could simple use docker-compose directives for running the project too; This is just for a more clear and intuitive setup.
make devmake prodmake dev-down # Stop development
make prod-down # Stop productionThe project includes a comprehensive test suite using Jest with SQLite in-memory database.
make dev-test # Run all tests once
make dev-test-watch # Run tests in watch mode
make dev-test-coverage # Run tests with coverage report- Unit Tests: Repository layer CRUD operations
- Database: SQLite in-memory for fast, isolated tests
- Coverage: Tracks all
src/**/*.jsfiles exceptapp.js - Mocking: Database layer mocked for testing isolation
Tests cover Project and Task entities including subtask relationships, validation, and error handling.