Skip to content

Repository files navigation

⚑ DevFlow Backend API

DevFlow Backend Logo

Enterprise-Grade Developer Workflow Management & Collaboration Platform

An enterprise-grade, high-performance backend platform built with ASP.NET Core (.NET 9) adhering strictly to Clean Architecture, CQRS with MediatR, and Domain-Driven Design (DDD) principles.

Explore Architecture Β» Β· Features Overview Β· Quick Start Guide Β· API Reference (`details.md`)

.NET 9 C# EF Core 9 SignalR 348 Unit Tests License


⚠️ Project Status: Active Development

Authentication, Workspace Management, Project Management, Project Membership, Task Management, Real-Time Notifications (SignalR), the Workflow Automation Engine, and a Comprehensive Unit Testing Suite (348 Passing Tests) are fully implemented and verified.

The current development focus is Integration Testing and Analytics & Reporting, followed by expanded collaboration features.


πŸ“‹ Table of Contents


πŸš€ Overview & Vision

DevFlow is designed as a modern, high-performance developer workflow and project management platform inspired by tools like Jira, Trello, and Linear. It provides software development teams with an extensible ecosystem to manage multi-tenant workspaces, Kanban task boards, domain event notifications, and automated business workflows.

Project Roadmap Status

Completed βœ…

  • Authentication & Security: JWT Access Tokens, Refresh Token rotation & revocation, password hashing.
  • Workspace Management: Multi-tenancy, owner/admin authorization enforcement, member invitations.
  • Project & Membership Management: Workspace-scoped projects and role-based project access.
  • Task Management: Kanban status lifecycle (Todo, InProgress, Completed), priority tracking, assignee updates, domain events.
  • Real-Time Notifications: Persistent DB storage + SignalR WebSocket broadcasts (/notificationHub).
  • Workflow Engine: Extensible Strategy Pattern engine intercepting MediatR domain events for rule evaluation and action execution.
  • Unit Testing Suite: 348/348 Unit Tests Passed.

Planned 🚧

  • Integration & End-to-End Testing pipeline.
  • Analytics & Reporting Dashboard endpoints.
  • Activity Tracking & Audit Logs.
  • Webhook Action Executors & External Integrations.

✨ Key Features

Authentication & Security

  • User Registration & JWT Login: Secure authentication issuing short-lived JWT tokens and long-lived refresh tokens.
  • Sliding Expiration: Automated token refresh mechanism.
  • Role-Based Authorization: Hierarchical roles (Admin, Manager, Member).
  • Middleware Pipeline: Global exception handling middleware converting exceptions to standard JSON envelopes (ApiResponse<T>).

Workspace Management

  • Workspace creation, updating, and soft/hard deletion.
  • Role management (Owner, Admin, Member).
  • Paginated queries (GetMyWorkspaces, GetWorkspaceMembers) supporting search and sorting.

Project & Task Management

  • Workspace-scoped projects with project-level membership control (AddProjectMember, RemoveProjectMember).
  • Task management with status lifecycle (Todo, InProgress, Completed) and priority levels (Low, Medium, High).
  • Domain Event Triggers (TaskAssignedEvent, TaskCompletedEvent, ProjectCreatedEvent).

Workflow Automation Engine

Configurable, event-driven business automation without altering core application code.

  • Triggers: Domain event listeners (TaskAssignedEvent, TaskCompletedEvent, ProjectCreatedEvent).
  • Condition Evaluator: Strategy-based operators (Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, Contains).
  • Action Executors: Strategy-based action dispatchers (NotifyUser).

Real-Time Notifications

  • In-App Notification persistence in SQL Server.
  • SignalR WebSocket hub (/notificationHub) delivering real-time notification models to connected clients.
  • Unread counter and bulk mark-as-read options.

πŸ—οΈ Architecture & Design Patterns

DevFlow strictly isolates domain rules from infrastructure, database, and UI concerns through Clean Architecture principles.

High-Level System Diagram

graph TD
    Client[Client / Web UI / React Frontend]
    API[DevFlow.Api Web API]
    Application[DevFlow.Application CQRS]
    Domain[DevFlow.Domain Entities & Events]
    Infrastructure[DevFlow.Infrastructure EF Core & SignalR]
    SQL[(SQL Server Database)]
    SignalR[(SignalR WebSocket Hub)]
    WorkflowEngine[Workflow Automation Engine]
    Notifications[Notification System]

    Client --> API
    API --> Application
    Application --> Domain
    Application --> Infrastructure
    Infrastructure --> SQL
    Infrastructure --> SignalR
    Domain -->|Domain Events| WorkflowEngine
    WorkflowEngine --> Notifications
    Notifications --> SignalR
Loading

CQRS Request Pipeline

sequenceDiagram
    participant Client
    participant Controller
    participant MediatR
    participant PipelineBehaviors
    participant Handler
    participant Domain
    participant Repository
    participant SignalR

    Client->>Controller: HTTP Request (POST /PUT /GET)
    Controller->>MediatR: Send Command / Query
    MediatR->>PipelineBehaviors: ValidationBehavior & LoggingBehavior
    PipelineBehaviors->>Handler: Execute Handler
    Handler->>Domain: Mutate Entity & Raise Domain Event
    Handler->>Repository: Save Changes (UnitOfWork)
    Domain-->>SignalR: Dispatch Real-time Notification
    Handler-->>Client: Return ApiResponse<T>
Loading

Solution Directory Structure

DevFlow (Solution)
β”‚
β”œβ”€β”€ DevFlow                      # ASP.NET Core API Project
β”‚   β”œβ”€β”€ Controllers/             # REST API Controllers (Auth, Workspace, Project, Task, Workflow, Notification)
β”‚   β”œβ”€β”€ Middleware/              # ExceptionMiddleware (Global exception handling)
β”‚   β”œβ”€β”€ Program.cs               # Service Registration, Middleware Pipeline & SignalR Mapping
β”‚   └── appsettings.json         # Configuration & DB connection strings
β”‚
β”œβ”€β”€ DevFlow.Application          # Application Layer (CQRS Commands & Queries)
β”‚   β”œβ”€β”€ Abstractions/            # Interfaces for Repositories & Services
β”‚   β”œβ”€β”€ Common/                  # Pipeline Behaviors (Validation, Logging), Models (ApiResponse, PagedResult)
β”‚   β”œβ”€β”€ DomainEvents/            # Domain Event Handlers (TaskAssigned, TaskCompleted, ProjectCreated)
β”‚   β”œβ”€β”€ Exceptions/              # Custom Exception Definitions
β”‚   β”œβ”€β”€ Notifications/           # Notification Handlers & Commands
β”‚   β”œβ”€β”€ ProjectMembers/          # Project Member Management Handlers
β”‚   β”œβ”€β”€ Projects/                # Project Handlers & Commands
β”‚   β”œβ”€β”€ Tasks/                   # Task Handlers & Commands
β”‚   β”œβ”€β”€ Users/                   # Auth, Login & Register Handlers
β”‚   β”œβ”€β”€ WorkflowAutomation/      # Workflow Engine, Condition Evaluators & Action Executors
β”‚   β”œβ”€β”€ Workflows/               # Workflow CRUD Handlers
β”‚   └── Workspaces/              # Workspace Handlers & Commands
β”‚
β”œβ”€β”€ DevFlow.Domain               # Pure Domain Layer (Entities, Value Objects, Enums, Domain Events)
β”‚   β”œβ”€β”€ Entities/                # User, Workspace, Project, TaskItem, Notification, Workflow, RefreshToken
β”‚   β”œβ”€β”€ Enum/                    # UserRole, WorkspaceRole, ProjectRole, TaskPriority, TaskStatus, etc.
β”‚   └── Events/                  # IDomainEvent implementations
β”‚
β”œβ”€β”€ DevFlow.Infrastructure       # Infrastructure & Persistence Layer
β”‚   β”œβ”€β”€ Persistence/             # DevFlowDbContext & EF Core Entity Configurations
β”‚   β”œβ”€β”€ Repositories/            # EF Core Repository Implementations & UnitOfWork
β”‚   β”œβ”€β”€ Security/                # JwtTokenGenerator, PasswordHasher
β”‚   β”œβ”€β”€ Services/                # Authorization Services, DomainEventDispatcher
β”‚   └── Hubs/                    # SignalR NotificationHub
β”‚
└── DevFlow.UnitTests            # Comprehensive xUnit Testing Suite (348 Unit Tests)
    β”œβ”€β”€ Application/             # Handler, Validator & Strategy Tests
    β”œβ”€β”€ Common/                  # Pipeline Behavior Tests
    └── Domain/                  # Entity & Domain Event Tests

πŸš€ Getting Started

Prerequisites

  • .NET 9 SDK: Make sure .NET 9 SDK is installed (dotnet --version)
  • SQL Server / LocalDB: SQL Server 2019+ or LocalDB
  • Visual Studio 2022 / VS Code / Rider

Configuration

Open appsettings.json in DevFlow/appsettings.json and configure your local SQL Server connection string and JWT settings:

{
  "ConnectionStrings": {
    "DevFlowDb": "Server=(localdb)\\mssqllocaldb;Database=DevFlowDb;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True"
  },
  "Jwt": {
    "Key": "YOUR_SUPER_SECRET_STRONG_KEY_32_CHARS_LONG",
    "Issuer": "DevFlowApi",
    "Audience": "DevFlowClient",
    "ExpiryMinutes": 60
  }
}

Database Setup & Migrations

Run EF Core database updates to apply all pending schema migrations:

cd DevFlow
dotnet ef database update --project ../DevFlow.Infrastructure

Running the API

Start the backend API server:

cd DevFlow
dotnet run

The API will start listening at:

  • HTTP: http://localhost:5000
  • HTTPS: https://localhost:7001
  • Swagger / OpenAPI: http://localhost:5000/openapi/v1.json

πŸ§ͺ Running Unit Tests

DevFlow comes with a comprehensive unit test suite covering Domain Entities, CQRS Handlers, FluentValidation rules, and Strategy Evaluators.

To execute all 348 Unit Tests:

dotnet test

Expected Output:

Passed!  - Failed: 0, Passed: 348, Skipped: 0, Total: 348

πŸ”Œ Frontend Integration Reference

For detailed API endpoint documentation, HTTP request/response payloads, frontend Axios setup, and SignalR WebSocket integration guides, refer to the DevFlow Integration Reference (details.md).


πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.

About

DevFlow is a workflow and project management platform that enables teams to collaborate through shared workspaces, manage projects, track tasks, assign responsibilities, receive notifications, and maintain activity history in a centralized environment.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages