# machadop1407/fullstack-course architecture

> Architecture diagram of the GitHub repository machadop1407/fullstack-course, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/machadop1407/fullstack-course
- Repository: https://github.com/machadop1407/fullstack-course

## Overview

This is a small Express posts API. A client sends requests to the server, which mounts the posts router; that router lists or creates posts through Sequelize, and returns JSON responses. At startup the server initializes the model registry, synchronizes the schema, and begins listening. The excerpts show Sequelize configured from a config file and a MySQL driver dependency, but do not show the config contents or database connection behavior, so the database link is marked unverified.

Main entry points: [`server/models/index.js`](https://github.com/machadop1407/fullstack-course/blob/main/server/models/index.js) (Model Registry), [`server/index.js`](https://github.com/machadop1407/fullstack-course/blob/main/server/index.js) (Express Server), [`server/routes/Posts.js`](https://github.com/machadop1407/fullstack-course/blob/main/server/routes/Posts.js) (Posts Router), [`server/models/Posts.js`](https://github.com/machadop1407/fullstack-course/blob/main/server/models/Posts.js) (Posts Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_server["Express Server<br/>[index.js]"]
  node_posts_route["Posts Router<br/>[Posts.js]"]
end

subgraph group_data["Posts Data"]
  node_registry["Model Registry<br/>[index.js]"]
  node_post_model["Posts Model<br/>[Posts.js]"]
  node_config["DB Config<br/>[config.json]"]
end

node_client(("API Client"))
node_sql_db[("SQL Database")]

node_client -->|"sends requests"| node_server
node_server -->|"mounts /posts"| node_posts_route
node_server -->|"initializes models"| node_registry
node_server -->|"syncs schema"| node_registry
node_posts_route -->|"loads models"| node_registry
node_registry -->|"loads model"| node_post_model
node_posts_route -->|"queries or creates"| node_post_model
node_posts_route -->|"returns JSON"| node_client
node_registry -->|"reads settings"| node_config
node_registry -.->|"connects to"| node_sql_db

click node_server "https://github.com/machadop1407/fullstack-course/blob/main/server/index.js"
click node_posts_route "https://github.com/machadop1407/fullstack-course/blob/main/server/routes/Posts.js"
click node_registry "https://github.com/machadop1407/fullstack-course/blob/main/server/models/index.js"
click node_post_model "https://github.com/machadop1407/fullstack-course/blob/main/server/models/Posts.js"
click node_config "https://github.com/machadop1407/fullstack-course/blob/main/server/config/config.json"

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_server,node_posts_route,node_client toneBlue
class node_registry,node_post_model,node_config,node_sql_db toneAmber
```

## Components

### HTTP API

- [Express Server](https://github.com/machadop1407/fullstack-course/blob/main/server/index.js): `server/index.js`
- [Posts Router](https://github.com/machadop1407/fullstack-course/blob/main/server/routes/Posts.js): `server/routes/Posts.js`

### Posts Data

- [Model Registry](https://github.com/machadop1407/fullstack-course/blob/main/server/models/index.js): `server/models/index.js`
- [Posts Model](https://github.com/machadop1407/fullstack-course/blob/main/server/models/Posts.js): `server/models/Posts.js`
- [DB Config](https://github.com/machadop1407/fullstack-course/blob/main/server/config/config.json): `server/config/config.json`

### Other components

- **API Client**
- **SQL Database**

## Connections

- API Client → Express Server: sends requests
- Express Server → Posts Router: mounts /posts (evidence: `server/index.js`)
- Express Server → Model Registry: initializes models (evidence: `server/index.js`)
- Express Server → Model Registry: syncs schema (evidence: `server/index.js`)
- Posts Router → Model Registry: loads models (evidence: `server/routes/Posts.js`)
- Model Registry → Posts Model: loads model (evidence: `server/models/index.js`)
- Posts Router → Posts Model: queries or creates (evidence: `server/routes/Posts.js`)
- Posts Router → API Client: returns JSON (evidence: `server/routes/Posts.js`)
- Model Registry → DB Config: reads settings (evidence: `server/models/index.js`)
- Model Registry → SQL Database: connects to
