# califio/code-secure-dashboard architecture

> Architecture diagram of the GitHub repository califio/code-secure-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/califio/code-secure-dashboard
- Repository: https://github.com/califio/code-secure-dashboard

## Overview

##### Main Components
- Frontend Client: The code‑secure‑ui directory uses Angular along with typical SPA files (angular.json, TypeScript source files, HTML templates, SCSS styles, etc.). This component is responsible for the user interface, dashboards, forms for authentication, project settings, and visualizing findings and reports.
- Backend API Server: The code‑secure‑api directory (a .NET project written in C#) includes controllers, application services, domain modules (Finding, Project, User, Integration, etc.), migrations, and data-contexts. It acts as the RESTful API provider for the frontend.
- Database/Data Layer: Although not visible as a separate database server file, the presence of EF Core Migrations and an AppDbContext indicates a relational database is used.
- External Integrations: The “Integration” modules (Jira, Mail, Teams) demonstrate how external systems (ticket trackers, email services, chat platforms) are incorporated. Also, CI-related modules within both API and UI support pipeline-triggered actions.

##### Lay Out the Relationships and Data Flows
- The Frontend communicates with the Backend API, sending requests (authentication, project management, vulnerability reporting, etc.) via HTTP calls.
- The API is organized into multiple domain-specific controllers (e.g., Auth, CI, Finding, Dashboard, Integration) and interacts with the database through the Application/Data layers.

##### Architectural Patterns and Design Principles
- Modularity & Separation of Concerns: Notice the use of clear folders/modules for Authentication, Finding management, Integration, etc. Represent these modules as separate sub‑components inside the Backend API.
- Clean API Boundaries: The controllers in the “Api” folder expose distinct endpoints and the API uses middleware (ExceptionHandler, Model Validators) to manage cross‑cutting concerns (authentication, error handling).
- Use of Entity Framework for data persistence and robust service modules (e.g., Scheduler jobs for weekly alerts) indicates layered architecture.
- Frontend is built as a single-page application (SPA) using Angular, complete with routing, services, and shared components.

##### And Label Technologies and Frameworks
- Frontend: Angular, TypeScript.
- Backend: .NET (ASP.NET Core) with C#, Entity Framework Core.
- CI/CD: GitHub workflows, Docker for containerization.
- External Services/Integrations: Jira, Mail servers (SMTP), Microsoft Teams.
- Database: Likely a SQL database (inferred by EF Core migrations).

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Frontend Layer"
        FE["Frontend (Angular SPA)"]:::frontend
    end

    subgraph "Backend API (ASP.NET Core)"
        Auth["Authentication Module"]:::backend
        Finding["Finding Management Module"]:::backend
        Project["Project Module"]:::backend
        CI["CI & Integration Module"]:::backend
        Reporting["Reporting Module"]:::backend
        IntegrationCtrl["Integration Controller"]:::backend
        IntegrationMod["Integration Modules"]:::backend
    end

    subgraph "Data Layer"
        DB(("Database (SQL)")):::database
    end

    subgraph "CI/CD Pipeline"
        CI_CD["CI/CD Pipeline"]:::ci
    end

    subgraph "External Services"
        EX_Jira["Jira"]:::external
        EX_Mail["Mail Server"]:::external
        EX_Teams["Microsoft Teams"]:::external
    end

    %% Connections between Frontend and Backend modules
    FE -->|"API_Calls"| Auth
    FE -->|"API_Calls"| Finding

    %% Backend modules communicating with the Database
    Auth -->|"StoresData"| DB
    Finding -->|"StoresData"| DB
    Project -->|"StoresData"| DB
    CI -->|"StoresData"| DB

    %% CI/CD Pipeline deployments
    CI_CD -->|"Deploys"| FE
    CI_CD -->|"Deploys"| Auth

    %% Backend Integration structure
    CI -->|"Integrates"| IntegrationCtrl
    CI -->|"Integrates"| IntegrationMod

    %% External integrations for alerts and issues
    IntegrationCtrl -->|"Issues"| EX_Jira
    IntegrationCtrl -->|"Alerts"| EX_Mail
    IntegrationCtrl -->|"Messages"| EX_Teams

    %% Click Events
    click FE "https://github.com/califio/code-secure-dashboard/tree/main/code-secure-ui"
    click Auth "https://github.com/califio/code-secure-dashboard/blob/main/code-secure-api/code-secure-api/Api/Auth/AuthController.cs"
    click Finding "https://github.com/califio/code-secure-dashboard/blob/main/code-secure-api/code-secure-api/Api/Finding/FindingController.cs"
    click IntegrationCtrl "https://github.com/califio/code-secure-dashboard/tree/main/code-secure-api/code-secure-api/Api/Integration"
    click IntegrationMod "https://github.com/califio/code-secure-dashboard/tree/main/code-secure-api/code-secure-api/Application/Module/Integration"
    click DB "https://github.com/califio/code-secure-dashboard/blob/main/code-secure-api/code-secure-api/Application/AppDbContext.cs"
    click CI_CD "https://github.com/califio/code-secure-dashboard/tree/main/.github/workflows"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef database fill:#FFD700,stroke:#333,stroke-width:2px,stroke-dasharray: 5,5;
    classDef external fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef ci fill:#FFA500,stroke:#333,stroke-width:2px;
```
