# quijadajose/lsv architecture

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

- Interactive diagram: https://gitdiagram.com/quijadajose/lsv
- Repository: https://github.com/quijadajose/lsv

## Overview

##### Project Type & Purpose
- This is a full-stack educational platform focused on teaching Venezuelan Sign Language.
- There are three distinct subprojects:
▪ lsv-backend: A NestJS backend built with a hexagonal (ports and adapters) architecture that handles authentication, users, language management, lessons, quizzes, stages, etc.
▪ lsv-frontend: An Angular-based frontend (mentioned in the README, even if not fully seen in the file tree) that interfaces with the backend services.
▪ lsv-model-trainer: A Python-based machine learning API for training sign detection models, likely leveraging frameworks like TensorFlow or PyTorch.

##### Extracting Insights from the README
- The README confirms the use of NestJS, TypeORM, and MySQL on the backend and Angular for the frontend.

a. Main Components:
- Client Layer:
– lsv-frontend (Angular UI)
- Application Layer:
– lsv-backend (NestJS application) with its modules (authentication, language, lessons, quizzes, etc.)
- Persistence:
– MySQL database (accessed via TypeORM)
- Machine Learning:
– lsv-model-trainer (Python API for training sign recognition models)
- Additional (if applicable):
– Docker and container orchestration components, indicated by Dockerfile and docker-compose (for consistent deployment across environments)

b. Relationships & Interactions:
- Within the lsv-backend, illustrate how the hexagonal architecture connects the domain (business logic) with the infrastructure (controllers, database adapters, external service interfaces, etc.).
- Database (MySQL) as an external component that the backend interacts with via TypeORM.

c. Architectural Patterns & Principles:
- Hexagonal (ports and adapters) architecture used in lsv-backend by explicitly marking the core domain/use-cases, the application services (ports), and the adapters (controllers, repositories).
- How each major module (auth, language, lesson, etc.) fits into this layered architecture.

d. Technologies & Frameworks:
- NestJS, TypeORM, and MySQL for the backend.
- Angular for the frontend.
- Python (with TensorFlow/PyTorch) for the ML model trainer.
- Mention deployment tools (Docker, docker-compose) where relevant.

##### Final Touches
- Not only the main high-level components but also expand on the backend’s internal architecture if needed (highlight key modules such as auth, language, lessons, quiz, etc., and how they communicate with shared infrastructure like the database).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        FE["lsv-frontend (Angular UI)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer (NestJS Hexagonal Architecture)"
        %% Core & Configuration
        subgraph "Core & Configuration"
            CORE["Core App (NestJS)"]:::backend
            APPMODULE["app.module.ts"]:::backendConfig
            DOCKERFILE["Dockerfile"]:::backendConfig
            DOCKERCOMPOSE["docker-compose.yml"]:::backendConfig
            ENV[".env.example"]:::backendConfig
            CORE --> APPMODULE
            CORE --> DOCKERFILE
            CORE --> DOCKERCOMPOSE
            CORE --> ENV
        end
        %% Modules
        subgraph "Modules"
            AUTH["Auth Module"]:::backendModule
            LANG["Language Module"]:::backendModule
            LESSON["Lesson Module"]:::backendModule
            QUIZ["Quiz Module"]:::backendModule
            STAGE["Stage Module"]:::backendModule
            USERLESSON["User-Lesson Module"]:::backendModule
            USERS["Users Module"]:::backendModule
            LEADERBOARD["Leaderboard Module"]:::backendModule
            SHARED["Shared Module"]:::backendModule
        end
        CORE -->|"integrates"| AUTH
        CORE -->|"integrates"| LANG
        CORE -->|"integrates"| LESSON
        CORE -->|"integrates"| QUIZ
        CORE -->|"integrates"| STAGE
        CORE -->|"integrates"| USERLESSON
        CORE -->|"integrates"| USERS
        CORE -->|"integrates"| LEADERBOARD
        CORE -->|"integrates"| SHARED
    end

    %% Data & External Services
    subgraph "Data & External Services"
        DB["MySQL (TypeORM)"]:::database
        ML["lsv-model-trainer (Python API)"]:::ml
    end

    %% Connections
    FE -->|"REST_API"| CORE
    CORE -->|"DB_calls"| DB
    CORE -->|"ML_API"| ML

    %% Click Events
    click CORE "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src"
    click APPMODULE "https://github.com/quijadajose/lsv/blob/main/lsv-backend/app.module.ts"
    click DOCKERFILE "https://github.com/quijadajose/lsv/tree/main/Dockerfile"
    click DOCKERCOMPOSE "https://github.com/quijadajose/lsv/blob/main/docker-compose.yml"
    click ENV "https://github.com/quijadajose/lsv/blob/main/.env.example"
    click AUTH "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/auth"
    click LANG "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/language"
    click LESSON "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/lesson"
    click QUIZ "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/quiz"
    click STAGE "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/stage"
    click USERLESSON "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/user-lesson"
    click USERS "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/users"
    click LEADERBOARD "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/leaderboard"
    click SHARED "https://github.com/quijadajose/lsv/tree/main/lsv-backend/src/shared"
    click ML "https://github.com/quijadajose/lsv/blob/main/lsv-model-trainer/main.py"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px
    classDef backend fill:#90EE90,stroke:#000,stroke-width:2px
    classDef backendModule fill:#FBB4AE,stroke:#000,stroke-width:2px
    classDef backendConfig fill:#FFE8A1,stroke:#000,stroke-width:2px
    classDef database fill:#D3D3D3,stroke:#000,stroke-width:2px
    classDef ml fill:#FFB6C1,stroke:#000,stroke-width:2px
```
