# aungsett/git_2026internship_team_c architecture

> Architecture diagram of the GitHub repository aungsett/git_2026internship_team_c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aungsett/git_2026internship_team_c
- Repository: https://github.com/aungsett/git_2026internship_team_c

## Overview

##### What this project is (type + purpose) inferred from the repo
Even though the root `README.md` is empty besides “Team C”, the file tree is very indicative:

- **Full-stack web application** with:
- **Backend**: Python web service in `backend/app` with `extensions.py`, `config.py`, `run.py`, `seed.py`, and **Alembic migrations** under `backend/migrations`. This strongly suggests **Flask + SQLAlchemy (+ Flask-Migrate/Alembic)** style architecture.
- **Frontend**: **Next.js (App Router)** in `frontend/app` with `layout.tsx`, `page.tsx`, Tailwind (`tailwind.config.ts`, `globals.css`) and Next config.

- **Domain model** (from `backend/app/models/`):
- `admin.py`, `applicant.py`, `document.py`, `review.py`
- That reads like an **application intake + document submission + review workflow** system (admin reviews applicants and documents, creates reviews, etc.).

##### Backend (Python service)
Key items to map:
- `backend/run.py`: **entrypoint** (HTTP server start)
- `backend/app/__init__.py`: **Flask app factory / initialization** (where routes/blueprints likely get registered even if not shown here)
- `backend/app/extensions.py`: **shared infrastructure wiring**, typically:
- SQLAlchemy instance
- Migration tool
- Possibly CORS, login/auth, etc.
- `backend/app/models/*`: **data layer / ORM models**
- `backend/migrations/*`: **schema management** (Alembic)
- `backend/seed.py`: **data seeding / bootstrap**
- `backend/config.py`: **configuration** (env-based settings: DB URL, secrets, debug)
- `backend/requirements.txt`: **runtime dependencies**

##### Frontend (Next.js)
Key items to map:
- `frontend/app/layout.tsx`: top-level layout (shell)
- `frontend/app/page.tsx`: initial route/page
- `frontend/app/globals.css` + Tailwind config: styling pipeline
- `frontend/package.json`: build scripts + dependencies

##### Frontend Container: Next.js
- Node.js runtime
- Renders UI, hosts routes from `frontend/app/*`
- Uses Tailwind build pipeline
##### Backend Container: Flask API
- Python runtime
- App initialization (`app/__init__.py`)
- Infrastructure (`extensions.py`)
- ORM models (`models/*.py`)
- Config (`config.py`)
##### Database Container: Relational DB
- Schema managed by Alembic migrations (`migrations/*`)
- Seed data via `seed.py`

**Connections** (label with protocol + payload):
- Browser → Next.js: HTTP(S) (HTML/CSS/JS)
- Next.js → Flask API: HTTP(S) JSON (REST-like)
- Flask API → DB: SQL via SQLAlchemy

- Dev/CI → Alembic migrations → DB (schema updates)
- Dev/CI → `seed.py` → DB (initial data)

- **App Initialization**
- `app/__init__.py`
- **Extensions / Infrastructure**
- `app/extensions.py` (SQLAlchemy, migration binding, etc.)
- **Domain Model (ORM)**
- `models/admin.py`
- `models/applicant.py`
- `models/document.py`
- `models/review.py`
- **Schema Management**
- `migrations/` (Alembic)
- **Bootstrap**
- `seed.py`

##### Architectural patterns that are evident from the repo

- **Separation of concerns by repo structure**:
- `frontend/` and `backend/` are independent build/deploy units
- **ORM-driven persistence**:
- `models/` + Alembic migrations indicates a relational DB with versioned schema
- **“Extensions” pattern** in Flask:
- central place (`extensions.py`) for DB/migrations integration
- **Config-by-environment**:
- `config.py` implies environment-specific settings; show “Environment variables / Config” feeding backend (and optionally frontend)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% =========================
    %% Actors / Clients
    %% =========================
    subgraph "Actors"
        Applicant["Applicant"]:::actor
        AdminUser["Admin / Reviewer"]:::actor
    end

    Browser["Web Browser"]:::client

    Applicant -->|"uses"| Browser
    AdminUser -->|"uses"| Browser

    %% =========================
    %% Frontend Container (Next.js)
    %% =========================
    subgraph "Frontend Container (Next.js on Node.js)"
        NextApp["Next.js Web App"]:::frontend

        subgraph "UI (App Router)"
            AppRouter["App Router"]:::frontend
            Layout["Root Layout"]:::frontend
            Page["Initial Page"]:::frontend
        end

        subgraph "Styling Pipeline"
            GlobalsCSS["Global Styles"]:::frontend
            Tailwind["Tailwind Config"]:::frontend
            PostCSS["PostCSS Config"]:::frontend
        end

        NextConfig["Next.js Config"]:::frontend
        FEPackage["package.json (scripts/deps)"]:::frontend

        NextApp -->|"renders"| AppRouter
        AppRouter -->|"includes"| Layout
        AppRouter -->|"routes_to"| Page
        NextApp -->|"uses"| NextConfig
        NextApp -->|"builds_with"| FEPackage
        NextApp -->|"styles"| GlobalsCSS
        GlobalsCSS -->|"tailwind"| Tailwind
        Tailwind -->|"postcss"| PostCSS
    end

    %% =========================
    %% Backend Container (Flask)
    %% =========================
    subgraph "Backend Container (Flask API on Python)"
        RunPy["HTTP Service Entrypoint"]:::backend
        AppInit["Flask App Initialization / Factory"]:::backend
        Extensions["Extensions / Infrastructure Wiring"]:::backend
        Config["Config (env-based settings)"]:::config
        Requirements["requirements.txt (deps)"]:::backend

        subgraph "Domain Model (SQLAlchemy ORM)"
            ModelsDir["Models Module"]:::backend
            AdminModel["Admin Model"]:::backend
            ApplicantModel["Applicant Model"]:::backend
            DocumentModel["Document Model"]:::backend
            ReviewModel["Review Model"]:::backend
        end

        RunPy -->|"starts"| AppInit
        AppInit -->|"loads"| Config
        AppInit -->|"wires"| Extensions
        Extensions -->|"registers"| ModelsDir
        ModelsDir -->|"contains"| AdminModel
        ModelsDir -->|"contains"| ApplicantModel
        ModelsDir -->|"contains"| DocumentModel
        ModelsDir -->|"contains"| ReviewModel
        AppInit -->|"depends_on"| Requirements
    end

    %% =========================
    %% Data Store
    %% =========================
    DB[("Relational Database\n(PostgreSQL/MySQL/SQLite via SQLAlchemy)")]:::database

    %% =========================
    %% Operational Tooling
    %% =========================
    subgraph "Operational / Lifecycle"
        DevCI["Dev / CI"]:::ops

        subgraph "Alembic Migrations"
            MigrationsDir["Migrations Directory"]:::ops
            AlembicEnv["Alembic env.py"]:::ops
            AlembicIni["alembic.ini"]:::ops
            InitialMigration["Initial Schema Migration"]:::ops
        end

        Seeder["Seed Script"]:::ops

        DevCI -->|"runs"| MigrationsDir
        MigrationsDir -->|"configures"| AlembicIni
        MigrationsDir -->|"executes"| AlembicEnv
        MigrationsDir -->|"applies"| InitialMigration

        DevCI -->|"runs"| Seeder
    end

    %% =========================
    %% Runtime Data Flows
    %% =========================
    Browser -->|"HTTP(S)\nHTML/CSS/JS"| NextApp
    NextApp -->|"HTTP(S)\nJSON (REST-like)"| AppInit
    AppInit -->|"SQL via SQLAlchemy"| DB

    %% Domain CRUD emphasis (grounded in model names)
    NextApp -->|"CRUD Applicants/Documents/Reviews"| AppInit

    %% =========================
    %% Operational Flows (dashed)
    %% =========================
    MigrationsDir -.->|"schema_updates"| DB
    Seeder -.->|"seed_data"| DB

    %% =========================
    %% Click Events (from component mapping)
    %% =========================
    click RunPy "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/run.py"
    click AppInit "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/app/__init__.py"
    click Extensions "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/app/extensions.py"
    click Config "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/config.py"
    click ModelsDir "https://github.com/aungsett/git_2026internship_team_c/tree/main/backend/app/models/"
    click AdminModel "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/app/models/admin.py"
    click ApplicantModel "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/app/models/applicant.py"
    click DocumentModel "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/app/models/document.py"
    click ReviewModel "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/app/models/review.py"
    click MigrationsDir "https://github.com/aungsett/git_2026internship_team_c/tree/main/backend/migrations/"
    click AlembicEnv "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/migrations/env.py"
    click AlembicIni "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/migrations/alembic.ini"
    click InitialMigration "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/migrations/versions/12e3698403da_initial_schema.py"
    click Seeder "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/seed.py"
    click Requirements "https://github.com/aungsett/git_2026internship_team_c/blob/main/backend/requirements.txt"
    click AppRouter "https://github.com/aungsett/git_2026internship_team_c/tree/main/frontend/app/"
    click Layout "https://github.com/aungsett/git_2026internship_team_c/blob/main/frontend/app/layout.tsx"
    click Page "https://github.com/aungsett/git_2026internship_team_c/blob/main/frontend/app/page.tsx"
    click GlobalsCSS "https://github.com/aungsett/git_2026internship_team_c/blob/main/frontend/app/globals.css"
    click Tailwind "https://github.com/aungsett/git_2026internship_team_c/blob/main/frontend/tailwind.config.ts"
    click PostCSS "https://github.com/aungsett/git_2026internship_team_c/blob/main/frontend/postcss.config.mjs"
    click NextConfig "https://github.com/aungsett/git_2026internship_team_c/blob/main/frontend/next.config.mjs"
    click FEPackage "https://github.com/aungsett/git_2026internship_team_c/blob/main/frontend/package.json"

    %% =========================
    %% Styles
    %% =========================
    classDef actor fill:#FDE68A,stroke:#92400E,stroke-width:2px,color:#111827
    classDef client fill:#E5E7EB,stroke:#374151,stroke-width:2px,color:#111827

    classDef frontend fill:#DBEAFE,stroke:#1D4ED8,stroke-width:2px,color:#0F172A
    classDef backend fill:#E0F2FE,stroke:#0369A1,stroke-width:2px,color:#0F172A
    classDef config fill:#F3E8FF,stroke:#7C3AED,stroke-width:2px,color:#111827

    classDef database fill:#DCFCE7,stroke:#15803D,stroke-width:2px,color:#052e16
    classDef ops fill:#F3F4F6,stroke:#6B7280,stroke-width:2px,color:#111827
```
