# b0llu/stormkeep architecture

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

- Interactive diagram: https://gitdiagram.com/b0llu/stormkeep
- Repository: https://github.com/b0llu/stormkeep

## Overview

##### Project type and purpose
- This is a full-stack web application bootstrapped with Create React App for the frontend and a small Node/Express backend living in `src/backend`.
- Its features include user authentication (`AuthController.js`), CRUD operations on notes (`NotesController.js`), and an archive feature (`ArchiveController.js`).

##### File structure
- Top-level:
- `public/` – static assets and the HTML entry point for the React SPA
- `src/` – application code
– `App.js`, `index.js` – React entry points
– `backend/` – Node/Express server
· `controllers/` – MVC controllers for archive, auth, notes
· `db/` – user (and presumably notes) data store modules
· `utils/` – authentication helpers
– `server.js` – bootstraps the Express server
- Configuration: `package.json` (frontend & backend dependencies), `.gitignore`

##### Extract insights from the README
- Standard CRA commands (`yarn start`, `yarn build`)

##### Elements
- Static asset delivery → Browser
- API calls → Controllers → DB → Controllers → Browser
- Blue rectangles for compute components (Browser, Node/Express)

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Web Browser"]:::compute

    subgraph "Static Asset Server / Public"
        PubDir["public/"]:::compute
        HTML["index.html"]:::compute
        Manifest["manifest.json"]:::compute
        Robots["robots.txt"]:::compute
    end

    Browser -->|"Fetch static assets"| PubDir

    subgraph "React SPA"
        IndexJS["index.js"]:::compute
        AppJS["App.js"]:::compute
        AppCSS["App.css"]:::compute
        IndexCSS["index.css"]:::compute
    end

    PubDir -->|"Serves bundles"| IndexJS
    IndexJS -->|"API calls (HTTP/REST)"| Express

    subgraph "Backend"
        Express["Express Server (server.js)"]:::compute
        subgraph "Controllers"
            AuthCtrl["AuthController.js"]:::compute
            NotesCtrl["NotesController.js"]:::compute
            ArchiveCtrl["ArchiveController.js"]:::compute
        end
        AuthUtils["authUtils.js"]:::compute
        UsersDB["User & Notes Store"]:::data
    end

    Express --> AuthCtrl
    Express --> NotesCtrl
    Express --> ArchiveCtrl

    AuthCtrl --> AuthUtils
    AuthCtrl --> UsersDB
    NotesCtrl --> UsersDB
    ArchiveCtrl --> UsersDB

    classDef compute fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef data fill:#90EE90,stroke:#333,stroke-width:1px

    click IndexJS "https://github.com/b0llu/stormkeep/blob/main/src/index.js"
    click AppJS "https://github.com/b0llu/stormkeep/blob/main/src/App.js"
    click AppCSS "https://github.com/b0llu/stormkeep/blob/main/src/App.css"
    click IndexCSS "https://github.com/b0llu/stormkeep/blob/main/src/index.css"
    click PubDir "https://github.com/b0llu/stormkeep/tree/main/public/"
    click HTML "https://github.com/b0llu/stormkeep/blob/main/public/index.html"
    click Manifest "https://github.com/b0llu/stormkeep/blob/main/public/manifest.json"
    click Robots "https://github.com/b0llu/stormkeep/blob/main/public/robots.txt"
    click Express "https://github.com/b0llu/stormkeep/blob/main/src/server.js"
    click AuthCtrl "https://github.com/b0llu/stormkeep/blob/main/src/backend/controllers/AuthController.js"
    click NotesCtrl "https://github.com/b0llu/stormkeep/blob/main/src/backend/controllers/NotesController.js"
    click ArchiveCtrl "https://github.com/b0llu/stormkeep/blob/main/src/backend/controllers/ArchiveController.js"
    click AuthUtils "https://github.com/b0llu/stormkeep/blob/main/src/backend/utils/authUtils.js"
    click UsersDB "https://github.com/b0llu/stormkeep/blob/main/src/backend/db/users.js"
```
