# mmamorim/sdm-2025-1-manha architecture

> Architecture diagram of the GitHub repository mmamorim/sdm-2025-1-manha, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mmamorim/sdm-2025-1-manha
- Repository: https://github.com/mmamorim/sdm-2025-1-manha

## Overview

##### Project type and purpose
- This repository is a teaching-focused collection of JavaScript/Node.js exercises and small applications, organized by lesson (Aula01 through Aula10), culminating in simple HTTP/REST servers using Express and file-based JSON storage.
- It isn’t a single deployable product but a series of progressively complex client-and-server demos covering:
- Basic JS in browser (index.html + main.js)
- Modular JS (import/export)
- Node.js scripting and npm
- HTTP fundamentals
- Express-based REST API with CRUD operations on JSON files

##### File structure
- Top-level folders “Aula01_19FEV” through “Aula10_30Abr” each contain a standalone mini-project.
- Common patterns per lesson:
- Frontend: index.html, main.js
- Backend: server.js (Node.js/Express), package.json, package-lock.json
- Data: JSON files (db.json, banco.json)
- Modules: helper .js files (e.g. criptografia.js, sgdb.js, clapback.js)
- Final lessons introduce Express routes (GET/POST/PUT/DELETE) and a simple file-based datastore.

##### README for additional insights
- The README maps lessons to topics (JS basics → modularization → Node.js/npm → HTTP/APIs → Express → routes).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        FE1["Aula02_26FEV/index.html"]:::frontend
        FE2["Aula02_26FEV/main.js"]:::frontend
        FE3["Aula03_12Mar/index.html"]:::frontend
        FE4["Aula03_12Mar/main.js"]:::frontend
        FE5["Aula06_02Abr/index.html"]:::frontend
    end

    %% Server Layer
    subgraph "Express Server Layer"
        direction TB
        S6["Aula06_02Abr/server.js"]:::server
        S9["Aula09_23Abr/serverapp/server.js"]:::server
        S10["Aula10_30Abr/serverAula10/server.js"]:::server
    end

    %% Business Logic Modules
    subgraph "Business-Logic Modules"
        direction TB
        M4["Aula04_19Mar/projeto/criptografia.js"]:::module
        M7["Aula07_09Abr/sgdb.js"]:::module
        M9a["Aula09_23Abr/serverapp/clapback.js"]:::module
        M9b["Aula09_23Abr/clapback.js"]:::module
        M10["Aula10_30Abr/serverAula10/frutas_rota.js"]:::module
    end

    %% Data Store
    subgraph "Data Layer (JSON Datastore)"
        direction TB
        D9["Aula09_23Abr/serverapp/banco.json"]:::data
        D10["Aula10_30Abr/serverAula10/db.json"]:::data
    end

    %% npm Configuration
    subgraph "npm Configuration"
        direction TB
        P4["Aula04_19Mar/projeto/package.json"]:::config
        P6["Aula06_02Abr/package.json"]:::config
        P9["Aula09_23Abr/serverapp/package.json"]:::config
        P10["Aula10_30Abr/serverAula10/package.json"]:::config
    end

    %% Interactions
    FE1 -->|HTTP Request| S6
    FE2 -->|HTTP Request| S6
    FE3 -->|HTTP Request| S9
    FE4 -->|HTTP Request| S9
    FE5 -->|HTTP Request| S6

    S6 -->|uses| M4
    S6 -->|uses| M7
    S9 -->|uses| M9a
    S9 -->|uses| M9b
    S10 -->|uses| M10

    S9 -->|reads/writes| D9
    S10 -->|reads/writes| D10

    P4 -->|configures| S6
    P6 -->|configures| S6
    P9 -->|configures| S9
    P10 -->|configures| S10

    %% Click Events
    click FE1 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula02_26FEV/index.html"
    click FE2 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula02_26FEV/main.js"
    click FE3 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula03_12Mar/index.html"
    click FE4 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula03_12Mar/main.js"
    click FE5 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula06_02Abr/index.html"

    click S6 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula06_02Abr/server.js"
    click S9 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula09_23Abr/serverapp/server.js"
    click S10 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula10_30Abr/serverAula10/server.js"

    click M4 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula04_19Mar/projeto/criptografia.js"
    click M7 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula07_09Abr/sgdb.js"
    click M9a "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula09_23Abr/serverapp/clapback.js"
    click M9b "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula09_23Abr/clapback.js"
    click M10 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula10_30Abr/serverAula10/frutas_rota.js"

    click D9 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula09_23Abr/serverapp/banco.json"
    click D10 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula10_30Abr/serverAula10/db.json"

    click P4 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula04_19Mar/projeto/package.json"
    click P6 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula06_02Abr/package.json"
    click P9 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula09_23Abr/serverapp/package.json"
    click P10 "https://github.com/mmamorim/sdm-2025-1-manha/blob/main/Aula10_30Abr/serverAula10/package.json"

    %% Styles
    classDef frontend fill:#D0E6FA,stroke:#1E90FF,color:#000
    classDef server fill:#DFF2E1,stroke:#32CD32,color:#000
    classDef module fill:#FFF4C1,stroke:#FFD700,color:#000
    classDef data fill:#FFEFD5,stroke:#FFA500,color:#000
    classDef config fill:#F5E1F7,stroke:#DA70D6,color:#000
```
