# edm115-org/senescalade architecture

> Architecture diagram of the GitHub repository edm115-org/senescalade, 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/edm115-org/senescalade
- Repository: https://github.com/edm115-org/senescalade

## Overview

##### Main Components

a. Client-Side (Frontend):
- Pages (User Interface)
- Components (Reusable UI elements)
- Layouts (Admin/Default templates)
- Store (Pinia state management)
- Assets (Styles/Utils)
- i18n (Internationalization)

b. Server-Side (Backend):
- API Routes
- Authentication Middleware
- Email Service (Nodemailer)
- Database Connection Pool

c. Database:
- Users
- Climbers
- Sessions
- Administrators
- Waitlists

d. External Services:
- Gmail SMTP Server (for email notifications)
- JWT Authentication Service

##### Connection and Data Flow

- Frontend → Backend API calls
- Backend → Database queries
- Backend → Email Service
- Authentication flow between components

##### Specific Implementation Details

Technical stack information:
- Nuxt.js/Vue.js framework
- Vuetify UI framework
- Pinia state management
- MySQL 8.0
- Docker containerization
- Node.js 20 runtime

##### Key Features to Highlight

Specific flows for:
- User registration/authentication
- Session management
- Admin dashboard operations
- Waitlist notification system
- Reinscription process

##### Deployment Architecture

A separate section showing:
- Docker containers
- Network configuration
- Port mappings (80/56860)
- Environment configurations

##### Security Layer

Security implementations:
- JWT token flow
- Password encryption (bcrypt)
- Authentication middleware
- Email verification flow

##### External Services Layer

Important Considerations:
- Clear boundaries between admin and user functionalities
- Security flow and data protection measures
- Notes for scalability considerations and Docker deployment

Remember to include version information and dependencies as a separate reference section, as these are crucial for maintaining and scaling the application.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Frontend["Frontend (Nuxt.js)"]
        direction TB
        Pages["Pages (UI)"]:::frontend
        Components["Components"]:::frontend
        Layouts["Layouts"]:::frontend
        Store["Store (Pinia)"]:::frontend
        Assets["Assets"]:::frontend
        I18n["i18n"]:::frontend
        
        subgraph Forms["Form Components"]
            FormLogin["Login Form"]:::frontend
            FormUser["User Form"]:::frontend
            FormPassword["Password Form"]:::frontend
        end
        
        subgraph Interface["Interface Pages"]
            AdminUI["Admin Interface"]:::frontend
            UserUI["User Interface"]:::frontend
            AuthPages["Auth Pages"]:::frontend
        end
    end

    subgraph Backend["Backend (Nitro/H3)"]
        direction TB
        API["API Routes"]:::backend
        AuthMiddleware["Auth Middleware"]:::backend
        EmailService["Email Service"]:::backend
        DBConnection["Database Connection"]:::backend
        
        subgraph Services["Core Services"]
            UserMgmt["User Management"]:::backend
            SessionMgmt["Session Management"]:::backend
            MailVerify["Mail Verification"]:::backend
            PassReset["Password Reset"]:::backend
        end
    end

    subgraph Database["MySQL Database"]
        direction TB
        Users[(Users)]:::database
        Climbers[(Climbers)]:::database
        Sessions[(Sessions)]:::database
        Admins[(Administrators)]:::database
        Waitlists[(Waitlists)]:::database
    end

    subgraph External["External Services"]
        direction TB
        SMTP["Gmail SMTP"]:::external
        JWT["JWT Auth"]:::external
    end

    %% Connections
    Frontend --> Backend
    Backend --> Database
    EmailService --> SMTP
    AuthMiddleware --> JWT
    Services --> Database
    Forms --> API

    %% Click Events
    click Pages "https://github.com/EDM115-Org/Senescalade/tree/master//pages"
    click Components "https://github.com/EDM115-Org/Senescalade/tree/master//components"
    click Layouts "https://github.com/EDM115-Org/Senescalade/tree/master//layouts"
    click Store "https://github.com/EDM115-Org/Senescalade/blob/master//store/main.js"
    click Assets "https://github.com/EDM115-Org/Senescalade/tree/master//assets"
    click I18n "https://github.com/EDM115-Org/Senescalade/tree/master//i18n/locales"
    click API "https://github.com/EDM115-Org/Senescalade/tree/master//server/api"
    click AuthMiddleware "https://github.com/EDM115-Org/Senescalade/blob/master//server/middleware/auth.js"
    click DBConnection "https://github.com/EDM115-Org/Senescalade/blob/master//server/api/db.js"
    click MailVerify "https://github.com/EDM115-Org/Senescalade/blob/master//server/api/mailVerify.js"
    click PassReset "https://github.com/EDM115-Org/Senescalade/blob/master//server/api/forgotPassword.js"
    click UserMgmt "https://github.com/EDM115-Org/Senescalade/blob/master//server/api/login.js"
    click SessionMgmt "https://github.com/EDM115-Org/Senescalade/blob/master//server/api/notifySeance.js"
    click FormLogin "https://github.com/EDM115-Org/Senescalade/blob/master//components/form/FormLogin.vue"
    click FormUser "https://github.com/EDM115-Org/Senescalade/blob/master//components/form/FormUser.vue"
    click FormPassword "https://github.com/EDM115-Org/Senescalade/blob/master//components/form/FormUpdatePassword.vue"
    click AdminUI "https://github.com/EDM115-Org/Senescalade/tree/master//pages/admin"
    click UserUI "https://github.com/EDM115-Org/Senescalade/tree/master//pages/user"
    click AuthPages "https://github.com/EDM115-Org/Senescalade/tree/master//pages/login"

    %% Styles
    classDef frontend fill:#2196F3,color:white
    classDef backend fill:#4CAF50,color:white
    classDef database fill:#FFC107,color:black
    classDef external fill:#9E9E9E,color:white
    classDef security fill:#F44336,color:white

    %% Legend
    subgraph Legend
        Frontend_L[Frontend]:::frontend
        Backend_L[Backend]:::backend
        Database_L[Database]:::database
        External_L[External Services]:::external
        Security_L[Security]:::security
    end
```
