# roshan-24/trinit_olu-squad_dev02 architecture

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

- Interactive diagram: https://gitdiagram.com/roshan-24/trinit_olu-squad_dev02
- Repository: https://github.com/roshan-24/trinit_olu-squad_dev02

## Overview

##### Main Components
- API Server (Backend):
- Contains directories such as “apps/api/src” that include controllers, routers, validators, configuration files (prismaClient.js), and authentication (auth strategies and controllers).
- Uses Prisma for ORM/database interaction (with migrations and schema defined under “apps/api/prisma”).
- Frontend Application:
- Located under “apps/frontend/src”, built with React. Contains pages, components (e.g., forms for login/registration, organization and project management, a Kanban board), and configuration (routing and axios for API calls).
- Database:
- PostgreSQL is used as the persistent data store, driven by Prisma migrations.
- External Services / Environment:
- Dependencies include Node.js and integration with a PostgreSQL server.
- Development Tools & Configurations:
- Contains configuration files, Git hooks (.husky, lint-staged), and workspace management (yarn workspaces indicated by root-level package.json and Yarn commands).

##### Relationships and Interactions
- The Frontend interacts with the API Server via RESTful endpoints (evident from distinct routers and controllers under “apps/api/src/routers” and “apps/api/src/controllers”).
- The API Server communicates with the PostgreSQL database by leveraging Prisma as the ORM, synchronizing schema and managing migrations.
- Authentication flows (using JWT and a local strategy) that cross-connect the API and frontend.
- Development tooling ensures code quality and proper formatting, though these are peripheral to the core system design.

##### Architectural Patterns
- Separation of Concerns: The project cleanly separates the frontend client from the backend API.
- MVC Elements: Although not a strict implementation, the controllers, routers, and validators in the API suggest an MVC-inspired pattern.
- Monorepo Structure: Both the API and frontend are managed within a single repository to streamline dependency management and development.
- ORM/Data Abstraction: Prisma serves as the abstraction layer for database interactions.

## Diagram (Mermaid)

```mermaid
graph TD
    FE["React Frontend"]:::frontend
    subgraph "Backend API"
        Backend["Node.js API Server"]:::backend
        Routers["Routers"]:::backend
        Controllers["Controllers"]:::backend
        AuthStrategies["Auth Strategies"]:::auth
        AuthController["Auth Controller"]:::auth
        AuthValidator["Auth Validator"]:::auth
        PrismaSchema["Prisma ORM Schema"]:::prisma
        PrismaConfig["Prisma Client Config"]:::prisma
    end
    DB["PostgreSQL Database"]:::database

    FE -->|"REST_API_calls"| Backend
    Backend -->|"routes_to"| Routers
    Routers -->|"calls"| Controllers
    Controllers -->|"handles"| AuthController
    Controllers -->|"validates"| AuthValidator
    AuthStrategies -->|"integrates_with"| AuthController
    Backend -->|"uses"| PrismaSchema
    PrismaSchema -->|"configures"| PrismaConfig
    PrismaConfig -->|"queries"| DB

    click FE "https://github.com/roshan-24/trinit_olu-squad_dev02/tree/main/apps/frontend/src"
    click Backend "https://github.com/roshan-24/trinit_olu-squad_dev02/tree/main/apps/api/src"
    click Routers "https://github.com/roshan-24/trinit_olu-squad_dev02/tree/main/apps/api/src/routers"
    click Controllers "https://github.com/roshan-24/trinit_olu-squad_dev02/tree/main/apps/api/src/controllers"
    click AuthStrategies "https://github.com/roshan-24/trinit_olu-squad_dev02/tree/main/apps/api/src/auth"
    click AuthController "https://github.com/roshan-24/trinit_olu-squad_dev02/blob/main/apps/api/src/controllers/authController.js"
    click AuthValidator "https://github.com/roshan-24/trinit_olu-squad_dev02/blob/main/apps/api/src/validators/authValidator.js"
    click PrismaSchema "https://github.com/roshan-24/trinit_olu-squad_dev02/tree/main/apps/api/prisma"
    click PrismaConfig "https://github.com/roshan-24/trinit_olu-squad_dev02/blob/main/apps/api/src/config/prismaClient.js"

    classDef frontend fill:#ffefc6,stroke:#b58900,stroke-width:2px;
    classDef backend fill:#c6e2ff,stroke:#268bd2,stroke-width:2px;
    classDef auth fill:#d0f0c0,stroke:#2aa198,stroke-width:2px;
    classDef prisma fill:#f6d6ad,stroke:#dc322f,stroke-width:2px;
    classDef database fill:#e0ffd6,stroke:#859900,stroke-width:2px;
```
