Skip to content

panagiotisbellias/Task-Management-Software

Β 
Β 

Repository files navigation

Task Management System

A modern, full-stack task management application built with microservices architecture, featuring real-time notifications, role-based permissions, and a responsive React frontend.

πŸš€ Features

  • πŸ“‹ Task Management: Create, update, delete, and organize tasks
  • πŸ‘₯ User Management: Role-based access control (Admin/User)
  • πŸ”” Real-time Notifications: Instant updates for task changes
  • 🎯 Advanced Filtering: Filter tasks by status, priority, due date, and assignee
  • πŸ“± Responsive UI: Modern React frontend with dark mode support
  • πŸ—οΈ Microservices: Scalable, independent service architecture
  • πŸ” Secure Authentication: Token-based authentication system

πŸ›οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚   API Gateway    β”‚    β”‚  Microservices  β”‚
β”‚   (React)       │◄──►│    (Nginx)       │◄──►│                 β”‚
β”‚   Port: 3000    β”‚    β”‚   Port: 8000     β”‚    β”‚  Users: 8001    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  Tasks: 8002    β”‚
                                                β”‚  Notifications  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚  Port: 8003     β”‚
β”‚   Databases     β”‚    β”‚      Cache       β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚                 β”‚    β”‚                  β”‚
β”‚  Users DB       β”‚    β”‚     Redis        β”‚
β”‚  Tasks DB       β”‚    β”‚   (WebSocket)    β”‚
β”‚  Notifications  β”‚    β”‚                  β”‚
β”‚  (PostgreSQL)   β”‚    β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Backend

  • Framework: Django REST Framework
  • Architecture: Microservices
  • Database: PostgreSQL (3 separate instances)
  • Cache: Redis
  • WebSocket: Django Channels
  • API Gateway: Nginx
  • Containerization: Docker & Docker Compose

Frontend

  • Framework: Next.js 14 (React)
  • Styling: Tailwind CSS
  • State Management: React Context
  • HTTP Client: Axios
  • TypeScript: Full type safety

πŸ“‹ Prerequisites

  • Docker (v20.0+)
  • Docker Compose (v2.0+)
  • Node.js (v18+) - for frontend development
  • Python (v3.11+) - for backend development

πŸš€ Quick Start

1. Clone the Repository

git clone <repository-url>
cd "Task Management Software"

2. Start Backend Services

# Start all microservices
docker-compose up -d

# Wait for services to be ready (30-60 seconds)
docker-compose ps

3. Initialize Databases

# Run migrations for each service
docker-compose exec users-service python manage.py migrate
docker-compose exec tasks-service python manage.py makemigrations tasks
docker-compose exec tasks-service python manage.py migrate
docker-compose exec notifications-service python manage.py makemigrations notifications
docker-compose exec notifications-service python manage.py migrate

4. Create Admin User

docker-compose exec users-service python manage.py createsuperuser

5. Start Frontend (Optional)

cd frontend
npm install
npm run dev

6. Access the Application

7. Test the Setup

# Run API tests
python test_apis.py

πŸ“ Project Structure

Task Management Software/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ users-service/         # Authentication & user management
β”‚   β”‚   β”‚   β”œβ”€β”€ users/             # Django app
β”‚   β”‚   β”‚   β”œβ”€β”€ settings.py        # Service configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ manage.py          # Django management
β”‚   β”‚   β”‚   └── Dockerfile         # Container definition
β”‚   β”‚   β”œβ”€β”€ tasks-service/         # Task CRUD & business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ tasks/             # Django app
β”‚   β”‚   β”‚   β”œβ”€β”€ settings.py        # Service configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ asgi.py           # WebSocket support
β”‚   β”‚   β”‚   └── Dockerfile         # Container definition
β”‚   β”‚   └── notifications-service/ # Notification system
β”‚   β”‚       β”œβ”€β”€ notifications/     # Django app
β”‚   β”‚       β”œβ”€β”€ settings.py        # Service configuration
β”‚   β”‚       └── Dockerfile         # Container definition
β”‚   └── gateway/                   # Nginx API Gateway
β”‚       β”œβ”€β”€ nginx.conf            # Routing configuration
β”‚       └── Dockerfile            # Container definition
β”œβ”€β”€ frontend/                      # Next.js React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/                  # App router pages
β”‚   β”‚   β”œβ”€β”€ core/                 # Shared utilities
β”‚   β”‚   └── components/           # Reusable components
β”‚   β”œβ”€β”€ package.json              # Dependencies
β”‚   └── tailwind.config.js        # Styling configuration
β”œβ”€β”€ docker-compose.yml             # Service orchestration
β”œβ”€β”€ README.md                      # This file
└── API_DOCUMENTATION.md           # Complete API reference

πŸ”— API Overview

All API requests go through the API Gateway at http://localhost:8000/api/

πŸ” Authentication

  • POST /auth/login/ - User login
  • POST /auth/logout/ - User logout
  • GET /auth/verify/ - Token verification

πŸ“‹ Tasks

  • GET /tasks/ - List tasks (with filtering)
  • POST /tasks/ - Create new task
  • GET /tasks/{id}/ - Get specific task
  • PUT /tasks/{id}/ - Update task
  • PATCH /tasks/{id}/ - Partial update
  • DELETE /tasks/{id}/ - Delete task

πŸ”” Notifications

  • GET /notifications/ - List user notifications
  • PATCH /notifications/{id}/ - Mark as read

πŸ“– Complete API Documentation: API_DOCUMENTATION.md

πŸ—„οΈ Database Schema

Users Service Database

User {
  id: Primary Key
  username: Unique String
  email: String
  role: Enum(admin, user)
  password: Hashed String
  is_active: Boolean
  date_joined: DateTime
  last_login: DateTime
}

Tasks Service Database

Task {
  id: Primary Key
  title: String(200)
  description: Text
  priority: Enum(low, medium, high)
  status: Enum(todo, in_progress, completed)
  due_date: Date
  assigned_user: Integer (User ID)
  created_at: DateTime
  updated_at: DateTime
}

Notifications Service Database

Notification {
  id: Primary Key
  user: Integer (User ID)
  message: String(255)
  is_read: Boolean
  created_at: DateTime
}

πŸ” Authentication & Security

Token-Based Authentication

Authorization: Token your_token_here

Security Features

  • πŸ”’ Token Validation: All services validate tokens with users service
  • πŸ‘€ Role-Based Access: Admin and user roles with appropriate permissions
  • πŸ›‘οΈ CORS Protection: Configured for cross-origin requests
  • πŸ” Request Logging: Comprehensive logging for debugging and monitoring

Default Users

After running migrations, create users via Django admin or API:

  • Admin: Full access to all resources
  • User: Access only to assigned tasks

✨ Key Features

Task Management

  • πŸ“ CRUD Operations: Create, read, update, delete tasks
  • 🎯 Advanced Filtering: Filter by status, priority, due date, assignee
  • πŸ“Š Kanban Board: Visual task organization
  • πŸ“‹ Table View: Detailed task listing

Real-time Features

  • πŸ”” Instant Notifications: Real-time updates for task changes
  • πŸ”„ Auto-refresh: Periodic polling for updates
  • πŸ“± Responsive UI: Works on desktop and mobile

User Experience

  • πŸŒ™ Dark Mode: Built-in dark theme support
  • πŸ” Secure Login: Token-based authentication
  • πŸ‘₯ Role Management: Admin and user permissions
  • πŸ“± Mobile Friendly: Responsive design

πŸ”„ Real-time Updates

Current Implementation

  • Polling: Frontend polls for notifications every 30 seconds
  • Auto-notifications: Tasks automatically create notifications via Django signals
  • Instant UI Updates: Optimistic updates for better UX

WebSocket Support (Planned)

// Future WebSocket implementation
ws://localhost:8000/ws/notifications/

// Event format
{
  "type": "notification",
  "notification": {
    "id": 1,
    "message": "Task updated",
    "is_read": false
  }
}

πŸ”„ Service Communication

graph TD
    A[Frontend] --> B[API Gateway]
    B --> C[Users Service]
    B --> D[Tasks Service]
    B --> E[Notifications Service]
    D --> C
    E --> C
    C --> F[Users DB]
    D --> G[Tasks DB]
    E --> H[Notifications DB]
    D --> I[Redis]
    E --> I
Loading
  • 🌐 API Gateway: Single entry point, routes requests to appropriate services
  • πŸ” Authentication Flow: Services validate tokens with users service
  • πŸ“‘ Inter-service Communication: HTTP-based service-to-service calls
  • πŸ’Ύ Database Isolation: Each service has its own database

πŸ‘₯ User Roles & Permissions

Feature Admin User
View all tasks βœ… ❌
View assigned tasks βœ… βœ…
Create tasks βœ… βœ…
Edit any task βœ… ❌
Edit assigned tasks βœ… βœ…
Delete any task βœ… ❌
Delete assigned tasks βœ… βœ…
View all notifications βœ… ❌
View own notifications βœ… βœ…
User management βœ… ❌

πŸ“Š Monitoring & Logging

Logging Configuration

  • Level: DEBUG (development) / INFO (production)
  • Format: {levelname} {asctime} {module} {message}
  • Output: Console (Docker logs)
  • Coverage: All microservices with individual log streams

Viewing Logs

# View all services
docker-compose logs -f

# View specific service
docker-compose logs -f users-service
docker-compose logs -f tasks-service
docker-compose logs -f notifications-service
docker-compose logs -f gateway

πŸ› οΈ Development

Backend Development

# View service logs
docker-compose logs -f <service-name>

# Restart specific service
docker-compose restart <service-name>

# Scale services
docker-compose up --scale tasks-service=2

# Access service shell
docker-compose exec users-service bash

# Run Django commands
docker-compose exec users-service python manage.py shell

Frontend Development

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Run type checking
npm run type-check

Database Management

# Create migrations
docker-compose exec <service> python manage.py makemigrations

# Apply migrations
docker-compose exec <service> python manage.py migrate

# Access database
docker-compose exec <db-service> psql -U postgres -d <database>

πŸš€ Deployment

Production Considerations

  • Environment Variables: Configure via .env files
  • Database: Use managed PostgreSQL service
  • Redis: Use managed Redis service
  • SSL/TLS: Configure HTTPS in production
  • Monitoring: Add application monitoring (e.g., Sentry)
  • Backup: Implement database backup strategy

Docker Production

# Build production images
docker-compose -f docker-compose.prod.yml build

# Start production services
docker-compose -f docker-compose.prod.yml up -d

πŸ†˜ Troubleshooting

Common Issues

Services not starting:

# Check service status
docker-compose ps

# View error logs
docker-compose logs <service-name>

Database connection errors:

# Restart database services
docker-compose restart users-db tasks-db notifications-db

# Check database logs
docker-compose logs users-db

Frontend not connecting to API:

  • Verify API Gateway is running on port 8000
  • Check CORS configuration in backend services
  • Ensure environment variables are set correctly

Port conflicts:

# Check what's using the ports
netstat -tulpn | grep :8000

# Stop conflicting services or change ports in docker-compose.yml

Built with ❀️ using Django, React, and Docker

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 51.9%
  • Python 45.4%
  • Other 2.7%