Skip to content

Zaidfarooqui01/Task_Management_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‹ Task Management System - Full Stack Application

A complete full-stack Task Management Web Application demonstrating modern web development practices with .NET Core 6 backend and Angular frontend.

🎯 Project Overview

This project showcases a complete implementation of a task management (mini to-do) application with:

  • Backend: RESTful API built with .NET Core 6, Entity Framework Core, and Swagger documentation
  • Frontend: Interactive single-page application built with Angular 16
  • MVC: Optional server-side rendering with ASP.NET Core Razor views
  • UI: Beautiful, fully responsive design with light/dark mode toggle

✨ Features

πŸ‘€ User Features

  • βœ… View a list of all tasks
  • βœ… Add a new task
  • βœ… Edit an existing task
  • βœ… Delete a task
  • βœ… Mark a task as "Completed" or "Pending"
  • βœ… Real-time task statistics (Total, Completed, Pending, Progress %)
  • βœ… Filter tasks by status
  • βœ… Light/Dark mode toggle with local storage persistence
  • βœ… Responsive design for all devices
  • βœ… Form validation with helpful error messages

βš™οΈ Backend Features

  • RESTful API with complete CRUD operations
  • Entity Framework Core with In-Memory Database
  • Layered Architecture (Controller β†’ Service β†’ Repository)
  • Comprehensive model validation
  • Structured exception handling
  • Logging infrastructure
  • Swagger/OpenAPI documentation
  • CORS support for frontend integration
  • MVC support for server-side rendering

πŸ–₯️ Frontend Features

  • Component-based architecture
  • Reactive Forms with validation
  • Angular Services for API communication
  • RxJS Observables for reactive programming
  • Routing and navigation
  • CSS3 with CSS Variables for theming
  • Mobile-responsive design
  • Smooth animations and transitions

πŸ“ Project Structure

Task-Management-App/
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ TaskManagementAPI/
β”‚   β”‚   β”œβ”€β”€ Controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ TasksController.cs          # API endpoints
β”‚   β”‚   β”‚   └── HomeController.cs           # MVC controller
β”‚   β”‚   β”œβ”€β”€ Models/
β”‚   β”‚   β”‚   └── Task.cs                     # Task model
β”‚   β”‚   β”œβ”€β”€ DTOs/
β”‚   β”‚   β”‚   β”œβ”€β”€ TaskDTO.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateTaskDTO.cs
β”‚   β”‚   β”‚   └── UpdateTaskDTO.cs
β”‚   β”‚   β”œβ”€β”€ Services/
β”‚   β”‚   β”‚   └── TaskService.cs              # Business logic
β”‚   β”‚   β”œβ”€β”€ Data/
β”‚   β”‚   β”‚   └── ApplicationDbContext.cs     # Database context
β”‚   β”‚   β”œβ”€β”€ Views/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home/
β”‚   β”‚   β”‚   β”‚   └── Index.cshtml            # MVC view
β”‚   β”‚   β”‚   └── Shared/
β”‚   β”‚   β”‚       └── _Layout.cshtml          # Layout template
β”‚   β”‚   β”œβ”€β”€ Program.cs                      # Application setup
β”‚   β”‚   β”œβ”€β”€ appsettings.json
β”‚   β”‚   └── TaskManagementAPI.csproj        # Project file
β”‚   β”œβ”€β”€ Dockerfile                          # Docker image for backend
β”‚   └── Properties/
β”‚       └── launchSettings.json             # Launch configuration
β”œβ”€β”€ Frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ task-list/              # Task list component
β”‚   β”‚   β”‚   β”‚   └── task-form/              # Task form component
β”‚   β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”‚   └── task.service.ts         # API service
β”‚   β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   β”‚   └── task.model.ts           # TypeScript models
β”‚   β”‚   β”‚   β”œβ”€β”€ app.component.*             # Main app component
β”‚   β”‚   β”‚   β”œβ”€β”€ app.module.ts               # App module
β”‚   β”‚   β”‚   β”œβ”€β”€ app-routing.module.ts       # Routing module
β”‚   β”‚   β”‚   └── styles.css                  # Global styles
β”‚   β”‚   β”œβ”€β”€ main.ts                         # Bootstrap file
β”‚   β”‚   β”œβ”€β”€ index.html                      # HTML entry point
β”‚   β”‚   └── styles/
β”‚   β”œβ”€β”€ angular.json                        # Angular CLI config
β”‚   β”œβ”€β”€ package.json                        # NPM dependencies
β”‚   β”œβ”€β”€ tsconfig.json                       # TypeScript config
β”‚   β”œβ”€β”€ Dockerfile                          # Docker image for frontend
β”‚   └── README.md                           # Frontend documentation
β”œβ”€β”€ docker-compose.yml                      # Docker Compose configuration
└── README.md                               # This file

πŸ—οΈ Project Architecture

Backend Architecture Layers

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         HTTP Request/Response            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Controllers (API Endpoints)         β”‚
β”‚  - TasksController.cs                   β”‚
β”‚  - HomeController.cs                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Services (Business Logic)              β”‚
β”‚  - TaskService.cs                       β”‚
β”‚  - Validation & Processing              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Data Access (DbContext)                β”‚
β”‚  - ApplicationDbContext.cs              β”‚
β”‚  - Entity Framework Queries             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     In-Memory Database                  β”‚
β”‚  (Entity Framework In-Memory)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Frontend Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         App Component (Root)             β”‚
β”‚  - Theme Management                      β”‚
β”‚  - Layout Control                        β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                          β”‚
       β–Ό                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Task Form       β”‚      β”‚ Task List       β”‚
β”‚ Component       β”‚      β”‚ Component       β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                          β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚ TaskService      β”‚
         β”‚ (RxJS/Observable)β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚ HttpClient       β”‚
         β”‚ (Angular HTTP)   β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚ API (localhost:  β”‚
         β”‚      5000)       β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

  • .NET Core 6 SDK or later
  • Node.js 18 or later
  • npm or yarn
  • Visual Studio Code (recommended) or Visual Studio

Backend Setup

  1. Navigate to Backend Directory

    cd Backend/TaskManagementAPI
  2. Restore NuGet Packages

    dotnet restore
  3. Build the Project

    dotnet build
  4. Run the Application

    dotnet run

    The API will start on http://localhost:5000

  5. Access Swagger Documentation Open browser and navigate to: http://localhost:5000/swagger

Frontend Setup

  1. Navigate to Frontend Directory

    cd Frontend
  2. Install Dependencies

    npm install
  3. Start Development Server

    npm start

    The Angular application will open at http://localhost:4200

Access the Application

πŸ”Œ API Endpoints

All endpoints are located at http://localhost:5000/api/tasks

Method Endpoint Description
GET /api/tasks Get all tasks
GET /api/tasks/{id} Get task by ID
POST /api/tasks Create new task
PUT /api/tasks/{id} Update task
DELETE /api/tasks/{id} Delete task
PATCH /api/tasks/{id}/toggle Toggle task completion status

Request/Response Examples

Create Task (POST)

{
  "title": "Complete project documentation",
  "description": "Write comprehensive README and API documentation"
}

Update Task (PUT)

{
  "title": "Complete project documentation",
  "description": "Write comprehensive README and API documentation",
  "status": "Pending"
}

Response

{
  "id": 1,
  "title": "Complete project documentation",
  "description": "Write comprehensive README and API documentation",
  "status": "Pending",
  "createdAt": "2024-03-30T10:00:00Z",
  "completedAt": null,
  "updatedAt": "2024-03-30T10:00:00Z"
}

🎨 Light/Dark Mode

The application includes a sophisticated theme system:

  • Light Mode (Default): Clean, bright interface perfect for daytime use
  • Dark Mode: Eye-friendly interface for low-light environments
  • Automatic Detection: Respects system theme preferences
  • Local Storage: User preference is saved and persists across sessions
  • Smooth Transitions: CSS-based animations for theme switching

Theme Colors

Light Mode:

  • Primary: #3b82f6 (Blue)
  • Background: #ffffff (White)
  • Text: #1f2937 (Dark Gray)

Dark Mode:

  • Primary: #3b82f6 (Blue)
  • Background: #1f2937 (Dark Gray)
  • Text: #f3f4f6 (Light Gray)

πŸ› οΈ Architecture & Design Patterns

Backend Architecture

Controller Layer
    ↓
Service Layer (Business Logic)
    ↓
Repository Layer (Data Access)
    ↓
Database Context (EF Core)
    ↓
In-Memory Database

Frontend Architecture

App Component (Root)
    β”œβ”€β”€ Task Form Component
    β”‚   └── TaskService
    └── Task List Component
        └── TaskService β†’ HTTP Client β†’ API

Key Design Patterns Used

  1. Repository Pattern: Abstraction layer for data access
  2. Service Layer Pattern: Centralized business logic
  3. Dependency Injection: Loose coupling and testability
  4. Component-Based Architecture: Reusable, modular UI components
  5. Observable Pattern: Reactive data flow with RxJS
  6. DTO Pattern: Data Transfer Objects for API communication

πŸ“Š Database Schema

Task Model

public class Task
{
    public int Id { get; set; }
    public string Title { get; set; }                  // Required, 3-200 chars
    public string Description { get; set; }           // Optional, max 1000 chars
    public TaskStatus Status { get; set; }            // Pending or Completed
    public DateTime CreatedAt { get; set; }
    public DateTime? CompletedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
}

public enum TaskStatus
{
    Pending = 0,
    Completed = 1
}

🐳 Docker Support

The project includes Docker support for containerized deployment:

Build and Run with Docker Compose

# Build images
docker-compose build

# Start both services
docker-compose up

# Stop services
docker-compose down

Individual Docker Commands

Backend:

docker build -f Backend/Dockerfile -t task-api .
docker run -p 5000:80 task-api

Frontend:

docker build -f Frontend/Dockerfile -t task-ui .
docker run -p 4200:4200 task-ui

πŸ§ͺ Testing Recommendations

Backend Testing

  • Use Postman or Insomnia for API testing
  • Unit tests can be added using xUnit or NUnit
  • Integration tests for service layer

Frontend Testing

  • Component tests using Jasmine/Karma
  • E2E tests using Cypress or Protractor
  • Manual testing for UI/UX validation

πŸ”’ Validation & Error Handling

Backend Validation

  • Model-level validation using Data Annotations
  • Service-level business logic validation
  • Comprehensive exception handling
  • Meaningful error messages

Frontend Validation

  • Reactive form validation
  • Real-time validation feedback
  • User-friendly error messages
  • Form state management

πŸ“± Responsive Design

The application is fully responsive:

  • Desktop (1200px+): Multi-column layout
  • Tablet (768px-1199px): Adapted grid layouts
  • Mobile (below 768px): Single column, touch-friendly

πŸš€ Performance Optimizations

  • Frontend: Angular AOT compilation, lazy loading, OnPush change detection
  • Backend: Entity Framework Core query optimization, async/await patterns
  • Caching: Browser caching for static assets
  • Static Files: Gzip compression on API responses

πŸ“ Best Practices Implemented

βœ… SOLID Principles

  • Single Responsibility Principle
  • Open/Closed Principle
  • Liskov Substitution Principle
  • Interface Segregation
  • Dependency Inversion

βœ… Code Quality

  • Clean code conventions
  • Meaningful naming
  • DRY (Don't Repeat Yourself)
  • Comprehensive comments and documentation

βœ… Security

  • Input validation
  • CORS configuration
  • Proper HTTP headers
  • Error message sanitization

βœ… Accessibility

  • Semantic HTML
  • ARIA labels
  • Keyboard navigation
  • Color contrast compliance

πŸ”§ Troubleshooting

Common Issues

Frontend can't connect to API:

  • Ensure backend is running on http://localhost:5000
  • Check CORS configuration in Program.cs
  • Verify firewall settings

Dependencies not installing:

  • Clear npm cache: npm cache clean --force
  • Delete node_modules and package-lock.json, reinstall
  • Check Node.js version compatibility

Port already in use:

  • Backend: Change port in launchSettings.json
  • Frontend: Use ng serve --port 4300

πŸ“š Additional Resources

🀝 Contributing

This is a learning project. Suggestions and improvements are welcome!

πŸ“„ License

This project is open source and available for educational purposes.

πŸŽ“ Learning Outcomes

By studying this project, you will learn:

  1. βœ… Full-stack web development with modern technologies
  2. βœ… REST API design and implementation
  3. βœ… Entity Framework Core ORM usage
  4. βœ… Angular component architecture
  5. βœ… TypeScript and reactive programming
  6. βœ… CORS and HTTP communication
  7. βœ… Responsive design and theming
  8. βœ… Docker containerization
  9. βœ… Layered architecture and design patterns
  10. βœ… Best practices in web development

πŸ‘¨β€πŸ’» Author

Created as a comprehensive learning project for full-stack web development.


Happy Coding! πŸš€

For questions or issues, please refer to the troubleshooting section or check the individual README files in Backend and Frontend directories.

About

This project is a full-stack task management application featuring a .NET Core 6 RESTful API and an Angular 16 single-page frontend. It includes Entity Framework Core for data, Swagger for documentation, and an optional ASP.NET Core Razor MVC implementation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors