# samiurprapon/aether architecture

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

- Interactive diagram: https://gitdiagram.com/samiurprapon/aether
- Repository: https://github.com/samiurprapon/aether

## Overview

##### Main Components Structure

a) Client Layer:
- Android App (Native Java)
- Web Frontend (React/TypeScript)

b) Server Layer:
- Sub-components:
- Authentication Service
- Course Management
- Materials Management
- Reading Analytics
- User Management

c) Database Layer:
- PostgreSQL (main database)
- Redis (caching/sessions)

##### Component Details

a) Android Client:
- Modules:
- Authentication (login/registration)
- Student/Teacher Views
- Course Management
- Eye Tracking System
- Profile Management

b) Web Frontend:
- Components:
- Authentication
- Dashboard
- Course Management
- Analytics Interface

c) Backend Services:
- Detail the microservices architecture:
- Auth Service (JWT/Jose)
- Course Service
- Materials Service
- Reading Analytics Service
- User Service (Student/Teacher)

##### Data Flow

- Client-Server communication (REST APIs)
- Database interactions
- Authentication flow
- Eye-tracking data flow
- Analytics processing

##### Security Layer
- Security components:
- JWT Authentication
- Role-based Access Control
- API Gateway
- SSL/TLS encryption

##### Additional Elements

- External services:
- Eye tracking integration
- File storage system
- Monitoring and logging components
- Caching mechanism with Redis

##### Notes

Annotations for:
- Technology stack details
- Security implementations
- Scaling considerations
- Key features like eye-tracking
- Database schema relationships

- The distributed nature of the system
- Security implementation
- Clear separation of concerns
- Data flow for eye-tracking analytics
- Scalability considerations

Keep the abstraction level balanced to show both high-level architecture and important implementation details without overwhelming the viewer.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Clients
        Android["Android App"]
        Web["Web Frontend"]:::web
        
        subgraph AndroidModules["Android Components"]
            Auth_Android["Authentication"]:::android
            Views["Student/Teacher Views"]:::android
            EyeTrack["Eye Tracking System"]:::android
            Profile["Profile Management"]:::android
        end
        
        subgraph WebModules["Web Components"]
            Auth_Web["Authentication"]:::web
            Dashboard["Dashboard"]:::web
            CourseUI["Course Management"]:::web
            Analytics["Analytics Interface"]:::web
        end
    end
    
    subgraph Backend["Backend Server"]
        API["API Gateway"]:::backend
        
        subgraph Services["Core Services"]
            AuthService["Authentication Service"]:::backend
            CourseService["Course Service"]:::backend
            MaterialsService["Materials Service"]:::backend
            ReadingService["Reading Analytics Service"]:::backend
            UserService["User Service"]:::backend
        end
        
        subgraph Security["Security Layer"]
            JWT["JWT/Jose"]:::security
            RBAC["Role-based Access"]:::security
            SSL["SSL/TLS"]:::security
        end
    end
    
    subgraph Storage["Data Layer"]
        PostgreSQL[(PostgreSQL)]:::database
        Redis[(Redis Cache)]:::database
    end
    
    %% Connections
    Android --> API
    Web --> API
    API --> Services
    Services --> PostgreSQL
    Services --> Redis
    
    %% Android Module Connections
    Android --> AndroidModules
    Auth_Android --> API
    Views --> API
    EyeTrack --> ReadingService
    
    %% Web Module Connections
    Web --> WebModules
    Auth_Web --> API
    Dashboard --> API
    CourseUI --> API
    Analytics --> API
    
    %% Service Connections
    AuthService --> JWT
    Services --> RBAC
    API --> SSL
    
    %% Click Events
    click Auth_Android "https://github.com/samiurprapon/Aether/tree/main/android/app/src/main/java/life/nsu/aether/repositories/authorization/"
    click Views "https://github.com/samiurprapon/Aether/tree/main/android/app/src/main/java/life/nsu/aether/views/student/"
    click AuthService "https://github.com/samiurprapon/Aether/tree/main/backend/src/apps/authentication/"
    click CourseService "https://github.com/samiurprapon/Aether/tree/main/backend/src/apps/courses/"
    click MaterialsService "https://github.com/samiurprapon/Aether/tree/main/backend/src/apps/materials/"
    click ReadingService "https://github.com/samiurprapon/Aether/tree/main/backend/src/apps/reading/"
    click UserService "https://github.com/samiurprapon/Aether/tree/main/backend/src/apps/users/"
    click PostgreSQL "https://github.com/samiurprapon/Aether/tree/main/backend/src/providers/postgres/"
    click Redis "https://github.com/samiurprapon/Aether/tree/main/backend/src/providers/redis/"
    click Web "https://github.com/samiurprapon/Aether/tree/main/frontend/src/components/"
    click Auth_Web "https://github.com/samiurprapon/Aether/blob/main/frontend/src/contexts/AuthContext.tsx"
    click Dashboard "https://github.com/samiurprapon/Aether/blob/main/frontend/src/pages/dashboard.tsx"
    click JWT "https://github.com/samiurprapon/Aether/tree/main/backend/src/apps/authentication/middlewares/"
    
    %% Styling
    classDef android fill:#90EE90
    classDef web fill:#87CEEB
    classDef backend fill:#FFE4B5
    classDef security fill:#FFB6C1
    classDef database fill:#DDA0DD
    
    %% Legend
    subgraph Legend
        Android_L["Android Component"]:::android
        Web_L["Web Component"]:::web
        Backend_L["Backend Service"]:::backend
        Security_L["Security Component"]:::security
        Database_L["Database"]:::database
    end
```
