# ptlc8/tekiens-net architecture

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

- Interactive diagram: https://gitdiagram.com/ptlc8/tekiens-net
- Repository: https://github.com/ptlc8/tekiens-net

## Overview

##### Main System Components

a. Frontend Layer:
- Vue.js application
- Key views (Events, Associations, Login)
- State management (stores)
- Component library
- Asset management

b. Backend Layer:
- Flask application
- API endpoints
- Template engine
- File storage system
- Email service integration

c. Database Layer:
- MariaDB/MySQL database
- Key tables (assos, events, campus, emails, sessions)

d. External Services:
- SMTP server for emails
- Calendar system (ICS)
- RSS feed system

**[Client Browsers] ←→ [Reverse Proxy/SSL]**
- ↓
**[Frontend - Vue.js]**
- ↓
**[Backend - Flask]**
- ↓
**[Database - MariaDB] ← → [File Storage]**
- ↓
**[External Services]**

##### Component Details

Frontend (Vue.js):
- Main views structure (/src/views)
- Stores for state management
- Component library
- Asset management

Backend (Flask):
- API routes structure (/app/api)
- Template processing system
- File storage management
- Demonstrate email handling system

Database:
- Main tables and relationships
- File storage system
- Session management

##### Data Flow Indicators

- Client-server communication
- API calls between frontend and backend
- Database queries
- File system operations
- External service interactions

##### Special Features to Highlight

- Calendar system integration (ICS)
- RSS feed generation
- Email template system
- Association profile management
- Event management system

##### Technical Details

Environment Components:
- Apache2 web server
- WSGI configuration
- SSL termination
- Development vs Production setup

##### Notes Section

A notes section explaining:
- Deployment configuration
- Security measures
- Scaling considerations
- Development workflow

Remember to include the specific file paths and configurations that are unique to this project, such as the data storage structure in /back/data and the template system in /back/templates.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef client fill:#3498db,stroke:#2980b9,color:white
    classDef server fill:#2ecc71,stroke:#27ae60,color:white
    classDef app fill:#f1c40f,stroke:#f39c12,color:black
    classDef data fill:#e74c3c,stroke:#c0392b,color:white
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white

    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        Browser["Web Browser"]:::client
        Calendar["Calendar Apps"]:::client
        RSSReader["RSS Readers"]:::client
        
        subgraph FrontendApp["Vue.js Frontend"]
            Views["Views"]:::client
            Components["Components"]:::client
            Stores["State Stores"]:::client
            Router["Router"]:::client
            APIClient["API Client"]:::client
        end
    end

    %% Web Server Layer
    subgraph WebServerLayer["Web Server Layer"]
        Nginx["Nginx SSL Proxy"]:::server
        Apache["Apache2 + mod_wsgi"]:::server
    end

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        subgraph FlaskBackend["Flask Backend"]
            subgraph APIRoutes["API Routes"]
                AssosAPI["Associations API"]:::app
                EventsAPI["Events API"]:::app
                SessionsAPI["Sessions API"]:::app
                EmailsAPI["Emails API"]:::app
                TemplatesAPI["Templates API"]:::app
                SocialsAPI["Social Media API"]:::app
            end

            subgraph CoreServices["Core Services"]
                ICSGen["ICS Generator"]:::app
                RSSGen["RSS Generator"]:::app
                DBHandler["Database Handler"]:::app
                MailHandler["Mail Handler"]:::app
            end

            subgraph TemplateEngine["Template Engine"]
                Mustache["Mustache Engine"]:::app
                EmailTemplates["Email Templates"]:::app
            end
        end
    end

    %% Data Layer
    subgraph DataLayer["Data Layer"]
        MariaDB[(MariaDB Database)]:::data
        FileStorage[("File Storage")]:::data
        DBSchema["Database Schema"]:::data
    end

    %% External Services
    subgraph ExternalServices["External Services"]
        SMTP["SMTP Server"]:::external
        Discord["Discord Integration"]:::external
    end

    %% Relationships
    Browser --> Nginx
    Calendar --> Nginx
    RSSReader --> Nginx
    Nginx --> Apache
    Apache --> FlaskBackend
    
    APIClient --> APIRoutes
    Router --> Views
    Views --> Components
    Components --> Stores
    
    APIRoutes --> CoreServices
    CoreServices --> DBHandler
    DBHandler --> MariaDB
    CoreServices --> FileStorage
    
    MailHandler --> SMTP
    SocialsAPI --> Discord
    
    ICSGen --> Calendar
    RSSGen --> RSSReader

    %% Click Events
    click Views "https://github.com/ptlc8/tekiens-net/tree/master//front/src/views/"
    click Components "https://github.com/ptlc8/tekiens-net/tree/master//front/src/components/"
    click Stores "https://github.com/ptlc8/tekiens-net/tree/master//front/src/stores/"
    click Nginx "https://github.com/ptlc8/tekiens-net/blob/master//nginx-ssl.conf"
    click Apache "https://github.com/ptlc8/tekiens-net/blob/master//apache2.conf"
    click AssosAPI "https://github.com/ptlc8/tekiens-net/blob/master//back/app/api/assos.py"
    click EventsAPI "https://github.com/ptlc8/tekiens-net/blob/master//back/app/api/events.py"
    click SessionsAPI "https://github.com/ptlc8/tekiens-net/blob/master//back/app/api/sessions.py"
    click EmailsAPI "https://github.com/ptlc8/tekiens-net/blob/master//back/app/api/emails.py"
    click TemplatesAPI "https://github.com/ptlc8/tekiens-net/blob/master//back/app/api/templates.py"
    click ICSGen "https://github.com/ptlc8/tekiens-net/blob/master//back/app/ics.py"
    click RSSGen "https://github.com/ptlc8/tekiens-net/blob/master//back/app/rss.py"
    click DBHandler "https://github.com/ptlc8/tekiens-net/blob/master//back/app/database.py"
    click MariaDB "https://github.com/ptlc8/tekiens-net/blob/master//mariadb.cnf"
    click DBSchema "https://github.com/ptlc8/tekiens-net/blob/master//init.sql"
    click FileStorage "https://github.com/ptlc8/tekiens-net/tree/master//back/data/"
    click MailHandler "https://github.com/ptlc8/tekiens-net/blob/master//back/app/api/mail.py"
    click EmailTemplates "https://github.com/ptlc8/tekiens-net/tree/master//back/templates/"
    click SocialsAPI "https://github.com/ptlc8/tekiens-net/blob/master//back/app/api/socials.py"
    click APIClient "https://github.com/ptlc8/tekiens-net/blob/master//front/src/api.js"
    click Router "https://github.com/ptlc8/tekiens-net/blob/master//front/src/router.js"

    %% Legend
    subgraph Legend["Legend"]
        Client["Client Components"]:::client
        Server["Server Components"]:::server
        Application["Application Components"]:::app
        Database["Data Storage"]:::data
        External["External Services"]:::external
    end
```
