# hydrohaven/antmemo architecture

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

- Interactive diagram: https://gitdiagram.com/hydrohaven/antmemo
- Repository: https://github.com/hydrohaven/antmemo

## Overview

##### Main Components

A. Frontend Layer:
- Static Assets Component (CSS/JS)
- Template Views Component
- User Interface Modules:
- Department Selection
- Course Catalog
- -taking Interface
- Authentication Pages

B. Backend Layer:
- Django Web Framework
- URL Router
- View Controllers
- Models Layer:
- Member Model
- Student Model
- Department Model
- Course Model
- Users Model
- Model

C. Database Layer:
- SQL Database (as indicated by migrations)
- Data Models Storage

##### Component Relationships

- User → Frontend Interface (HTTP/HTTPS)
- Frontend → Django URL Router
- URL Router → View Controllers
- View Controllers → Models
- Models → Database

##### Specific Implementation Details

- Authentication System
- Course Catalog Browser
- -taking System
- Course Prerequisites Popup System

**[User Interface Layer]**
- ↓
**[Django Application Layer]**
- ↓
**[Database Layer]**

##### Important Elements to Highlight

- Authentication flow for note-taking feature
- Course catalog browsing system
- Data relationships between courses, departments, and notes
- User session management
- Static file serving

##### Technical Details

- Django MVT (Model-View-Template) architecture
- Database schema relationships
- Static file handling
- URL routing system

1. The separation between public features (course browsing) and authenticated features (note-taking)
##### The authentication and authorization system

- All major components
- Data flow directions
- System boundaries
- User interaction points
- Database relationships

This system design should reflect the Django-based architecture while highlighting the unique features of the course catalog and note-taking functionality that makes AntMemo distinct.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph User
        U[Browser/Client]
    end

    subgraph "Frontend Layer"
        SA["Static Assets"]:::frontend
        TV["Template Views"]:::frontend
        UI["User Interface"]:::frontend
        
        subgraph "UI Components"
            DS["Department Selection"]:::frontend
            CC["Course Catalog"]:::frontend
            NI["Note-taking Interface"]:::frontend
            AP["Authentication Pages"]:::frontend
        end
    end

    subgraph "Backend Layer"
        DW["Django Web Framework"]:::backend
        UR["URL Router"]:::backend
        VC["View Controllers"]:::backend
        
        subgraph "Models Layer"
            MM["Member Model"]:::model
            SM["Student Model"]:::model
            DM["Department Model"]:::model
            CM["Course Model"]:::model
            UM["Users Model"]:::model
            NM["Note Model"]:::model
        end
    end

    subgraph "Database Layer"
        DB[(SQL Database)]:::database
    end

    %% Connections
    U --> SA
    U --> TV
    U --> UI
    
    UI --> DS
    UI --> CC
    UI --> NI
    UI --> AP
    
    SA & TV & UI --> UR
    UR --> VC
    VC --> MM & SM & DM & CM & UM & NM
    MM & SM & DM & CM & UM & NM --> DB

    %% Click Events
    click SA "https://github.com/Hydrohaven/antmemo/tree/main/members/static/"
    click TV "https://github.com/Hydrohaven/antmemo/tree/main/members/templates/"
    click UR "https://github.com/Hydrohaven/antmemo/blob/main/uci_course_planner/urls.py"
    click VC "https://github.com/Hydrohaven/antmemo/blob/main/members/views.py"
    click MM "https://github.com/Hydrohaven/antmemo/blob/main/members/models.py"
    click SM "https://github.com/Hydrohaven/antmemo/blob/main/members/models.py"
    click DM "https://github.com/Hydrohaven/antmemo/blob/main/members/models.py"
    click CM "https://github.com/Hydrohaven/antmemo/blob/main/members/models.py"
    click UM "https://github.com/Hydrohaven/antmemo/blob/main/members/models.py"
    click NM "https://github.com/Hydrohaven/antmemo/blob/main/members/models.py"

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef model fill:#9b59b6,stroke:#8e44ad,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:white

    %% Legend
    subgraph Legend
        L1["Frontend Components"]:::frontend
        L2["Backend Components"]:::backend
        L3["Model Components"]:::model
        L4["Database Components"]:::database
    end
```
