# amruthpillai/reactive-resume architecture

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

- Interactive diagram: https://gitdiagram.com/amruthpillai/reactive-resume
- Repository: https://github.com/amruthpillai/reactive-resume

## Overview

##### Main Components
- Frontend Applications:
- “apps/client”: The main React (Vite) frontend that users interact with. It handles login, registration, resume building (with pages for authentication, builder, dashboard, home, etc.), and integrates detailed components such as various resume sections, theming, notifications, and localization.
- “apps/artboard”: Likely a specialized part of the application for designing or previewing resume templates in real time. It includes its own set of components (templates, pages, etc.).
- Backend Server:
- “apps/server”: A NestJS-based backend that exposes APIs for authentication, resume management, user management, email services, storage, and more. Within this, modules are clearly separated (auth, contributors, feature, health, mail, printer, resume, storage, translation, user) which points to a micro-modular architectural style.
- Shared Libraries:
- “libs/dto”: Contains Data Transfer Objects used for standardizing communication between frontend and backend.
- “libs/hooks”: Provides reusable React hooks for frontend logic.
- “libs/parser” and “libs/schema”: Handle parsing of resume data, templates and schema validation.
- “libs/ui”: Contains shared UI components used across different frontend parts.
- “libs/utils”: Offers utility functions (such as array, string, date, and other namespace functions) used throughout the project.
- Infrastructure and Tools:
- Database and ORM: Uses PostgreSQL as the primary database along with Prisma ORM for database operations.
- Object Storage: Minio is used for storing objects such as avatars, PDFs, and resume previews.
- External Services:
▪ OpenAI integration for functionalities like content improvement and tone adjustment.
▪ Browserless service for headless Chrome operations (PDF printing and preview generation).
▪ SMTP server for sending password recovery and other emails.
▪ OAuth providers (GitHub, Google) to allow for third-party authentication.
▪ Localization and translation through LinguiJS and Crowdin.
- Containerization and Deployment Tools: Docker-related files and multiple Docker Compose files indicate containerized deployment and various environments (development, swarm, traefik-based setups).

##### Relationships and Data Flow
- The Frontend (both apps/client and apps/artboard) will interact with the backend server through RESTful APIs secured with JWT or other guards (note the existence of multiple authentication guards and strategies).
- The backend server communicates with the database (Postgres) via Prisma ORM, manages file storage via Minio, and performs PDF generation via Browserless.
- The shared libraries (DTOs, UI components, hooks, parser, utilities) ensure that both the frontend and backend adhere to a consistent contract and code reuse—thus, they fall into a “common” layer.

##### Architectural Patterns and Design Principles
- Micro-modular / Layered Architecture: Layers for UI, business logic, data access, and utilities are clearly differentiated.
- API-First Communication: Consistent data contracts (provided by DTOs) are used between the frontend and backend.
- Scalability & Extensibility: The libraries and consistent use of external configuration files (like Dockerfiles, Compose files) allow easy scaling, customization, and deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend"
        FE1("Reactive Resume Client (React/Vite)"):::frontend
        FE2("Reactive Resume Artboard (Resume Template Design/Preview)"):::frontend
    end

    %% Backend Layer with Modules
    subgraph "Backend"
        BE("Reactive Resume Server (NestJS)"):::backend
        subgraph "Backend Modules"
            A("Auth Module (NestJS)"):::backend
            B("Contributors Module"):::backend
            C("Feature Module"):::backend
            D("Health Module"):::backend
            E("Mail Module"):::backend
            F("Printer Module"):::backend
            G("Resume Module"):::backend
            H("Storage Module"):::backend
            I("Translation Module"):::backend
            J("User Module"):::backend
        end
    end

    %% Shared Libraries
    subgraph "Shared Libraries"
        S1("DTOs"):::shared
        S2("Hooks"):::shared
        S3("Parser"):::shared
        S4("Schema/Validator"):::shared
        S5("UI Components"):::shared
        S6("Utility Functions"):::shared
    end

    %% Infrastructure & External Services
    subgraph "Infrastructure & External Services"
        DB("PostgreSQL (Prisma ORM)"):::external
        ST("Minio (Object Storage)"):::external
        BL("Browserless (Headless Chrome)"):::external
        SMTP("SMTP Server"):::external
        OAuth("OAuth Providers"):::external
        AI("OpenAI"):::external
        LOC("Localization (LinguiJS/Crowdin)"):::external
        DEP("Deployment Tools (Docker & Compose)"):::external
    end

    %% Connections between Frontend and Backend
    FE1 -->|"callsAPIs"| BE
    FE2 -->|"callsAPIs"| BE

    %% Backend includes its Modules
    BE -->|"includes"| A
    BE -->|"includes"| B
    BE -->|"includes"| C
    BE -->|"includes"| D
    BE -->|"includes"| E
    BE -->|"includes"| F
    BE -->|"includes"| G
    BE -->|"includes"| H
    BE -->|"includes"| I
    BE -->|"includes"| J

    %% Usage of Shared Libraries by Frontend and Backend
    FE1 -->|"uses"| S1
    FE1 -->|"uses"| S2
    FE1 -->|"uses"| S5
    FE1 -->|"uses"| S6
    BE -->|"uses"| S1
    BE -->|"uses"| S3
    BE -->|"uses"| S4
    BE -->|"uses"| S6

    %% Backend External Integrations
    BE -->|"dataAccess"| DB
    BE -->|"storesIn"| ST
    BE -->|"PDFGeneration"| BL
    BE -->|"sendsEmailsVia"| SMTP
    BE -->|"thirdPartyAuth"| OAuth
    BE -->|"contentEnhancement"| AI
    BE -->|"translation"| LOC

    %% Deployment connections
    FE1 -->|"deployedVia"| DEP
    FE2 -->|"deployedVia"| DEP
    BE  -->|"deployedVia"| DEP

    %% Click Events for Component Mapping
    click FE1 "https://github.com/amruthpillai/reactive-resume/tree/main/apps/client"
    click FE2 "https://github.com/amruthpillai/reactive-resume/tree/main/apps/artboard"
    click BE "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server"
    click A "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/auth"
    click B "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/contributors"
    click C "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/feature"
    click D "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/health"
    click E "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/mail"
    click F "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/printer"
    click G "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/resume"
    click H "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/storage"
    click I "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/translation"
    click J "https://github.com/amruthpillai/reactive-resume/tree/main/apps/server/src/user"
    click S1 "https://github.com/amruthpillai/reactive-resume/tree/main/libs/dto"
    click S2 "https://github.com/amruthpillai/reactive-resume/tree/main/libs/hooks"
    click S3 "https://github.com/amruthpillai/reactive-resume/tree/main/libs/parser"
    click S4 "https://github.com/amruthpillai/reactive-resume/tree/main/libs/schema"
    click S5 "https://github.com/amruthpillai/reactive-resume/tree/main/libs/ui"
    click S6 "https://github.com/amruthpillai/reactive-resume/tree/main/libs/utils"
    click DEP "https://github.com/amruthpillai/reactive-resume/tree/main/tools/compose"
    click DB "https://github.com/amruthpillai/reactive-resume/blob/main/tools/prisma/schema.prisma"

    %% Styles
    classDef frontend fill:#f8e1ff,stroke:#333,stroke-width:2px;
    classDef backend fill:#d1e8ff,stroke:#333,stroke-width:2px;
    classDef shared fill:#e8ffd1,stroke:#333,stroke-width:2px;
    classDef external fill:#ffe1d1,stroke:#333,stroke-width:2px;
```
