# phanng0605/linkedintu architecture

> Architecture diagram of the GitHub repository phanng0605/linkedintu, 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/phanng0605/linkedintu
- Repository: https://github.com/phanng0605/linkedintu

## Overview

##### Main Components
- Web Frontend: Built using Next.js (React) located in apps/web-frontend. It contains pages, components, UI libraries, and static assets.
- Node API (Optional): An Express (or similar) backend found under apps/node-api that provides additional API functionality if needed.
- AI API: A FastAPI service under apps/ai-api dedicated to AI/ML functions, training pipelines, resume analysis, and related data processing. It encapsulates the AI logic, including modules for data augmentation, model fine-tuning, and text parsing.
- Shared Packages: Although the file tree provided does not explicitly show them, the README indicates that shared utilities (shared-utils) and shared UI components (shared-ui) exist to be used by both frontend and other services.
- Supporting Elements: This category includes CI/CD and deployment scripts (scripts folder) and documentation (docs folder).

##### Relationships and Interactions
- The Web Frontend interacts with the backends via API calls:
– It communicates directly with the AI API (FastAPI) for machine learning functionalities.
– It may call the Node API (if deployed) for additional non-AI REST endpoints.
- Shared packages are referenced as libraries in the Web Frontend and potentially within the APIs, ensuring consistency across the codebase.
- The services themselves (Next.js, Node/Express, and FastAPI) run independently but are linked together using a workspace manager (like Yarn or PNPM) based on the monorepo structure.
- CI/CD scripts and configuration files manage building, testing, and deployment across these components.

##### Architectural Patterns and Design Principles
- Modularity: The monorepo is structured to keep applications independent (each in its own app folder) and promotes code reuse through shared packages.
- Separation of Concerns: Each service handles its own domain (frontend UI, backend API logic, AI/ML processing).
- Microservices-like Elements: Even though this is a monorepo, the different services (Next.js, Node, and FastAPI) operate like loosely coupled services.
- Clear Service Boundaries: Data flows among these services via defined API endpoints, making the separation clear.

##### Relevant Technologies and Frameworks
- Next.js (React) – for the frontend.
- Node.js/Express (optional) – for additional backend API services.
- FastAPI (Python) – powering AI/ML endpoints, training pipelines, and data processing.
- Additional tools: Uvicorn (ASGI server for FastAPI), Yarn/PNPM for dependency management, and shared packages in JavaScript/TypeScript for utility functions and UI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Applications"
        FE["Next.js Web Frontend (port 3000)"]:::frontend
        NA["Node API (port 5000)"]:::backend
        AI["FastAPI AI Service (port 8000)"]:::backend
    end

    subgraph "Shared Resources"
        SP["Shared Packages"]:::shared
    end

    subgraph "Support Elements"
        CI["CI/CD Scripts"]:::support
        DC["Documentation"]:::support
    end

    %% API Call Relationships
    FE -->|"calls"| AI
    FE -->|"calls"| NA

    %% Dependency on Shared Packages
    FE -.->|"uses"| SP
    NA -.->|"uses"| SP
    AI -.->|"uses"| SP

    %% CI/CD Deployment Flow
    CI -->|"deploys"| FE
    CI -->|"deploys"| NA
    CI -->|"deploys"| AI

    %% Documentation Links
    DC -->|"describes"| FE
    DC -->|"describes"| NA
    DC -->|"describes"| AI

    %% Click Events
    click FE "https://github.com/phanng0605/linkedintu/tree/main/apps/web-frontend"
    click NA "https://github.com/phanng0605/linkedintu/tree/main/apps/node-api"
    click AI "https://github.com/phanng0605/linkedintu/tree/main/apps/ai-api"
    click CI "https://github.com/phanng0605/linkedintu/tree/main/scripts"
    click DC "https://github.com/phanng0605/linkedintu/tree/main/docs"

    %% Styles
    classDef frontend fill:#FFEEEE,stroke:#E91E63,stroke-width:2px;
    classDef backend fill:#E3F2FD,stroke:#2196F3,stroke-width:2px;
    classDef shared fill:#E8F5E9,stroke:#4CAF50,stroke-width:2px;
    classDef support fill:#FFF3E0,stroke:#FF9800,stroke-width:2px;
```
