Skip to content
BoogeyCodesPublic

About

Team project & issue tracker API: ASP.NET Core 8, CQRS, EF Core, JWT, real-time board updates over SignalR

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

TaskForge

CI .NET License: MIT

A backend for a team project- and issue-tracker — the kind of board a small team runs its work on. Users sign up, create projects, invite members, organise a Kanban board of columns, and move issues across it with labels, assignees, priorities, due dates and comments. Every change to a board is pushed to connected clients in real time over SignalR.

It's built as a clean ASP.NET Core 8 API with vertical-slice CQRS (MediatR), EF Core over SQLite, JWT authentication, per-project authorization, RFC 7807 error responses, and a full integration test suite that boots the real application.

What it does

  • Accounts & auth — register and log in; passwords hashed with BCrypt; stateless JWT bearer tokens.
  • Projects — each project gets a unique key (e.g. WEB), a default board (To Do / In Progress / Done) and an owner. Issues are numbered per project: WEB-1, WEB-2, …
  • Members & roles — the owner invites users by email as Owner or Member. A project is invisible (404) to non-members; owner-only actions (rename/delete, manage members) are enforced.
  • Board structure — add, rename, reorder and delete columns (with optional WIP limits) and coloured labels.
  • Issues — create, edit, assign, label, prioritise, set due dates, comment, and move between columns with server-side reordering that keeps positions dense.
  • Queries — list issues with filters (column, assignee, label, priority) and pagination.
  • Real-time — a SignalR hub pushes IssueCreated / IssueUpdated / IssueMoved / IssueDeleted events to everyone subscribed to a project's board.

Architecture

src/TaskForge.Api
├── Domain/           entities (User, Project, BoardColumn, Issue, Label, Comment …) and enums
├── Infrastructure/   EF Core DbContext, JWT token service, password hasher, clock, current-user
├── Common/           validation pipeline, RFC 7807 exception handler, paging, project-access guard
├── Features/         one vertical slice per use case — request + validator + handler + DTOs
│   ├── Auth/         Register, Login, Me
│   ├── Projects/     Create, List, Get, Delete
│   ├── Members/      Add, List, Remove
│   ├── Columns/      Create, List, Update, Delete
│   ├── Labels/       Create, List, Delete
│   ├── Issues/       Create, List, Get, Update, Move, Delete
│   └── Comments/     Add, List
├── Endpoints/        minimal-API route maps that dispatch to MediatR
├── Realtime/         SignalR BoardHub + notifier
└── Program.cs        composition root

Request flow: a minimal-API endpoint builds a MediatR request → a ValidationBehavior runs the FluentValidation validators → the handler does the work against AppDbContext → exceptions become RFC 7807 problem responses via a central IExceptionHandler. Authorization lives in one place: an IProjectAccess guard that every project-scoped handler calls to require membership (or ownership).

Design decisions

  • Vertical slices over layered services. Each use case owns its request, validation, handler and DTOs in one file, so a change touches one place. Cross-cutting concerns (validation, errors, access) are the only shared pieces.
  • Authorization as a guard, not an attribute. A project is hidden from non-members, so the check is data (is there a membership row?) rather than a role claim. IProjectAccess centralises it and returns the same 404 whether the project is missing or simply not yours.
  • Per-project issue numbers. Each project keeps a NextIssueNumber, so issues read WEB-12, not a global id — the identifier a human uses.
  • Deterministic ordering in the DB. Columns and issues carry an explicit Order; moves renumber the affected columns so positions stay dense and stable.
  • SQLite + DateTimeOffset. SQLite can't ORDER BY a DateTimeOffset, so a value converter stores all (UTC) timestamps as sortable ticks — ordering and paging stay in SQL.
  • Real-time gated by the same rule. The SignalR hub authenticates with the same JWT and checks membership before letting a connection subscribe to a board.

Running it

dotnet run --project src/TaskForge.Api      # http://localhost:5100
  • Swagger UI: http://localhost:5100/swagger
  • Health: GET /health
  • A SQLite database is created automatically on first run.

Sample requests are in requests.http. Set a real signing key in production via Jwt__Key (environment variable).

Docker

docker build -t taskforge .
docker run --rm -p 8080:8080 -v taskforge-data:/data taskforge   # http://localhost:8080/swagger

Testing

dotnet test

35 integration tests boot the real API with WebApplicationFactory against a throwaway SQLite database and a controllable clock, and drive it over HTTP: registration and login, JWT-protected access, project/member/column/label lifecycles, the full issue lifecycle (numbering, filtering, pagination, assignment rules, moving and reordering), comments, validation (400) and authorization (403/404) paths — plus a SignalR test that connects a hub client with a JWT, subscribes to a board, and asserts it receives the IssueCreated event when an issue is created.

API at a glance

Method & path Purpose
POST /api/auth/register, POST /api/auth/login Get a JWT
GET /api/auth/me Current user
POST/GET /api/projects, GET/DELETE /api/projects/{id} Manage projects
GET/POST /api/projects/{id}/members, DELETE …/members/{userId} Manage members
GET/POST /api/projects/{id}/columns, PUT/DELETE …/columns/{columnId} Manage columns
GET/POST /api/projects/{id}/labels, DELETE …/labels/{labelId} Manage labels
GET/POST /api/projects/{id}/issues List (filter + page) / create issues
GET/PUT/DELETE …/issues/{number}, POST …/issues/{number}/move Manage an issue
GET/POST …/issues/{number}/comments Comments
/hubs/board (SignalR) Subscribe to a project's live board events

Tech

ASP.NET Core 8 · Minimal APIs · MediatR (CQRS) · FluentValidation · EF Core 8 + SQLite · JWT bearer · SignalR · Serilog · Swagger / OpenAPI · xUnit + FluentAssertions · Docker · GitHub Actions.

License

MIT

About

Team project & issue tracker API: ASP.NET Core 8, CQRS, EF Core, JWT, real-time board updates over SignalR

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages