# mdelgadouade/uade-2026-id2_tp architecture

> Architecture diagram of the GitHub repository mdelgadouade/uade-2026-id2_tp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mdelgadouade/uade-2026-id2_tp
- Repository: https://github.com/mdelgadouade/uade-2026-id2_tp

## Overview

1. **Repository purpose**
   - This is a small full-stack prototype for an academic NoSQL project.
   - The domain appears centered on **reports** (`Report.js`, `routes/reports.js`) and a simple visual frontend for interacting with that data.

2. **High-level architecture**
   - The system is split into three main boundaries:
     - **Frontend**: Vue/Vite single-page app
     - **Backend**: Node.js API service
     - **Database**: MongoDB, with an init script for seed/setup
   - The data flow is straightforward: **UI → API → MongoDB → API → UI**.

3. **Frontend subsystem**
   - Located under `frontend/`.
   - Built with **Vue 3 + Vite** (`App.vue`, `main.js`, `vite.config.js`).
   - The frontend is a lightweight presentation layer; the tree suggests a minimal prototype rather than a large component architecture.
   - `HelloWorld.vue` is present, which usually indicates starter/scaffold code or a simple demo screen.

4. **Backend subsystem**
   - Located under `backend/`.
   - Uses **Node.js** and is structured as a classic API layer with:
     - `src/index.js` as the application entry point
     - `src/routes/reports.js` for HTTP routing
     - `src/models/Report.js` for the MongoDB data model
     - `src/config/mongo.js` for database connection setup
   - This backend is responsible for business logic and persistence access, not UI rendering.

5. **API boundary**
   - The backend likely exposes one main resource family: **reports**.
   - `routes/reports.js` is the clear boundary between HTTP requests and domain/persistence logic.
   - The frontend should consume this API to list, create, or otherwise manage report records.

6. **Data layer**
   - MongoDB is the only persistent datastore visible in the tree.
   - The presence of a single model file suggests a compact document schema rather than a multi-entity relational design.
   - This fits the README’s NoSQL-focused coursework, where the prototype likely demonstrates why MongoDB is suitable for the dataset being analyzed.

7. **Initialization / seeding**
   - The `mongo-init/init.js` script indicates database bootstrap logic.
   - This is usually used to create initial collections, insert seed data, or configure the database when the container starts.
   - For an architecture diagram, this is a separate setup path into MongoDB, distinct from normal runtime traffic.

8. **Deployment and runtime packaging**
   - The repo includes a **root `Dockerfile`**, plus separate `Dockerfile`s for `backend` and `frontend`, and a `docker-compose.yml`.
   - This indicates the project is designed to run as containerized services with local orchestration.
   - In the diagram, Docker Compose should sit above the service boxes as the deployment coordinator.

9. **Technology boundaries that matter**
   - The frontend and backend are decoupled at the network level, which is important for the diagram: the browser talks to the API, not directly to MongoDB.
   - MongoDB is the only data store, so there is no separate cache, message broker, or SQL database in the visible architecture.
   - No auth, background workers, or third-party integrations are evident from the tree.

10. **Likely functional shape of the prototype**
   - The application seems to be a focused CRUD-style prototype around report data, likely used to demonstrate dataset handling and value-added analysis for the TP.
   - Based on the README, the project is meant to support an academic/business narrative around NoSQL, data exploitation, and a prototype of the proposed solution.

11. **How to draw the architecture diagram**
   - Show three main boxes: **Vue frontend**, **Node/Express backend**, and **MongoDB**.
   - Connect frontend to backend with HTTP/REST.
   - Connect backend to MongoDB through the Mongo connection module.
   - Add a separate **Mongo init/seed** path to the database.
   - Place **Docker Compose / Dockerfiles** around the system as the packaging and deployment layer.

Main entry points: [`backend/src/routes/reports.js`](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/routes/reports.js) (Report routes), [`docker-compose.yml`](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/docker-compose.yml) (Compose), [`frontend/src/App.vue`](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/frontend/src/App.vue) (Vue app), [`backend/src/config/mongo.js`](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/config/mongo.js) (Mongo config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Deployment"]
  node_compose["Compose<br/>orchestrator<br/>[docker-compose.yml]"]
  node_root_dockerfile["Root image<br/>container build"]
  node_frontend_dockerfile["UI image<br/>container build"]
  node_backend_dockerfile["API image<br/>container build"]
end

subgraph group_frontend["Frontend"]
  node_ui_app["Vue app<br/>spa<br/>[App.vue]"]
  node_ui_entry["Main entry<br/>bootstrap<br/>[main.js]"]
  node_ui_widget["Starter widget<br/>[HelloWorld.vue]"]
end

subgraph group_backend["Backend"]
  node_backend_entry["API entry<br/>server bootstrap<br/>[index.js]"]
  node_report_routes["Report routes<br/>http routes<br/>[reports.js]"]
  node_report_model["Report model<br/>document model<br/>[Report.js]"]
  node_mongo_config["Mongo config<br/>db config<br/>[mongo.js]"]
end

subgraph group_data["Data"]
  node_mongo_db[("MongoDB<br/>document database")]
  node_mongo_init["Init script<br/>bootstrap script<br/>[init.js]"]
end

node_compose -->|"builds"| node_frontend_dockerfile
node_compose -->|"builds"| node_backend_dockerfile
node_compose -->|"starts"| node_mongo_db
node_root_dockerfile -.->|"packages"| node_backend_dockerfile
node_root_dockerfile -.->|"packages"| node_frontend_dockerfile
node_ui_entry -->|"mounts"| node_ui_app
node_ui_app -.->|"uses"| node_ui_widget
node_ui_app -->|"HTTP/REST"| node_report_routes
node_backend_entry -->|"registers"| node_report_routes
node_report_routes -->|"uses"| node_report_model
node_report_routes -->|"queries"| node_mongo_config
node_mongo_config -->|"connects"| node_mongo_db
node_report_model -.->|"persists"| node_mongo_db
node_mongo_init -->|"seeds"| node_mongo_db
node_backend_entry -->|"loads"| node_mongo_config

click node_compose "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/docker-compose.yml"
click node_root_dockerfile "https://github.com/mdelgadouade/uade-2026-id2_tp/tree/main/Dockerfile"
click node_frontend_dockerfile "https://github.com/mdelgadouade/uade-2026-id2_tp/tree/main/frontend/Dockerfile"
click node_backend_dockerfile "https://github.com/mdelgadouade/uade-2026-id2_tp/tree/main/backend/Dockerfile"
click node_ui_app "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/frontend/src/App.vue"
click node_ui_entry "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/frontend/src/main.js"
click node_ui_widget "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/frontend/src/components/HelloWorld.vue"
click node_backend_entry "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/index.js"
click node_report_routes "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/routes/reports.js"
click node_report_model "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/models/Report.js"
click node_mongo_config "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/config/mongo.js"
click node_mongo_init "https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/mongo-init/init.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_compose,node_root_dockerfile,node_frontend_dockerfile,node_backend_dockerfile toneBlue
class node_ui_app,node_ui_entry,node_ui_widget toneAmber
class node_backend_entry,node_report_routes,node_report_model,node_mongo_config toneMint
class node_mongo_db,node_mongo_init toneRose
```

## Components

### Deployment

Container packaging and orchestration

- [Compose](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/docker-compose.yml): orchestrator · Starts and wires the containerized services · `docker-compose.yml`
- [Root image](https://github.com/mdelgadouade/uade-2026-id2_tp/tree/main/Dockerfile): container build · Top-level container build for the project · `Dockerfile`
- [UI image](https://github.com/mdelgadouade/uade-2026-id2_tp/tree/main/frontend/Dockerfile): container build · Frontend container build definition · `frontend/Dockerfile`
- [API image](https://github.com/mdelgadouade/uade-2026-id2_tp/tree/main/backend/Dockerfile): container build · Backend container build definition · `backend/Dockerfile`

### Frontend

Vue single-page client

- [Vue app](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/frontend/src/App.vue): spa · Main frontend application shell · `frontend/src/App.vue`
- [Main entry](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/frontend/src/main.js): bootstrap · Mounts the Vue app into the browser DOM · `frontend/src/main.js`
- [Starter widget](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/frontend/src/components/HelloWorld.vue): Scaffold component present in the client · `frontend/src/components/HelloWorld.vue`

### Backend

Node API and data access

- [API entry](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/index.js): server bootstrap · Starts the Node service · `backend/src/index.js`
- [Report routes](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/routes/reports.js): http routes · HTTP boundary for report operations · `backend/src/routes/reports.js`
- [Report model](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/models/Report.js): document model · MongoDB document shape for reports · `backend/src/models/Report.js`
- [Mongo config](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/backend/src/config/mongo.js): db config · Creates and manages the Mongo connection · `backend/src/config/mongo.js`

### Data

MongoDB runtime and bootstrap

- **MongoDB**: document database · Primary persistent datastore
- [Init script](https://github.com/mdelgadouade/uade-2026-id2_tp/blob/main/mongo-init/init.js): bootstrap script · Seeds or prepares the database at startup · `mongo-init/init.js`

## Connections

- Compose → UI image: builds · Compose uses the frontend image build
- Compose → API image: builds · Compose uses the backend image build
- Compose → MongoDB: starts · Compose orchestrates the database container
- Root image → API image: packages · Top-level build supports service packaging
- Root image → UI image: packages · Top-level build supports service packaging
- Main entry → Vue app: mounts · Browser bootstrap renders the Vue app
- Vue app → Starter widget: uses · The app includes the starter component
- Vue app → Report routes: HTTP/REST · Frontend consumes report endpoints
- API entry → Report routes: registers · Server bootstraps the HTTP routes
- Report routes → Report model: uses · Routes operate on the report document model
- Report routes → Mongo config: queries · Routes depend on the Mongo connection layer
- Mongo config → MongoDB: connects · Database connection targets MongoDB
- Report model → MongoDB: persists · Report documents are stored in MongoDB
- Init script → MongoDB: seeds · Initialization script prepares the database
- API entry → Mongo config: loads · Service startup wires database access
