# samnickgammer/institute-of-abc architecture

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

- Interactive diagram: https://gitdiagram.com/samnickgammer/institute-of-abc
- Repository: https://github.com/samnickgammer/institute-of-abc

## Overview

##### Main Components

A. Client Layer
- Web Interface (Public Frontend)
- Admin Dashboard Interface
- API Consumers

B. Application Layer
- Web Controllers
- Public Controllers (Home, About, Course, Gallery, StudentInfo)
- Admin Controllers (Dashboard, Login)
- API Controllers
- Admin Branch Controller
- Admin Login Controller

C. Middleware Layer
- Admin Authentication Middleware

D. Service Layer
- Utils (EncryptionAndCompare, GenerateRandomStuff)

E. Data Layer
- Models (User and other implied models from migrations)
- Database Tables
- Users
- Branch
- Course
- Student
- Certificate Charge

F. Storage Layer
- Public Assets
- Student Photos
- Private Storage

**[Client Layer]**
- ↓
**[Web/API Gateway]**
- ↓
**[Middleware Layer]**
- ↓
**[Application Layer]**
- ↓
**[Service Layer]**
- ↓
**[Data Layer]**
- ↓
**[Storage Layer]**

##### Specific Implementation Details

a. Clear separation between:
- Public web routes (/home, /about, /course, etc.)
- Admin routes (/admin/*)
- API routes (/api/*)

b. MVC pattern:
- Controllers in app/Http/Controllers
- Views in resources/views
- Models in app/Models

- Client requests → Controllers
- Controllers → Models
- Models → Database
- Controllers → Views
- Views → Client responses

##### Important Architectural Elements

- Laravel's routing system (routes/web.php and routes/api.php)
- Authentication system for admin access
- Asset management (public/assets)
- File storage system (storage/app)
- Database migrations and structure
- Blade templating system (resources/views)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Layer
    subgraph CL[Client Layer]
        WI[Web Interface]:::frontend
        ADI[Admin Dashboard]:::frontend
        API[API Consumers]:::api
    end

    %% Web/API Gateway Layer
    subgraph GL[Gateway Layer]
        WR["Web Routes"]:::route
        AR["API Routes"]:::api
    end

    %% Middleware Layer
    subgraph ML[Middleware Layer]
        AAM[Admin Auth Middleware]:::middleware
    end

    %% Application Layer
    subgraph AL[Application Layer]
        subgraph Controllers
            PWC[Public Web Controllers]:::controller
            AWC[Admin Web Controllers]:::controller
            APC[API Controllers]:::controller
        end
    end

    %% Service Layer
    subgraph SL[Service Layer]
        ES[Encryption Service]:::service
        RGS[Random Generator Service]:::service
    end

    %% Data Layer
    subgraph DL[Data Layer]
        Models[(Data Models)]:::data
        subgraph Tables
            UT[(Users)]:::data
            BT[(Branch)]:::data
            CT[(Course)]:::data
            ST[(Student)]:::data
            CCT[(Certificate Charge)]:::data
        end
    end

    %% Storage Layer
    subgraph STL[Storage Layer]
        PA[Public Assets]:::storage
        SP[Student Photos]:::storage
        PS[Private Storage]:::storage
    end

    %% View Components Layer
    subgraph VL[View Layer]
        PVC[Public View Components]:::view
        AVC[Admin View Components]:::view
        PLT[Public Layout Templates]:::view
        ALT[Admin Layout Templates]:::view
    end

    %% Relationships
    WI --> WR
    ADI --> WR
    API --> AR
    
    WR --> AAM
    AR --> AAM
    
    AAM --> PWC
    AAM --> AWC
    AAM --> APC
    
    PWC --> ES
    AWC --> ES
    APC --> ES
    
    PWC --> RGS
    AWC --> RGS
    APC --> RGS
    
    ES --> Models
    RGS --> Models
    
    Models --> UT
    Models --> BT
    Models --> CT
    Models --> ST
    Models --> CCT
    
    PWC --> PVC
    AWC --> AVC
    PVC --> PLT
    AVC --> ALT
    
    PWC --> PA
    AWC --> PA
    PWC --> SP
    AWC --> PS

    %% Styles
    classDef frontend fill:#2196F3,color:white
    classDef api fill:#FF9800,color:white
    classDef route fill:#4CAF50,color:white
    classDef middleware fill:#FFEB3B,color:black
    classDef controller fill:#8BC34A,color:white
    classDef service fill:#FF5722,color:white
    classDef data fill:#9C27B0,color:white
    classDef storage fill:#795548,color:white
    classDef view fill:#00BCD4,color:white

    %% Click Events
    click WI "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/resources/views/pages"
    click ADI "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/resources/views/admin"
    click AR "https://github.com/SamNickGammer/Institute-of-ABC/blob/master/routes/api.php"
    click PWC "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/app/Http/Controllers/web"
    click AWC "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/app/Http/Controllers/web/admin"
    click APC "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/app/Http/Controllers/api"
    click AAM "https://github.com/SamNickGammer/Institute-of-ABC/blob/master/app/Http/Middleware/AdminAuthMiddleware.php"
    click ES "https://github.com/SamNickGammer/Institute-of-ABC/blob/master/app/Utils/EncryptionAndCompare.php"
    click RGS "https://github.com/SamNickGammer/Institute-of-ABC/blob/master/app/Utils/GenerateRandomStuff.php"
    click Models "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/app/Models"
    click Tables "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/database/migrations"
    click PA "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/public/assets"
    click SP "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/public/student_photo"
    click PS "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/storage/app/private"
    click PVC "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/resources/views/components"
    click AVC "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/resources/views/admin/components"
    click PLT "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/resources/views/layout"
    click ALT "https://github.com/SamNickGammer/Institute-of-ABC/tree/master/resources/views/admin/layout"
```
