# cloud-development-projects/proyecto_0 architecture

> Architecture diagram of the GitHub repository cloud-development-projects/proyecto_0, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cloud-development-projects/proyecto_0
- Repository: https://github.com/cloud-development-projects/proyecto_0

## Overview

##### Project type and purpose
- This is a full-stack web application (“Proyecto de Nivelación”) that exposes a REST API in Go (backend/) and a React-based single-page application (frontend/).
- It supports user authentication, and CRUD operations on categories and tasks, persisting data in a SQL database (db/).

##### File structure
Top level:
- backend/
– cmd/api/main.go → entrypoint for the HTTP server
– internal/
- http/ → middleware and router setup
- auth/ → JWT and password logic
- users/, categories/, tasks/ → each with handler.go, service.go, repository.go, model.go
- storage/ → file‐based storage helpers
- config/ → environment parsing
– Dockerfile & .dockerignore for containerizing the Go API
– env.example for environment variables
- db/
– 000_create_tables.sql, 001_data_dummy.sql — initial schema & seed data
- docker-compose.local.yml — orchestration for local dev (API, DB, optional volumes)
- frontend/
– public/ → static HTML, manifest, robots.txt, default images
– src/ → React entrypoint (index.js), App.js, styling
– package.json, Dockerfile for containerizing the client

##### README for additional insights
- The README simply lists the team members and high-level folder layout; it does not describe the technology stack explicitly, but the file tree reveals Go + React + SQL.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Zone
    subgraph "Frontend Zone"
        ReactSPA["React SPA"]:::frontend
        Index["Entry Point (index.js)"]:::frontend
        App["Main Component (App.js)"]:::frontend
        Assets["Static Assets"]:::frontend
    end

    ReactSPA --> Index
    ReactSPA --> App
    ReactSPA --> Assets

    %% Backend Zone
    subgraph "Backend Zone"
        APIEntrypoint["HTTP Server Entrypoint\n(main.go)"]:::backend
        RouterComp["Router\n(router.go)"]:::backend
        MiddlewareComp["Middleware\n(middleware.go)"]:::backend
        AuthJwt["JWT Logic\n(jwt.go)"]:::backend
        AuthPass["Password Logic\n(password.go)"]:::backend
        ConfigLoader["Config Loader\n(config.go)"]:::backend
        EnvExample["Env Example\n(env.example)"]:::backend
        GoMod["Go Modules\n(go.mod)"]:::backend
        GoSum["Go Sum\n(go.sum)"]:::backend
        Storage["File Storage Helpers\n(files.go)"]:::backend

        %% Users Domain
        UH["Users Handler\n(handler.go)"]:::backend
        US["Users Service\n(service.go)"]:::backend
        UR["Users Repository\n(repository.go)"]:::backend
        UM["Users Model\n(model.go)"]:::backend

        %% Categories Domain
        CH["Categories Handler\n(handler.go)"]:::backend
        CS["Categories Service\n(service.go)"]:::backend
        CR["Categories Repository\n(repository.go)"]:::backend
        CM["Categories Model\n(model.go)"]:::backend

        %% Tasks Domain
        TH["Tasks Handler\n(handler.go)"]:::backend
        TS["Tasks Service\n(service.go)"]:::backend
        TR["Tasks Repository\n(repository.go)"]:::backend
        TM["Tasks Model\n(model.go)"]:::backend
    end

    APIEntrypoint --> ConfigLoader
    APIEntrypoint --> EnvExample
    APIEntrypoint --> GoMod
    APIEntrypoint --> GoSum
    APIEntrypoint --> RouterComp
    RouterComp --> MiddlewareComp
    MiddlewareComp --> AuthJwt
    MiddlewareComp --> AuthPass

    RouterComp --> UH
    RouterComp --> CH
    RouterComp --> TH

    UH --> US --> UR --> SQLDB
    CH --> CS --> CR --> SQLDB
    TH --> TS --> TR --> SQLDB

    TS --> Storage

    %% Database Zone
    subgraph "Database Zone"
        SQLDB["SQL Database"]:::database
        Schema1["Create Tables\n(000_create_tables.sql)"]:::database
        Schema2["Seed Data\n(001_data_dummy.sql)"]:::database
    end

    SQLDB --> Schema1
    SQLDB --> Schema2

    %% Infrastructure Zone
    subgraph "Infrastructure"
        DockerCompose["Docker Compose\n(docker-compose.local.yml)"]:::infra
        BDockerfile["Backend Dockerfile"]:::infra
        BDockerignore["Backend .dockerignore"]:::infra
        FDockerfile["Frontend Dockerfile"]:::infra
        FGitignore["Frontend .gitignore"]:::infra
    end

    DockerCompose --> APIEntrypoint
    DockerCompose --> SQLDB
    DockerCompose --> ReactSPA
    DockerCompose --> FDockerfile
    DockerCompose --> BDockerfile

    %% Click Events
    click ReactSPA "https://github.com/cloud-development-projects/proyecto_0/tree/main/frontend/"
    click Index "https://github.com/cloud-development-projects/proyecto_0/blob/main/frontend/src/index.js"
    click App "https://github.com/cloud-development-projects/proyecto_0/blob/main/frontend/src/App.js"
    click Assets "https://github.com/cloud-development-projects/proyecto_0/tree/main/frontend/public/"
    click APIEntrypoint "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/cmd/api/main.go"
    click RouterComp "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/http/router.go"
    click MiddlewareComp "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/http/middleware.go"
    click AuthJwt "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/auth/jwt.go"
    click AuthPass "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/auth/password.go"
    click UH "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/users/handler.go"
    click US "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/users/service.go"
    click UR "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/users/repository.go"
    click UM "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/users/model.go"
    click CH "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/categories/handler.go"
    click CS "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/categories/service.go"
    click CR "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/categories/repository.go"
    click CM "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/categories/model.go"
    click TH "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/tasks/handler.go"
    click TS "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/tasks/service.go"
    click TR "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/tasks/repository.go"
    click TM "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/tasks/model.go"
    click Storage "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/storage/files.go"
    click ConfigLoader "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/internal/config/config.go"
    click EnvExample "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/env.example"
    click GoMod "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/go.mod"
    click GoSum "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/go.sum"
    click BDockerfile "https://github.com/cloud-development-projects/proyecto_0/tree/main/backend/Dockerfile"
    click BDockerignore "https://github.com/cloud-development-projects/proyecto_0/blob/main/backend/.dockerignore"
    click FDockerfile "https://github.com/cloud-development-projects/proyecto_0/tree/main/frontend/Dockerfile"
    click FGitignore "https://github.com/cloud-development-projects/proyecto_0/blob/main/frontend/.gitignore"
    click Schema1 "https://github.com/cloud-development-projects/proyecto_0/blob/main/db/000_create_tables.sql"
    click Schema2 "https://github.com/cloud-development-projects/proyecto_0/blob/main/db/001_data_dummy.sql"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef backend fill:#D0FFD8,stroke:#333,stroke-width:1px
    classDef database fill:#FFD8A8,stroke:#333,stroke-width:1px
    classDef infra fill:#EEEEEE,stroke:#333,stroke-width:1px
```
