Skip to content

lmvittori/TaskManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Manager - .NET Technical Interview Exercise

A full-stack task management application built with ASP.NET Core 8 Web API, Angular 17, and PostgreSQL, following Clean Architecture principles.

Live Demo

User Story

As a team member, I want to manage my tasks through a web application, So that I can create, view, update, and delete tasks while having my account secured with authentication.

Acceptance Criteria

  • Users can register and log in with username/password
  • Authenticated users can create tasks with a title, description, status, and due date
  • Users can view all tasks (public) or filter to see only their own tasks
  • Users can edit and delete their tasks
  • Task status can be set to Pending, InProgress, or Completed
  • The "All Tasks" view displays the owner of each task
  • Unauthenticated users are redirected to the login page
  • All operations are available through a responsive web interface

Architecture

This project follows Clean Architecture principles with clear separation of concerns:

TaskManager/
├── src/
│   ├── TaskManager.Domain/           # Entities, Interfaces, Exceptions (innermost)
│   ├── TaskManager.Application/      # Services, DTOs, Validation, Mapping
│   ├── TaskManager.Infrastructure/   # PostgreSQL + ADO.NET, JWT Auth, BCrypt
│   ├── TaskManager.WebAPI/           # ASP.NET Core 8 Controllers, Middleware
│   └── TaskManager.Angular/          # Angular 17 Frontend
├── tests/
│   ├── TaskManager.Domain.Tests/     # 25 tests
│   ├── TaskManager.Application.Tests/ # 88 tests
│   └── TaskManager.WebAPI.Tests/     # 33 tests
├── Dockerfile
├── PROCESS.md                        # Development thought process
└── TaskManager.sln

Dependency Flow: WebAPI -> Application -> Domain <- Infrastructure

Key Design Decisions

  • No Entity Framework / Dapper / Mediator: Raw ADO.NET with Npgsql for data access, demonstrating manual SQL and parameter handling
  • PostgreSQL (Neon): Serverless PostgreSQL for production; auto-scaling and zero infrastructure management
  • JWT Authentication: Stateless token-based auth with BCrypt password hashing
  • Clean Architecture: Domain has zero dependencies; Application depends only on Domain; Infrastructure implements Domain interfaces
  • Custom Migration Runner: SQL migration files embedded as assembly resources, tracked in __MigrationHistory, executed in transactions on startup
  • Standalone Components: Angular 17 standalone components (no NgModule)

Prerequisites

Getting Started

Backend

# From the root directory
dotnet restore
dotnet build

# Run the API (database migrations run automatically)
dotnet run --project src/TaskManager.WebAPI

The API will be available at:

Frontend

cd src/TaskManager.Angular

npm install
ng serve

The app will be available at http://localhost:4200

Running Tests

# Run all 146 tests
dotnet test

# Run with verbose output
dotnet test --verbosity normal

# Run specific test project
dotnet test tests/TaskManager.Domain.Tests
dotnet test tests/TaskManager.Application.Tests
dotnet test tests/TaskManager.WebAPI.Tests

Configuration

Backend configuration is in src/TaskManager.WebAPI/appsettings.json:

{
  "ConnectionStrings": {
    "DefaultConnection": "Host=...;Database=...;Username=...;Password=...;SSL Mode=Require"
  },
  "JwtSettings": {
    "SecretKey": "YourSuperSecretKeyThatIsAtLeast32CharactersLong!2024",
    "Issuer": "TaskManagerAPI",
    "Audience": "TaskManagerApp",
    "ExpirationMinutes": 60
  }
}

Seeded Data / Demo Credentials

The application seeds the following data on first run:

Demo User:

Sample Tasks:

  1. "Complete project documentation" - Pending
  2. "Setup continuous integration" - InProgress
  3. "Review code quality" - Pending

API Endpoints

Tasks API (/api/tasks)

Method Endpoint Auth Description
GET /api/tasks No Get all tasks (with owner username)
GET /api/tasks/{id} Yes Get task by ID
GET /api/tasks/my Yes Get current user's tasks
POST /api/tasks Yes Create a new task
PUT /api/tasks/{id} Yes Update a task
DELETE /api/tasks/{id} Yes Delete a task

Auth API (/api/auth)

Method Endpoint Auth Description
POST /api/auth/register No Register a new user
POST /api/auth/login No Login and get JWT token
GET /api/auth/me Yes Get current user info

Technology Stack

Backend:

  • .NET 8 / ASP.NET Core 8 Web API
  • PostgreSQL with raw ADO.NET (Npgsql)
  • JWT Bearer Authentication
  • BCrypt.Net for password hashing
  • Global exception handling middleware
  • Custom SQL migration runner

Frontend:

  • Angular 17 (standalone components)
  • Bootstrap 5 (responsive: table on desktop, cards on mobile)
  • RxJS
  • TypeScript
  • Auth interceptor + route guards

Testing (146 tests):

  • xUnit
  • Moq
  • FluentAssertions

Deployment:

  • Backend: Railway (Docker)
  • Frontend: Vercel
  • Database: Neon (serverless PostgreSQL)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages