A complete full-stack Task Management Web Application demonstrating modern web development practices with .NET Core 6 backend and Angular frontend.
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
- β 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
- 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
- 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
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
βββββββββββββββββββββββββββββββββββββββββββ
β 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) β
βββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββ
β App Component (Root) β
β - Theme Management β
β - Layout Control β
ββββββββ¬βββββββββββββββββββββββββββ¬ββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Task Form β β Task List β
β Component β β Component β
ββββββββ¬βββββββββββ ββββββββββ¬βββββββββ
β β
ββββββββββββ¬ββββββββββββββββ
β
ββββββββββΌββββββββββ
β TaskService β
β (RxJS/Observable)β
ββββββββββ¬ββββββββββ
β
ββββββββββΌββββββββββ
β HttpClient β
β (Angular HTTP) β
ββββββββββ¬ββββββββββ
β
ββββββββββΌββββββββββ
β API (localhost: β
β 5000) β
ββββββββββββββββββββ
- .NET Core 6 SDK or later
- Node.js 18 or later
- npm or yarn
- Visual Studio Code (recommended) or Visual Studio
-
Navigate to Backend Directory
cd Backend/TaskManagementAPI -
Restore NuGet Packages
dotnet restore
-
Build the Project
dotnet build
-
Run the Application
dotnet run
The API will start on
http://localhost:5000 -
Access Swagger Documentation Open browser and navigate to:
http://localhost:5000/swagger
-
Navigate to Frontend Directory
cd Frontend -
Install Dependencies
npm install
-
Start Development Server
npm start
The Angular application will open at
http://localhost:4200
- Angular Frontend: http://localhost:4200
- API Swagger Docs: http://localhost:5000/swagger
- MVC Server-Side View: http://localhost:5000
- API Base URL: http://localhost:5000/api/tasks
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 |
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"
}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
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)
Controller Layer
β
Service Layer (Business Logic)
β
Repository Layer (Data Access)
β
Database Context (EF Core)
β
In-Memory Database
App Component (Root)
βββ Task Form Component
β βββ TaskService
βββ Task List Component
βββ TaskService β HTTP Client β API
- Repository Pattern: Abstraction layer for data access
- Service Layer Pattern: Centralized business logic
- Dependency Injection: Loose coupling and testability
- Component-Based Architecture: Reusable, modular UI components
- Observable Pattern: Reactive data flow with RxJS
- DTO Pattern: Data Transfer Objects for API communication
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
}The project includes Docker support for containerized deployment:
# Build images
docker-compose build
# Start both services
docker-compose up
# Stop services
docker-compose downBackend:
docker build -f Backend/Dockerfile -t task-api .
docker run -p 5000:80 task-apiFrontend:
docker build -f Frontend/Dockerfile -t task-ui .
docker run -p 4200:4200 task-ui- Use Postman or Insomnia for API testing
- Unit tests can be added using xUnit or NUnit
- Integration tests for service layer
- Component tests using Jasmine/Karma
- E2E tests using Cypress or Protractor
- Manual testing for UI/UX validation
- Model-level validation using Data Annotations
- Service-level business logic validation
- Comprehensive exception handling
- Meaningful error messages
- Reactive form validation
- Real-time validation feedback
- User-friendly error messages
- Form state management
The application is fully responsive:
- Desktop (1200px+): Multi-column layout
- Tablet (768px-1199px): Adapted grid layouts
- Mobile (below 768px): Single column, touch-friendly
- 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
β 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
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
This is a learning project. Suggestions and improvements are welcome!
This project is open source and available for educational purposes.
By studying this project, you will learn:
- β Full-stack web development with modern technologies
- β REST API design and implementation
- β Entity Framework Core ORM usage
- β Angular component architecture
- β TypeScript and reactive programming
- β CORS and HTTP communication
- β Responsive design and theming
- β Docker containerization
- β Layered architecture and design patterns
- β Best practices in web development
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.