# bipin-a/aidi-1100 architecture

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

- Interactive diagram: https://gitdiagram.com/bipin-a/aidi-1100
- Repository: https://github.com/bipin-a/aidi-1100

## Overview

##### Project Type and Purpose
- This repository is primarily a course‐ware monorepo (AIDI1100) that bundles lecture materials, assignments, and a minimal Python web application sample (“app” folder).
- The “app” is a small FastAPI service (main.py/main2.py), with standard Python packaging (pyproject.toml), dependencies (requirements.txt), and a run script (run.sh).
- The README focuses on local development setup (Python env, uv tool, VS Code, FastAPI).

##### File Structure
- Top-level directories:
- Assignments/lecture_material: static Markdown and Jupyter notebooks for course content.
- app/: the only runnable service.
- Config files:
- pyproject.toml (global and under app/) – defines dependencies and packaging.
- requirements.txt – pinned dependencies for the FastAPI app.
- run.sh – entrypoint to launch the service.
- Makefile – possible high-level dev commands.
- No database or external service configs are present—this is a standalone example microservice.

##### Insights from README
- Emphasizes isolated Python environments via “uv” (virtual environment manager).
- Guides on installing VS Code and Python extension.
- Mentions FastAPI integration but no production/deployment details.

- a. Main Components
1. Developer Machine
- Tools: Git, Python, uv (virtual env), VS Code.
2. Code Repository
- Branches, commits, .gitignore, pyproject.toml, Makefile.
3. FastAPI Service (“app”)
- Python modules (main.py, main2.py).
- Dependency layer (requirements.txt / pyproject.toml).
- Runtime: Uvicorn server invoked by run.sh.
4. Client (e.g., browser or API consumer)
- Sends HTTP requests to the FastAPI endpoints.
- b. Relationships & Data Flow
- Developer clones repo → runs `uv sync` → installs dependencies → launches run.sh → starts Uvicorn + FastAPI.
- Client → HTTP requests → Uvicorn → FastAPI route handlers → returns JSON responses.
- c. Architectural Patterns & Principles
- Separation of concerns:
– Environment management (uv)
– Dependency specification (pyproject.toml, requirements.txt)
– Application code (app/).
- Web microservice pattern: lightweight HTTP server with clear entrypoint.
- d. Relevant Technologies
- Python 3.x, FastAPI, Uvicorn
- uv (environment / dependency tool)
- VS Code for editing/debugging
- Makefile for auxiliary tasks

##### Diagramming Conventions
- From Developer → Repo (pull/push).
- From Developer → uv tool → dependency installation.
- From Client → HTTP → FastAPI endpoints.
- Blue for developer tools & processes.
- Green for application code & runtime.
- Orange for clients or external systems.

##### Putting It All Together
- Next, a “Code Repository” block showing folder structure at high level (assignments, lecture_material, app).
- Within “app” block, illustrate:
- Dependency layer (pyproject.toml, requirements.txt)
- Runtime script (run.sh) → Uvicorn
- FastAPI application (main.py, main2.py)
- On the right, show “Client” block (e.g., Postman / Browser).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        Git["Git"]:::dev
        UV["uv (env manager)"]:::dev
        VSCode["VS Code"]:::dev
    end

    %% Repository
    subgraph "Code Repository"
        RepoDocs["Documentation"]:::dev
        ReadmeRoot["README.md"]:::dev
        ReadmeAidi["AIDI1100Readme.md"]:::dev
        Gitignore[".gitignore"]:::dev
        RootPyproject["pyproject.toml"]:::dev
        MakefileNode["Makefile"]:::dev
        CourseContent["Course Content"]:::dev
        subgraph "Course Content"
            Assignments["Assignments/"]:::dev
            LectureMaterials["lecture_material/"]:::dev
        end
        AppFolder["app/"]:::app
    end

    %% FastAPI Service
    subgraph "FastAPI Service (app/)" 
        Dependencies["Dependency Layer"]:::app
        Requirements["requirements.txt"]:::app
        AppPyproject["pyproject.toml"]:::app
        Entrypoint["Entrypoint Script"]:::app
        RunSh["run.sh"]:::app
        Uvicorn["Uvicorn Server"]:::app
        FastAPIApp["FastAPI Application"]:::app
        MainPy["main.py"]:::app
        Main2Py["main2.py"]:::app
    end

    %% Client
    subgraph "Client / External"
        Client["Browser / API Consumer"]:::ext
    end

    %% Connections
    Git -->|clones repo| RepoDocs
    Git -->|clones repo| CourseContent
    Git -->|clones repo| AppFolder
    UV -->|sync dependencies| Dependencies
    MakefileNode -->|runs tasks| Entrypoint
    Entrypoint -->|executes| Uvicorn
    Uvicorn -->|hosts| FastAPIApp
    FastAPIApp -->|routes defined in| MainPy
    FastAPIApp -->|routes defined in| Main2Py
    Client -->|HTTP request| Uvicorn
    Uvicorn -->|HTTP response| Client

    %% Click Events
    click Assignments "https://github.com/bipin-a/aidi-1100/tree/main/Assignments/"
    click LectureMaterials "https://github.com/bipin-a/aidi-1100/tree/main/lecture_material/"
    click MainPy "https://github.com/bipin-a/aidi-1100/blob/main/app/main.py"
    click Main2Py "https://github.com/bipin-a/aidi-1100/blob/main/app/main2.py"
    click Requirements "https://github.com/bipin-a/aidi-1100/blob/main/app/requirements.txt"
    click AppPyproject "https://github.com/bipin-a/aidi-1100/blob/main/app/pyproject.toml"
    click RunSh "https://github.com/bipin-a/aidi-1100/blob/main/app/run.sh"
    click RootPyproject "https://github.com/bipin-a/aidi-1100/blob/main/pyproject.toml"
    click MakefileNode "https://github.com/bipin-a/aidi-1100/tree/main/Makefile"
    click ReadmeRoot "https://github.com/bipin-a/aidi-1100/blob/main/README.md"
    click ReadmeAidi "https://github.com/bipin-a/aidi-1100/blob/main/AIDI1100Readme.md"
    click Gitignore "https://github.com/bipin-a/aidi-1100/blob/main/.gitignore"

    %% Styles
    classDef dev fill:#add8e6,stroke:#000,stroke-width:1px
    classDef app fill:#90ee90,stroke:#000,stroke-width:1px
    classDef ext fill:#ffa500,stroke:#000,stroke-width:1px
```
