# trojandonut/scrumflow architecture

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

- Interactive diagram: https://gitdiagram.com/trojandonut/scrumflow
- Repository: https://github.com/trojandonut/scrumflow

## Overview

##### Main Components
- Frontend: Represented by the “frontend” directory. This part uses React and Redux (as seen from the store configuration and React components/pages) to provide the user interface.
- Backend: Located in the “backend” directory. It’s built with Django and organized into modular apps such as users, projects, sprints, stories, and tasks. Note that each of these apps follows its own MVC/MVT structure (models, views, serializers, and sometimes migrations).
- API: The communication layer exposed by the Django REST Framework. This layer serves as the connection between the frontend and backend.
- Database: While not explicitly named in files, the migrations and Django configuration indicate an underlying relational database (SQLite by default or PostgreSQL if configured otherwise).
- Docker & Deployment: Docker-related files (Dockerfile.backend, Dockerfile.frontend, docker-compose.yml, docker-start.sh) show that the app is containerized. This highlights an infrastructure layer with multiple containers handling different parts of the application.

##### Establish Relationships and Data Flow
- Frontend (React) sends HTTP requests (using REST APIs) to the backend.
- The backend (Django) processes these requests managing authentication (JWT, two-factor authentication), user, project, sprint, user story, and task management.
- The backend communicates with the database (via Django ORM) to store and retrieve data.
- Docker Compose orchestrates the deployment by starting and linking containerized services (frontend and backend).

##### Architectural Patterns and Design Principles
- Modular Design: The Django backend uses separate apps (users, projects, sprints, stories, tasks) for clear separation of responsibilities.
- Component-Based UI: The React frontend organizes code into components, pages, and redux slices, ensuring reusability and maintainability.
- Containerization: The Dockerfiles and docker-compose setup denote a micro-services style deployment, even if both containers currently run as single services.
- RESTful Communication: The system relies on standardized API contracts to handle the client-server interaction.

##### Final Checklist
- Clear labels for each major component, such as “React Frontend”, “Django Backend”, “Users Service”, “Projects Service”, “Sprints Service”, “Stories Service”, “Tasks Service”, and “Database”.
- Optionally, include annotations for Docker setup (Dockerfiles, docker-compose) and integration points like the API documentation endpoint.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE["React Frontend"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE["Django Backend"]:::backend
        subgraph "Services"
            U["Users Service"]:::backend_service
            P["Projects Service"]:::backend_service
            S["Sprints Service"]:::backend_service
            ST["Stories Service"]:::backend_service
            T["Tasks Service"]:::backend_service
        end
        API["API Endpoints"]:::api
        M["ORM & Migrations"]:::backend_misc
    end

    %% Database Layer
    subgraph "Database Layer"
        DB["Database (SQLite/PostgreSQL)"]:::database
    end

    %% Deployment/Containerization
    subgraph "Deployment/Containerization"
        D["Docker & Deployment"]:::docker
        DF_BE["Dockerfile.backend"]:::docker_file
        DF_FE["Dockerfile.frontend"]:::docker_file
        DC["docker-compose.yml"]:::docker_file
        DS["docker-start.sh"]:::docker_file
        D --> DF_BE
        D --> DF_FE
        D --> DC
        D --> DS
    end

    %% Additional API Endpoints per App
    API_USER["API Users"]:::api
    API_PROJ["API Projects"]:::api
    API_SPRINT["API Sprints"]:::api
    API_STORY["API Stories"]:::api
    API_TASK["API Tasks"]:::api

    %% Connections between Backend components
    U -->|"exposes"| API
    P -->|"exposes"| API
    S -->|"exposes"| API
    ST -->|"exposes"| API
    T -->|"exposes"| API

    API --> API_USER
    API --> API_PROJ
    API --> API_SPRINT
    API --> API_STORY
    API --> API_TASK

    BE -->|"configures"| M
    M -->|"connects via ORM"| DB

    %% Connections between Frontend, Backend, and Deployment
    FE -->|"REST_API"| BE
    D --- FE
    D --- BE

    %% Styles
    classDef frontend fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef backend fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px;
    classDef backend_service fill:#a5d6a7,stroke:#1b5e20,stroke-width:2px;
    classDef backend_misc fill:#dcedc8,stroke:#33691e,stroke-width:2px;
    classDef api fill:#fff9c4,stroke:#f57f17,stroke-width:2px;
    classDef database fill:#ffe0b2,stroke:#e65100,stroke-width:2px;
    classDef docker fill:#e1bee7,stroke:#4a148c,stroke-width:2px;
    classDef docker_file fill:#ce93d8,stroke:#4a148c,stroke-width:2px;

    %% Click Events
    click FE "https://github.com/trojandonut/scrumflow/tree/main/frontend"
    click BE "https://github.com/trojandonut/scrumflow/tree/main/backend"
    click U "https://github.com/trojandonut/scrumflow/tree/main/backend/users"
    click P "https://github.com/trojandonut/scrumflow/tree/main/backend/projects"
    click S "https://github.com/trojandonut/scrumflow/tree/main/backend/sprints"
    click ST "https://github.com/trojandonut/scrumflow/tree/main/backend/stories"
    click T "https://github.com/trojandonut/scrumflow/tree/main/backend/tasks"
    click API "https://github.com/trojandonut/scrumflow/blob/main/backend/scrum_project/urls.py"
    click API_USER "https://github.com/trojandonut/scrumflow/blob/main/backend/users/urls.py"
    click API_PROJ "https://github.com/trojandonut/scrumflow/blob/main/backend/projects/urls.py"
    click API_SPRINT "https://github.com/trojandonut/scrumflow/blob/main/backend/sprints/urls.py"
    click API_STORY "https://github.com/trojandonut/scrumflow/blob/main/backend/stories/urls.py"
    click API_TASK "https://github.com/trojandonut/scrumflow/blob/main/backend/tasks/urls.py"
    click M "https://github.com/trojandonut/scrumflow/blob/main/backend/scrum_project/settings.py"
    click DF_BE "https://github.com/trojandonut/scrumflow/blob/main/Dockerfile.backend"
    click DF_FE "https://github.com/trojandonut/scrumflow/blob/main/Dockerfile.frontend"
    click DC "https://github.com/trojandonut/scrumflow/blob/main/docker-compose.yml"
    click DS "https://github.com/trojandonut/scrumflow/blob/main/docker-start.sh"
```
