TaskManager is a full-stack task management application designed to help users organize, track, and manage their daily tasks efficiently. The project demonstrates modern web development practices with a React frontend, Node.js/Express backend, and PostgreSQL database, all containerized with Docker for easy deployment and development.
This application solves the common problem of task organization by providing a clean, intuitive interface for creating, updating, and tracking tasks with proper authentication and data persistence.
- Frontend: React 18, React Router, Axios
- Backend: Node.js, Express, PostgreSQL (pg library)
- Authentication: JWT tokens, bcrypt for password hashing
- Database: PostgreSQL 15
- Containerization: Docker, Docker Compose
- Testing: Jest, Supertest
- Development: Git, npm
- Node.js (v18 or higher)
- Docker and Docker Compose
- Git
- Clone the repository:
git clone <repository-url>
cd TaskManager- Start all services with Docker Compose:
docker-compose up -dThis will:
- Start PostgreSQL database
- Run database migrations
- Start the Express API server
- Start the React development server
- Access the application:
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:5000/api - Health check:
http://localhost:5000/health
- Install dependencies:
# Root dependencies
npm install
# Server dependencies
cd server
npm install
# Client dependencies
cd ../client
npm install- Set up PostgreSQL database:
# Create database
createdb taskmanager
# Or using psql
psql -U postgres
CREATE DATABASE taskmanager;- Configure environment variables:
cd server
cp .env.example .env
# Edit .env with your database credentials and JWT secret- Run database migrations:
cd server
npm run migrate- Start the servers:
# Terminal 1 - Backend
cd server
npm run dev
# Terminal 2 - Frontend
cd client
npm start-
Register a new account: Navigate to the register page and create an account with your email and password (minimum 6 characters).
-
Login: Use your credentials to log in to the application.
-
Create tasks: Use the task form on the dashboard to create new tasks with a title and optional description.
-
Manage tasks:
- Toggle task completion by clicking the checkbox
- Edit tasks by clicking the "Edit" button
- Delete tasks by clicking the "Delete" button
-
POST /api/auth/register- Register a new user{ "email": "user@example.com", "password": "password123" } -
POST /api/auth/login- Login user{ "email": "user@example.com", "password": "password123" }
GET /api/tasks- Get all tasks for authenticated userGET /api/tasks/:id- Get a specific taskPOST /api/tasks- Create a new task{ "title": "Task title", "description": "Task description (optional)" }PUT /api/tasks/:id- Update a task{ "title": "Updated title", "description": "Updated description", "completed": true }DELETE /api/tasks/:id- Delete a task
All task endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <your-jwt-token>
TaskManager/
βββ client/ # React frontend application
β βββ public/ # Static assets
β β βββ index.html
β βββ src/
β β βββ components/ # Reusable React components
β β β βββ AuthForm.js
β β β βββ Layout.js
β β β βββ Navbar.js
β β β βββ ProtectedRoute.js
β β β βββ TaskForm.js
β β β βββ TaskItem.js
β β β βββ TaskList.js
β β βββ hooks/ # Custom React hooks
β β β βββ useAuth.js
β β β βββ useTasks.js
β β βββ pages/ # Page components
β β β βββ Dashboard.js
β β β βββ Login.js
β β β βββ Register.js
β β βββ services/ # API service layer
β β β βββ auth.js
β β β βββ tasks.js
β β βββ App.js # Main App component
β β βββ index.js # Entry point
β β βββ index.css # Global styles
β βββ Dockerfile
β βββ package.json
βββ server/ # Express backend application
β βββ src/
β β βββ config/ # Configuration files
β β β βββ config.js # Environment config
β β β βββ database.js # Database connection
β β βββ db/ # Database files
β β β βββ schema.sql # Database schema
β β β βββ migrations.js # Migration script
β β βββ middleware/ # Express middleware
β β β βββ auth.js # JWT authentication
β β β βββ validation.js # Input validation
β β βββ models/ # Data models
β β β βββ User.js
β β β βββ Task.js
β β βββ routes/ # API routes
β β β βββ auth.js
β β β βββ tasks.js
β β βββ utils/ # Utility functions
β β β βββ errors.js # Error handling
β β βββ index.js # Express app entry point
β βββ tests/ # Test files
β β βββ auth.test.js
β β βββ tasks.test.js
β β βββ setup.js
β βββ Dockerfile
β βββ package.json
βββ docker-compose.yml # Docker Compose configuration
βββ LICENSE
βββ README.md
βββ ARCHITECTURE.md
Run backend tests:
cd server
npm testRun tests in watch mode:
cd server
npm run test:watchPORT=5000
NODE_ENV=development
DB_HOST=localhost
DB_PORT=5432
DB_USER=taskmanager
DB_PASSWORD=taskmanager
DB_NAME=taskmanager
# Or use connection string
DATABASE_URL=postgresql://taskmanager:taskmanager@localhost:5432/taskmanager
JWT_SECRET=your-secret-key-change-in-production
JWT_EXPIRES_IN=7dThe client uses environment variables for API URL (optional):
REACT_APP_API_URL=http://localhost:5000/apiWith Docker:
docker-compose upWithout Docker:
# Terminal 1 - Backend
cd server
npm run dev
# Terminal 2 - Frontend
cd client
npm startRun migrations manually:
cd server
npm run migrateContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.