# rckbrcls/portifolio architecture

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

- Interactive diagram: https://gitdiagram.com/rckbrcls/portifolio
- Repository: https://github.com/rckbrcls/portifolio

## Overview

##### Project Components Identification
- Macro Application: At the center is the “main” portfolio application (located in apps/main), which acts as the overarching container and navigation hub.
- Microfrontends: Each subdirectory under apps (like alan-turing, electoral-system, joystick, lojinha-simples, rgbwallet, secret-santa, video-project-manage) represents an independent microfrontend. They are developed using modern web technologies with variations like React, SolidJS, and even Next.js.
- Backend Services/APIs: Under services you find several API services (electoral-system-api, joystick-api, rgbwallet-api, secret-santa-api) which provide the necessary data and business logic. These services use various back-end technologies (e.g., Flask, Node.js) and have their own configuration files (Dockerfile, package.json, etc.).
- Shared Modules: There’s an underlying Turborepo configuration (via turbo.json and pnpm-workspace.yaml) that orchestrates the build, sharing of components, and utilities (such as those under SharedComponents and SharedUtils).

##### Analyzing Component Relationships and Data Flows
- For each microfrontend, indicate a connection to its corresponding backend API if present. For example, electoral-system (frontend) interacts with electoral-system-api (backend), joystick with joystick-api, rgbwallet with rgbwallet-api, and so on.
- Data flow from the frontends to the backend services. Use arrowheads (e.g., “Served by API1”, “Data from API2”, etc.) to represent how each microfrontend communicates with its respective API.

##### Notable Architectural Patterns and Design Principles
- Microfrontend Architecture: Emphasize how each project is isolated (deployed and built separately) yet hosted within the macro application.
- Monorepo Management with Turborepo: Indicate the role of Turborepo in managing shared components (e.g., SharedComponents and SharedUtils) and ensuring performance optimization across builds.
- Technology Heterogeneity: Note the mix of both React (and Next.js), SolidJS, TypeScript, and JavaScript, as well as backend frameworks (Flask and Node.js). This diversity is key to understanding how each part of the system is built.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Front-end Applications
    subgraph "Front-end Applications"
        MP["Portfolio Macro Application"]:::portfolio
        subgraph "Microfrontends"
            AT["alan-turing Microfrontend"]:::microfrontend
            ES["electoral-system Microfrontend"]:::microfrontend
            JS["joystick Microfrontend"]:::microfrontend
            LS["lojinha-simples Microfrontend"]:::microfrontend
            RW["rgbwallet Microfrontend"]:::microfrontend
            SS["secret-santa Microfrontend"]:::microfrontend
            VP["video-project-manage Microfrontend"]:::microfrontend
        end
    end

    %% Backend Services
    subgraph "Backend Services"
        ESA["electoral-system API Service"]:::backend
        JA["joystick API Service"]:::backend
        RWA["rgbwallet API Service"]:::backend
        SSA["secret-santa API Service"]:::backend
    end

    %% Shared Build Configuration
    SC["Turborepo & Shared Build Configuration"]:::shared

    %% Connections from Macro Application to Microfrontends
    MP -->|"navigates"| AT
    MP -->|"navigates"| ES
    MP -->|"navigates"| JS
    MP -->|"navigates"| LS
    MP -->|"navigates"| RW
    MP -->|"navigates"| SS
    MP -->|"navigates"| VP

    %% Connections from Shared Build Configuration to Microfrontends and Macro Application
    SC -->|"Shared_Build_Process"| MP
    SC -->|"Shared_Build_Process"| AT
    SC -->|"Shared_Build_Process"| ES
    SC -->|"Shared_Build_Process"| JS
    SC -->|"Shared_Build_Process"| LS
    SC -->|"Shared_Build_Process"| RW
    SC -->|"Shared_Build_Process"| SS
    SC -->|"Shared_Build_Process"| VP

    %% Connections between Microfrontends and their corresponding Backend Services
    ES -->|"HTTP_Request"| ESA
    ESA -->|"Data_Flow"| ES

    JS -->|"HTTP_Request"| JA
    JA -->|"Data_Flow"| JS

    RW -->|"HTTP_Request"| RWA
    RWA -->|"Data_Flow"| RW

    SS -->|"HTTP_Request"| SSA
    SSA -->|"Data_Flow"| SS

    %% Class definitions for color coding
    classDef portfolio fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef microfrontend fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef shared fill:#FFB6C1,stroke:#333,stroke-width:2px;

    %% Click Events for Components
    click MP "https://github.com/rckbrcls/portifolio/tree/main/apps/main"
    click AT "https://github.com/rckbrcls/portifolio/tree/main/apps/alan-turing"
    click ES "https://github.com/rckbrcls/portifolio/tree/main/apps/electoral-system"
    click JS "https://github.com/rckbrcls/portifolio/tree/main/apps/joystick"
    click LS "https://github.com/rckbrcls/portifolio/tree/main/apps/lojinha-simples"
    click RW "https://github.com/rckbrcls/portifolio/tree/main/apps/rgbwallet"
    click SS "https://github.com/rckbrcls/portifolio/tree/main/apps/secret-santa"
    click VP "https://github.com/rckbrcls/portifolio/tree/main/apps/video-project-manage"
    click ESA "https://github.com/rckbrcls/portifolio/tree/main/services/electoral-system-api"
    click JA "https://github.com/rckbrcls/portifolio/tree/main/services/joystick-api"
    click RWA "https://github.com/rckbrcls/portifolio/tree/main/services/rgbwallet-api"
    click SSA "https://github.com/rckbrcls/portifolio/tree/main/services/secret-santa-api"
    click SC "https://github.com/rckbrcls/portifolio/blob/main/turbo.json and pnpm-workspace.yaml"
```
