# xprss/vividi architecture

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

- Interactive diagram: https://gitdiagram.com/xprss/vividi
- Repository: https://github.com/xprss/vividi

## Overview

##### Main Components
- Frontend Component:
- Located in the "frontend" directory.
- Built with Angular (files like angular.json, app.module.ts, and components).
- Responsible for the user interface, routing, and interacting with backend APIs.
- Backend Component:
- Found in the "backend" directory.
- Built using NestJS, as evidenced by the structure (src/app.module.ts, controllers, modules for “user” and “vibe”).
- Handles API endpoints, business logic, and data processing.
- Database & Data Migration:
- The “migrations” directory suggests that a database is managed via migration scripts (e.g., create-user.json).
- Although the type of database isn’t explicitly shown, this component is essential for storing user data, vibes, and celebration records.
- Deployment & Containerization:
- Dockerfiles located in both the "backend" and "frontend" directories together with the root-level docker-compose.yaml indicate containerized deployments.
- CI/CD Pipeline:
- The ".github/workflows" folder contains build and release workflows, which show how the project is set up for automated testing and deployment.

##### Relationships & Interactions
- Frontend ↔ Backend:
- The Angular frontend communicates with the NestJS backend via HTTP/REST API calls.
- Backend ↔ Database:
- The backend components (controllers and services in user and vibe modules) interact with the database to handle CRUD operations.
- CI/CD System ↔ Codebase:
- GitHub Actions defined in the workflows automatically build, test, and deploy the application containers.
- Container Orchestration:
- The docker-compose file ties together the frontend, backend, and database components in a cohesive deployment environment.

##### Architectural Patterns & Key Design Principles
- Modularization:
- Both frontend and backend are built in a modular fashion. The backend uses NestJS modules (like user and vibe modules) for separation of concerns.
- The frontend has structured components and routing configurations.
- Separation of Concerns:
- Clear boundaries exist between the presentation layer (Angular) and the service layer (NestJS) ensuring maintainability.
- Containerization & CI/CD:
- Using Docker and GitHub Actions, the project ensures consistent deployment environments and streamlined continuous integration and delivery.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Presentation Layer"
        FE["Frontend (Angular)"]:::frontend
    end

    subgraph "Business Logic / API Layer"
        BE["Backend (NestJS – User & Vibe Modules)"]:::backend
        UserModule["User Module"]:::backendsub
        VibeModule["Vibe Module"]:::backendsub
        BE -->|"contains"| UserModule
        BE -->|"contains"| VibeModule
    end

    subgraph "Data Layer"
        DB["Database & Migrations"]:::database
    end

    subgraph "Deployment & CI/CD"
        DC["Containerization (Docker Compose)"]:::docker
        CICD["CI/CD (GitHub Actions)"]:::cicd
    end

    FE -->|"HTTP_API"| BE
    BE -->|"CRUD_Operations"| DB
    CICD -->|"Automated_Build_Deploy"| DC
    DC -->|"Starts_Containers"| FE
    DC -->|"Starts_Containers"| BE

    click FE "https://github.com/xprss/vividi/tree/master/frontend/"
    click BE "https://github.com/xprss/vividi/tree/master/backend/"
    click DB "https://github.com/xprss/vividi/tree/master/migrations/"
    click DC "https://github.com/xprss/vividi/blob/master/docker-compose.yaml"
    click CICD "https://github.com/xprss/vividi/tree/master/.github/workflows/"

    classDef frontend fill:#8FBC8F,stroke:#333,stroke-width:2px;
    classDef backend fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef backendsub fill:#87CEFA,stroke:#333,stroke-width:1px;
    classDef database fill:#D3D3D3,stroke:#333,stroke-width:2px;
    classDef docker fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef cicd fill:#FFA500,stroke:#333,stroke-width:2px;
```
