# international-team-management/team-platform architecture

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

- Interactive diagram: https://gitdiagram.com/international-team-management/team-platform
- Repository: https://github.com/international-team-management/team-platform

## Overview

##### Main Components
- Frontend: Represented by the React application (located in the "frontend" directory). This component handles the user interface and interacts with the backend via REST APIs.
- Backend: A Django monolith (inside the "backend" directory) that contains several apps – for example, "api", "projects", and "users". It is responsible for REST API endpoints, business logic, authentication, and other server-side processing.
- Database: Although not a directory per se, the README indicates Postgres is used. Represent it as a separate component that the Django ORM communicates with.
- Infrastructure/Deployment layer: Includes Docker configurations, Docker Compose files (in the "infra" and "infra_local" directories) and NGINX configurations, which are used for container orchestration, load balancing, and reverse proxying.
- Continuous Integration / Deployment: Visible from the ".github/workflows" where GitHub Actions configurations are located.

##### Relationships and Interactions
- The Frontend sends HTTP requests (using RESTful API calls) to the Backend for data and functionality.
- The Backend serves these API endpoints and, in turn, interacts with the Postgres database for data storage and retrieval.
- NGINX (configured in the infra directories) acts as a reverse proxy by routing external requests to the backend (and possibly serving static frontend assets if configured).
- Docker containers encapsulate each of these services (frontend, backend, database, and reverse proxy), and Docker Compose helps manage the multi-container setup.
- GitHub Actions is used to automate testing, building, and deployment steps.

##### Architectural Patterns and Technologies
- MVC (or rather, a Model-View-Service pattern in Django’s design) is evident in the backend with separate modules for handling models, views, serializers, and services.
- Use of containerization (Docker) indicates a micro-deployment or at the very least an isolated deployment environment.
- REST API architecture is present as the interface between frontend and backend.
- The separation of concerns is clear: frontend client logic (UI/UX) is entirely decoupled from backend business services.
- The use of CI/CD pipelines with GitHub Actions underscores the importance of automated testing and seamless integration.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% CI/CD Pipeline
    CI["CI/CD (GitHub Actions)"]:::cicd

    %% Container Configurations (Docker & Infra Files)
    subgraph "Container Configurations"
        dFrontend["Dockerfile (Frontend)"]:::docker
        dBackend["Dockerfile (Backend)"]:::docker
        dBackendLocal["Dockerfile (Backend Local)"]:::docker
        prodCompose["Docker Compose (Prod)"]:::docker
        prodNginx["NGINX Config (Prod)"]:::docker
        localCompose["Docker Compose (Local)"]:::docker
        localNginx["NGINX Config (Local)"]:::docker
    end

    %% Deployment & Infrastructure Layer
    subgraph "Deployment & Infrastructure"
        NGINX["NGINX (Reverse Proxy)"]:::infra
    end

    %% Application Layers
    FE["Frontend (React.js)"]:::frontend

    subgraph "Backend Layer"
        BE["Backend (Django & DRF)"]:::backend
        API["API"]:::backend
        Projects["Projects"]:::backend
        Users["Users"]:::backend
    end

    DB["Database (Postgres)"]:::database

    %% Connections from CI/CD to Container Configurations
    CI --> dFrontend
    CI --> dBackend
    CI --> dBackendLocal
    CI --> prodCompose
    CI --> prodNginx
    CI --> localCompose
    CI --> localNginx

    %% Container Configurations feed into Infrastructure (NGINX)
    dFrontend --> NGINX
    dBackend --> NGINX
    dBackendLocal --> NGINX
    prodCompose --> NGINX
    prodNginx --> NGINX
    localCompose --> NGINX
    localNginx --> NGINX

    %% Application Flow
    FE -->|"REST_calls"| BE
    NGINX --> FE
    NGINX --> BE
    BE -->|"DB_Query"| DB

    %% Backend Internal Structure
    BE --> API
    BE --> Projects
    BE --> Users

    %% Click Events
    click FE "https://github.com/international-team-management/team-platform/tree/develop/frontend"
    click BE "https://github.com/international-team-management/team-platform/tree/develop/backend/itm_backend"
    click API "https://github.com/international-team-management/team-platform/tree/develop/backend/itm_backend/api"
    click Projects "https://github.com/international-team-management/team-platform/tree/develop/backend/itm_backend/projects"
    click Users "https://github.com/international-team-management/team-platform/tree/develop/backend/itm_backend/users"
    click dFrontend "https://github.com/international-team-management/team-platform/tree/develop/frontend/Dockerfile"
    click dBackend "https://github.com/international-team-management/team-platform/tree/develop/backend/Dockerfile"
    click dBackendLocal "https://github.com/international-team-management/team-platform/blob/develop/backend/Dockerfile.local"
    click prodCompose "https://github.com/international-team-management/team-platform/blob/develop/infra/docker-compose.yml"
    click prodNginx "https://github.com/international-team-management/team-platform/blob/develop/infra/nginx/nginx.conf"
    click localCompose "https://github.com/international-team-management/team-platform/blob/develop/infra_local/docker-compose.yml"
    click localNginx "https://github.com/international-team-management/team-platform/blob/develop/infra_local/nginx/nginx.local.conf"
    click CI "https://github.com/international-team-management/team-platform/blob/develop/.github/workflows/git-workflow.yml"

    %% Styles
    classDef cicd fill:#f9c,stroke:#333,stroke-width:2px;
    classDef docker fill:#ccf,stroke:#333,stroke-width:2px;
    classDef infra fill:#cfc,stroke:#333,stroke-width:2px;
    classDef frontend fill:#afa,stroke:#333,stroke-width:2px;
    classDef backend fill:#fea,stroke:#333,stroke-width:2px;
    classDef database fill:#fcc,stroke:#333,stroke-width:2px;
```
