# raelee1026/your-secure-files architecture

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

- Interactive diagram: https://gitdiagram.com/raelee1026/your-secure-files
- Repository: https://github.com/raelee1026/your-secure-files

## Overview

##### Project Type and Purpose
- This is a full-stack, containerized web application named “Your-Secure-Files.”
- Backend: Python (FastAPI), SQLAlchemy/Alembic migrations, JWT‐based auth, email templating (MJML).
- Frontend: Vite-powered, TypeScript/TSX SPA (React or Solid), autogenerated OpenAPI client, UI component library.
- CI/CD: GitHub Actions (lint, test, generate client, build, deploy), Docker Compose + Traefik for local/dev, staging, production environments.

##### File-Structure Analysis
Top-level directories:
– backend/… – source, migrations, tests, Dockerfile, scripts, alembic versions.
– frontend/… – Vite config, src/routes (file-based routing with nested layouts), src/components, autogenerated client under src/client, Playwright tests.
– .github/workflows – multiple pipelines (linting, testing, deploy‐staging, deploy‐production, generate‐client).
– docker-compose*.yml – service definitions for frontend, backend, DB, Traefik, mailcatcher, etc.
– scripts/ – wrappers for build, test, generate-client, deploy.

##### Key README/Docs Insights
- deployment.md & development.md explain env setup, local Compose stacks, Traefik routing, secret management.
- OpenAPI spec is emitted by the FastAPI app and consumed by generate-client.sh / GitHub Actions to produce the TypeScript client.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Layer"
        Browser["Web Browser"]:::blue
    end

    subgraph "Infrastructure Layer"
        Traefik["Traefik Reverse Proxy"]:::orange
        SMTP["SMTP Service / Mailcatcher"]:::gray
    end

    subgraph "Runtime (Docker Network)" 
        direction TB
        SPA["SPA (Vite)"]:::blue
        FastAPI["FastAPI Service"]:::green
        Postgres["PostgreSQL Database"]:::gray
    end

    subgraph "CI/CD Pipeline"
        GH["GitHub Actions"]:::orange
    end

    Browser -->|HTTPS| Traefik
    Traefik --> SPA
    Traefik --> FastAPI
    SPA -->|API calls| FastAPI
    FastAPI -->|SQLAlchemy ORM| Postgres
    FastAPI -->|send email| SMTP

    GH -->|build & test backend| FastAPI
    GH -->|generate OpenAPI client| SPA
    GH -->|deploy services| Traefik

    subgraph "Codebase"
        direction TB
        FE_Src["frontend/src"]:::blue
        FE_Vite["frontend/vite.config.ts"]:::blue
        FE_Client["frontend/src/client"]:::blue
        FE_Comp["frontend/src/components"]:::blue
        FE_Routes["frontend/src/routes"]:::blue
        FE_Tests["frontend/tests"]:::blue
        BE_Main["backend/app/main.py"]:::green
        BE_Routes["backend/app/api/routes"]:::green
        BE_Deps["backend/app/api/deps.py"]:::green
        BE_CoreCfg["backend/app/core/config.py"]:::green
        BE_CoreSec["backend/app/core/security.py"]:::green
        BE_CoreDB["backend/app/core/db.py"]:::green
        BE_CoreAES["backend/app/core/aes_gcm.py"]:::green
        BE_Models["backend/app/models.py & crud.py"]:::green
        BE_AlembicIni["backend/alembic.ini"]:::green
        BE_AlembicDir["backend/app/alembic"]:::green
        BE_Vers["backend/app/alembic/versions"]:::green
        BE_EmailSrc["backend/app/email-templates/src"]:::green
        BE_EmailBuild["backend/app/email-templates/build"]:::green
        BE_PreStartPy["backend/app/backend_pre_start.py"]:::green
        BE_PreStartSh["backend/scripts/prestart.sh"]:::green
        BE_TestsSuite["backend/app/tests"]:::green
        BE_Utils["backend/scripts"]:::green
        GenScript["scripts/generate-client.sh"]:::orange
        GenWorkflow[".github/workflows/generate-client.yml"]:::orange
        ComposeMain["docker-compose.yml"]:::orange
        ComposeTraefik["docker-compose.traefik.yml"]:::orange
        CI_Workflows[".github/workflows"]:::orange
        Docs["deployment.md & development.md"]:::orange
        ScriptsProj["scripts"]:::orange
    end

    click FE_Src "https://github.com/raelee1026/your-secure-files/tree/main/frontend/src"
    click FE_Vite "https://github.com/raelee1026/your-secure-files/blob/main/frontend/vite.config.ts"
    click FE_Client "https://github.com/raelee1026/your-secure-files/tree/main/frontend/src/client"
    click FE_Comp "https://github.com/raelee1026/your-secure-files/tree/main/frontend/src/components"
    click FE_Routes "https://github.com/raelee1026/your-secure-files/tree/main/frontend/src/routes"
    click FE_Tests "https://github.com/raelee1026/your-secure-files/tree/main/frontend/tests"
    click BE_Main "https://github.com/raelee1026/your-secure-files/blob/main/backend/app/main.py"
    click BE_Routes "https://github.com/raelee1026/your-secure-files/tree/main/backend/app/api/routes"
    click BE_Deps "https://github.com/raelee1026/your-secure-files/blob/main/backend/app/api/deps.py"
    click BE_CoreCfg "https://github.com/raelee1026/your-secure-files/blob/main/backend/app/core/config.py"
    click BE_CoreSec "https://github.com/raelee1026/your-secure-files/blob/main/backend/app/core/security.py"
    click BE_CoreDB "https://github.com/raelee1026/your-secure-files/blob/main/backend/app/core/db.py"
    click BE_CoreAES "https://github.com/raelee1026/your-secure-files/blob/main/backend/app/core/aes_gcm.py"
    click BE_Models "https://github.com/raelee1026/your-secure-files/blob/main/backend/app/models.py & crud.py"
    click BE_AlembicIni "https://github.com/raelee1026/your-secure-files/blob/main/backend/alembic.ini"
    click BE_AlembicDir "https://github.com/raelee1026/your-secure-files/tree/main/backend/app/alembic"
    click BE_Vers "https://github.com/raelee1026/your-secure-files/tree/main/backend/app/alembic/versions"
    click BE_EmailSrc "https://github.com/raelee1026/your-secure-files/tree/main/backend/app/email-templates/src"
    click BE_EmailBuild "https://github.com/raelee1026/your-secure-files/tree/main/backend/app/email-templates/build"
    click BE_PreStartPy "https://github.com/raelee1026/your-secure-files/blob/main/backend/app/backend_pre_start.py"
    click BE_PreStartSh "https://github.com/raelee1026/your-secure-files/blob/main/backend/scripts/prestart.sh"
    click BE_TestsSuite "https://github.com/raelee1026/your-secure-files/tree/main/backend/app/tests"
    click BE_Utils "https://github.com/raelee1026/your-secure-files/tree/main/backend/scripts"
    click GenScript "https://github.com/raelee1026/your-secure-files/blob/main/scripts/generate-client.sh"
    click GenWorkflow "https://github.com/raelee1026/your-secure-files/blob/main/.github/workflows/generate-client.yml"
    click ComposeMain "https://github.com/raelee1026/your-secure-files/blob/main/docker-compose.yml"
    click ComposeTraefik "https://github.com/raelee1026/your-secure-files/blob/main/docker-compose.traefik.yml"
    click CI_Workflows "https://github.com/raelee1026/your-secure-files/tree/main/.github/workflows"
    click Docs "https://github.com/raelee1026/your-secure-files/blob/main/deployment.md"
    click ScriptsProj "https://github.com/raelee1026/your-secure-files/tree/main/scripts"

    classDef blue fill:#ADD8E6,stroke:#000
    classDef green fill:#90EE90,stroke:#000
    classDef orange fill:#FFD580,stroke:#000
    classDef gray fill:#D3D3D3,stroke:#000
```
