A modern task management application built with React, Node.js, PostgreSQL, and Docker.
- Task Management: Create, update, delete, and organize tasks with different statuses (To Do, In Progress, Done)
- Comments System: Add and manage comments on tasks with author information
- Tags System: Color-coded tags for task organization and filtering
- Task Statistics: Visual dashboard showing task counts by status
- Responsive Design: Dark theme with mobile-first approach
- Real-time Updates: Optimistic updates with React Query
- Frontend: React 19 + TypeScript + Vite
- Backend: Node.js + Express.js + TypeScript
- Database: PostgreSQL 15 with UUID primary keys
- Containerization: Docker + Docker Compose
- State Management: React Query (v3) for server state
- Styling: CSS Custom Properties (CSS Variables)
- Icons: Lucide React
- Security: Helmet.js, CORS, input validation with Joi
You can run this application either with Docker (recommended) or directly on your machine (without Docker). See below for the requirements for each approach.
- Docker and Docker Compose installed
- PostgreSQL 15+ installed and running locally
- Node.js 18+ and npm installed
-
Clone the repository
git clone <repository-url> cd copilot-demo-fullstack
-
Copy and configure environment variables
cp .env.example .env
-
Start all services
docker-compose up --build
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Database: postgresql://localhost:5432/taskmanager
-
Test the setup (optional)
chmod +x test-setup.sh ./test-setup.sh
- PostgreSQL 15+ installed and running
- Node.js 18+ and npm
-
Database Setup
# Create database createdb taskmanager # Run initialization script psql -U postgres -d taskmanager -f database/init.sql
-
Backend Setup
cd backend npm install # Update .env with local database settings # DB_HOST=localhost (instead of 'database') npm run dev # Backend will run on http://localhost:5000
-
Frontend Setup
cd frontend npm install # Update .env with local backend URL if needed # VITE_API_URL=http://localhost:5000 npm run dev # Frontend will run on http://localhost:3000
GET /api/tasks
- Get all tasks (with optional filtering)GET /api/tasks/:id
- Get single taskPOST /api/tasks
- Create new taskPUT /api/tasks/:id
- Update taskDELETE /api/tasks/:id
- Delete task
GET /api/comments/:taskId
- Get comments for a taskPOST /api/comments/:taskId
- Add comment to taskPUT /api/comments/:id
- Update commentDELETE /api/comments/:id
- Delete comment
GET /api/tags
- Get all tagsPOST /api/tags
- Create new tagPUT /api/tags/:id
- Update tagDELETE /api/tags/:id
- Delete tag
# Start all services
docker-compose up
# Start in background
docker-compose up -d
# Stop all services
docker-compose down
# View logs
docker-compose logs -f [service-name]
# Rebuild services
docker-compose up --build
# Frontend only
docker-compose up frontend
# Backend only
docker-compose up backend
# Database only
docker-compose up database
# Access database shell
docker-compose exec database psql -U postgres -d taskmanager
# View database logs
docker-compose logs database
# Reset database
docker-compose down
docker volume rm task-manager_postgres_data
docker-compose up database
├── docker-compose.yml # Docker services configuration
├── .env.example # Environment variables template
├── .env # Environment variables (local)
├── README.md # This file
├── test-setup.sh # Setup validation script
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components (Tasks, Tags)
│ │ ├── services/ # API services and HTTP client
│ │ ├── types/ # TypeScript type definitions
│ │ └── styles/ # CSS styles and CSS variables
│ ├── package.json # Frontend dependencies
│ ├── vite.config.ts # Vite configuration
│ ├── index.html # HTML entry point
│ └── Dockerfile.dev # Development Docker image
├── backend/ # Node.js backend application
│ ├── src/
│ │ ├── routes/ # API route handlers (tasks, comments, tags)
│ │ ├── database/ # Database connection and configuration
│ │ ├── types/ # TypeScript type definitions
│ │ ├── app.ts # Express app configuration
│ │ └── server.ts # Server entry point
│ ├── package.json # Backend dependencies
│ ├── tsconfig.json # TypeScript configuration
│ └── Dockerfile.dev # Development Docker image
└── database/ # Database initialization
└── init.sql # Database schema and seed data
The .env.example
file contains all required environment variables:
# Database Configuration
DB_HOST=database # Use 'localhost' for local development
DB_PORT=5432
DB_NAME=taskmanager
DB_USER=postgres
DB_PASSWORD=password
# Backend Configuration
NODE_ENV=development
CORS_ORIGIN=http://localhost:3000
# Frontend Configuration
VITE_API_URL=http://localhost:8000 # Backend API endpoint
Note: For local development without Docker, change DB_HOST
to localhost
.
The application uses PostgreSQL with the following main tables:
- tasks: Task information with UUID primary keys
- tags: Color-coded tags for organization
- task_tags: Many-to-many relationship between tasks and tags
- comments: Task comments with author information
All tables use UUID primary keys and include proper indexes for performance.
- Monorepo Structure: Frontend and backend in separate folders
- Docker-First Development: Optimized for containerized development
- TypeScript Throughout: Both frontend and backend use TypeScript
- React Query: Handles server state, caching, and optimistic updates
- CSS Variables: Consistent theming with CSS custom properties
- Security Headers: Helmet.js for security best practices
Port already in use
docker-compose down
# Check for running processes on ports 3000, 8000, 5432
lsof -ti:3000,8000,5432 | xargs kill -9
Database connection issues
# Check database logs
docker-compose logs database
# Recreate database volume
docker-compose down
docker volume rm copilot-demo-fullstack_postgres_data
docker-compose up database
Frontend build issues
# Clear node_modules and reinstall
cd frontend
rm -rf node_modules package-lock.json
npm install
Backend compilation errors
# Clear TypeScript cache and rebuild
cd backend
rm -rf dist node_modules package-lock.json
npm install
npm run build
- CORS protection
- Helmet.js security headers
- Input validation with Joi
- SQL injection prevention with parameterized queries
- Environment variable protection
This project is open source and available under the MIT License.