# dreizack97/assistiva architecture

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

- Interactive diagram: https://gitdiagram.com/dreizack97/assistiva
- Repository: https://github.com/dreizack97/assistiva

## Overview

##### Main components
- AppUI – This is the presentation layer built with ASP.NET MVC. It includes controllers, views (with areas like “School”), static assets (wwwroot), configuration files (appsettings.json and launchSettings.json), and project-specific UI styling and scripts.
- BLL (Business Logic Layer) – Contains service implementations and interfaces for managing core business actions such as DisabilitiesService, EmailService, and UserService. It applies business rules and coordinates data handling.
- DAL (Data Access Layer) – Provides the database context (AssistivaContext) and a generic repository implementation to abstract database operations, ensuring data persistence is managed separately.
- Entity – Includes the domain models (Disability, Role, Student, StudentDisability, User) that represent the core data structures of the system.
- IoC (Inversion of Control) – This project handles dependency injection, wiring up relationships between components at runtime.
- External Resources – Within BLL/Resources, there are HTML templates (e.g., ResetPassword, Welcome) that may be used for email or notification operations.
- Database – While not explicitly part of the code, the Assistiva.sql file indicates that a relational database is likely used, which is accessed through DAL.

##### Relationships and interactions
- The AppUI layer communicates with the BLL through service interfaces (for authentication, fetching student or disability data, etc.). Controllers in AppUI call into these BLL services.
- The BLL layer, in turn, uses DAL for data persistence. Various services in BLL (like DisabilityService, StudentService, etc.) obtain or update information using the GenericRepository in DAL.
- The IoC container ensures that dependencies (for example, between controllers and services, or between services and repositories) are resolved at runtime.
- Static resources from AppUI (wwwroot) provide client-side functionality through JavaScript and CSS, enhancing the user experience.
- The Entity project defines the data models used across BLL and DAL – ensuring that data contracts remain consistent throughout the application.

##### Architectural patterns and design principles
- Layered Architecture – The separation into AppUI, BLL, DAL, and Entities is a classic example.
- MVC (Model-View-Controller) – The usage of controllers and views (and areas for organization) in AppUI indicates an MVC design.
- Dependency Injection (DI) – The existence of an IoC project points to the adoption of DI to keep the solution loosely coupled.
- Repository Pattern – DAL’s GenericRepository abstracts data access details from the rest of the system.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Node
    Client("Client Browser"):::client

    %% Presentation Layer
    subgraph "Presentation Layer"
        AppUI("AppUI (ASP.NET MVC)"):::ui
    end

    Client -->|"HTTP_Request"| AppUI

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        BLL("BLL (Business Logic Services)"):::bll
        Resources("External Resources (Email Templates)"):::resources
    end

    AppUI -->|"Service_Call"| BLL
    BLL -->|"Uses"| Resources

    %% Data Access Layer
    subgraph "Data Access Layer"
        DAL("DAL (GenericRepository & DBContext)"):::dal
    end

    BLL -->|"Data_Operation"| DAL

    %% Domain Layer
    subgraph "Domain Layer"
        Entity("Domain Models (Entity)"):::entity
    end

    BLL -->|"Uses_Domain_Models"| Entity

    %% External Database
    Database("Database (Assistiva.sql)"):::database
    DAL -->|"SQL_Query"| Database

    %% IoC Container
    IoC("IoC (Dependency Injection)"):::ioc
    IoC ---|"Injects"| AppUI
    IoC ---|"Injects"| BLL
    IoC ---|"Injects"| DAL

    %% Click Events
    click AppUI "https://github.com/dreizack97/assistiva/tree/main/AppUI/"
    click BLL "https://github.com/dreizack97/assistiva/tree/main/BLL/"
    click DAL "https://github.com/dreizack97/assistiva/tree/main/DAL/"
    click Entity "https://github.com/dreizack97/assistiva/tree/main/Entity/"
    click IoC "https://github.com/dreizack97/assistiva/tree/main/IoC/"
    click Resources "https://github.com/dreizack97/assistiva/tree/main/BLL/Resources/"
    click Database "https://github.com/dreizack97/assistiva/blob/main/Assistiva.sql"

    %% Styles
    classDef client fill:#FFDEAD,stroke:#333,stroke-width:2px;
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef bll fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef dal fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef entity fill:#DDA0DD,stroke:#333,stroke-width:2px;
    classDef ioc fill:#FFA500,stroke:#333,stroke-width:2px;
    classDef resources fill:#D3D3D3,stroke:#333,stroke-width:2px;
    classDef database fill:#FF6347,stroke:#333,stroke-width:2px;
```
