# rcln/cartographies.sonores architecture

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

- Interactive diagram: https://gitdiagram.com/rcln/cartographies.sonores
- Repository: https://github.com/rcln/cartographies.sonores

## Overview

1. **What this repo is**
   - `cartographies.sonores` is a Node.js application backed by MySQL for browsing “geographic and sound landscapes” of world languages.
   - The app has a server-side layer, a data-loading path, and a client-side UI built from source modules in `src/` and bundled outputs in `public/js/`.

2. **Runtime and deployment shape**
   - The runtime is classic Node.js on the server, with MySQL as the persistent store.
   - `README.md` shows it is configured via `config.json` for DB credentials and server port/path, and launched with `node index.js`.
   - The app is intended to be served under a path prefix such as `/cartographies/`, which matters for routing and asset URLs.

3. **Server entrypoint and configuration boundary**
   - `index.js` is the main application entrypoint.
   - `config.js` and `config.json.example` suggest runtime configuration is separated from code, including DB connection settings and server path/port.
   - `db.js` is the DB access boundary, isolating MySQL interaction from the rest of the application.

4. **Persistence layer**
   - MySQL is the authoritative source of application data.
   - The README describes importing a backup SQL dump into the database, and the repo includes `fixtures/cartographies.sql` plus YAML fixture data for authors and languages.
   - This indicates the system is data-driven: language metadata and related content are loaded into MySQL and then read by the app.

5. **Data initialization and migration-like workflow**
   - `load_fixtures.js` is the top-level data bootstrap script used after dependency installation.
   - The `fixtures/` directory contains scripts and structured data for seeding the database, including `load_fixtures.py`, `test.py`, `authors.yml`, and `languages.yml`.
   - This is a separate operational path from the running app: one path builds/loads data, the other serves the site.

6. **Client-side application architecture**
   - The `src/` directory contains the original frontend source modules: `app.js`, `actions.js`, `dispatcher.js`, `store.js`, `list.js`, `details.js`, and `map.js`.
   - This strongly suggests a Flux-style architecture: actions flow through a dispatcher into a store, and UI modules consume store state.
   - The same modules appear compiled into `public/js/`, along with source maps, so the deployed frontend is the compiled/bundled output.

7. **UI subsystem responsibilities**
   - `list.js`, `details.js`, and `map.js` likely represent the major user-facing views: browsing language lists, inspecting a selected language, and visualizing geographic locations.
   - `actions.js`, `dispatcher.js`, and `store.js` separate user interaction and application state from presentation.
   - `app.js` is likely the composition root for the client app, wiring the views together.

8. **Server-to-client boundary**
   - The server renders or serves HTML shells from `views/base.html` and `views/languages.html`.
   - The browser then loads CSS, JS, audio, thumbnails, and images from `public/`, which implies a hybrid app shell plus client-side interactivity.
   - Data likely crosses the boundary as server-rendered page context and/or JSON fetched by the frontend from server endpoints.

9. **Static and media assets**
   - `public/css/` contains base styles and table/responsiveness styles; `public/dashgum/` contains a full third-party admin/theme asset bundle including Bootstrap and Font Awesome.
   - `public/audio/` holds many MP3 files, and `public/images/` / `public/thumbnails/` hold language-specific imagery.
   - These assets are core to the experience: the UI is not just text/data but includes sound clips and visual geography/media.

10. **Build/tooling characteristics**
    - `Gruntfile.js` plus `bower.json` indicate legacy frontend build/tooling and browser asset management.
    - The presence of source maps in `public/js/*.map` implies a build step transforms `src/` into distributable browser assets.
    - This repo therefore has two “build” concerns: client asset compilation and database fixture loading.

11. **Operational dependencies**
    - The app depends on MySQL being installed and accessible locally, and the README notes a specific Node/Python setup for npm dependencies and fixture loading.
    - `config.json` includes a Unix socket path, so local deployment is expected to use a local MySQL instance rather than a remote managed service.
    - That makes the deployment boundary simple: Node server + MySQL + static assets on disk.

12. **High-level data flow**
    - Seed data is loaded into MySQL via fixtures/import scripts.
    - The Node server reads from MySQL through `db.js` and serves HTML/pages plus any data endpoints.
    - The browser loads the app shell and compiled JS, then the Flux-like frontend updates state and renders language lists, details, maps, and associated media.

13. **Main architectural boundaries to draw**
    - **Persistence boundary:** MySQL and fixture/import scripts.
    - **Server boundary:** `index.js`, `config.js`, `db.js`, and HTML templates.
    - **Client application boundary:** compiled JS in `public/js/` backed by source in `src/`.
    - **Asset boundary:** static CSS, images, thumbnails, audio, and theme resources in `public/`.

Main entry points: [`src/actions.js`](https://github.com/rcln/cartographies.sonores/blob/master/src/actions.js) (Actions), [`index.js`](https://github.com/rcln/cartographies.sonores/blob/master/index.js) (App entry), [`views/base.html`](https://github.com/rcln/cartographies.sonores/blob/master/views/base.html) (Base shell), [`src/store.js`](https://github.com/rcln/cartographies.sonores/blob/master/src/store.js) (Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server"]
  node_index_js["App entry<br/>node entry<br/>[index.js]"]
  node_config_js["Config<br/>[config.js]"]
  node_db_js[("DB layer<br/>mysql access<br/>[db.js]")]
  node_views_base["Base shell<br/>html template<br/>[base.html]"]
  node_views_languages["Languages page<br/>html template<br/>[languages.html]"]
end

subgraph group_client["Client"]
  node_src_app["Client app<br/>ui composition<br/>[app.js]"]
  node_src_actions["Actions<br/>[actions.js]"]
  node_src_dispatcher(("Dispatcher<br/>[dispatcher.js]"))
  node_src_store[("Store<br/>[store.js]")]
  node_src_list["List view<br/>ui view<br/>[list.js]"]
  node_src_details["Details view<br/>ui view<br/>[details.js]"]
  node_src_map["Map view<br/>ui view<br/>[map.js]"]
  node_public_js_bundle["Bundled JS<br/>compiled client<br/>[app.js]"]
  node_browser(("Browser<br/>client runtime"))
end

subgraph group_data["Data"]
  node_load_fixtures_js["Loader<br/>bootstrap script<br/>[load_fixtures.js]"]
  node_fixtures_sql[("SQL dump<br/>seed dataset<br/>[cartographies.sql]")]
  node_fixtures_yml["YAML data<br/>seed data<br/>[authors.yml]"]
  node_fixtures_py["Fixture scripts<br/>loader scripts<br/>[load_fixtures.py]"]
  node_mysql[("MySQL<br/>database")]
end

subgraph group_assets["Assets"]
  node_public_css["Styles<br/>static css<br/>[base.css]"]
  node_public_theme["Theme assets<br/>ui theme<br/>[style.css]"]
  node_public_media["Media library<br/>static media<br/>[bambara.mp3]"]
end

node_load_fixtures_js -->|"imports"| node_fixtures_sql
node_load_fixtures_js -->|"reads"| node_fixtures_yml
node_fixtures_py -->|"parses"| node_fixtures_yml
node_fixtures_py -.->|"builds"| node_fixtures_sql
node_fixtures_sql -->|"loads"| node_mysql
node_index_js -->|"configures"| node_config_js
node_index_js -->|"queries"| node_db_js
node_index_js -->|"renders"| node_views_base
node_index_js -->|"renders"| node_views_languages
node_db_js -->|"executes SQL"| node_mysql
node_views_base -->|"includes"| node_public_css
node_views_base -->|"loads"| node_public_js_bundle
node_views_base -->|"references"| node_public_media
node_views_languages -->|"loads"| node_public_js_bundle
node_src_app -->|"wires"| node_src_actions
node_src_actions -->|"dispatches"| node_src_dispatcher
node_src_dispatcher -->|"updates"| node_src_store
node_src_store -->|"feeds"| node_src_list
node_src_store -->|"feeds"| node_src_details
node_src_store -->|"feeds"| node_src_map
node_src_list -->|"triggers"| node_src_actions
node_src_details -->|"triggers"| node_src_actions
node_src_map -->|"triggers"| node_src_actions
node_src_app -.->|"builds into"| node_public_js_bundle
node_public_js_bundle -->|"runs in"| node_browser
node_browser -->|"requests"| node_views_languages
node_browser -->|"loads assets"| node_public_media

click node_index_js "https://github.com/rcln/cartographies.sonores/blob/master/index.js"
click node_config_js "https://github.com/rcln/cartographies.sonores/blob/master/config.js"
click node_db_js "https://github.com/rcln/cartographies.sonores/blob/master/db.js"
click node_views_base "https://github.com/rcln/cartographies.sonores/blob/master/views/base.html"
click node_views_languages "https://github.com/rcln/cartographies.sonores/blob/master/views/languages.html"
click node_load_fixtures_js "https://github.com/rcln/cartographies.sonores/blob/master/load_fixtures.js"
click node_fixtures_sql "https://github.com/rcln/cartographies.sonores/blob/master/fixtures/cartographies.sql"
click node_fixtures_yml "https://github.com/rcln/cartographies.sonores/blob/master/fixtures/authors.yml"
click node_fixtures_py "https://github.com/rcln/cartographies.sonores/blob/master/fixtures/load_fixtures.py"
click node_src_app "https://github.com/rcln/cartographies.sonores/blob/master/src/app.js"
click node_src_actions "https://github.com/rcln/cartographies.sonores/blob/master/src/actions.js"
click node_src_dispatcher "https://github.com/rcln/cartographies.sonores/blob/master/src/dispatcher.js"
click node_src_store "https://github.com/rcln/cartographies.sonores/blob/master/src/store.js"
click node_src_list "https://github.com/rcln/cartographies.sonores/blob/master/src/list.js"
click node_src_details "https://github.com/rcln/cartographies.sonores/blob/master/src/details.js"
click node_src_map "https://github.com/rcln/cartographies.sonores/blob/master/src/map.js"
click node_public_js_bundle "https://github.com/rcln/cartographies.sonores/blob/master/public/js/app.js"
click node_public_css "https://github.com/rcln/cartographies.sonores/blob/master/public/css/base.css"
click node_public_theme "https://github.com/rcln/cartographies.sonores/blob/master/public/dashgum/css/style.css"
click node_public_media "https://github.com/rcln/cartographies.sonores/blob/master/public/audio/bambara.mp3"

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_index_js,node_config_js,node_db_js,node_views_base,node_views_languages toneBlue
class node_src_app,node_src_actions,node_src_dispatcher,node_src_store,node_src_list,node_src_details,node_src_map,node_public_js_bundle,node_browser toneAmber
class node_load_fixtures_js,node_fixtures_sql,node_fixtures_yml,node_fixtures_py,node_mysql toneMint
class node_public_css,node_public_theme,node_public_media toneRose
```

## Components

### Server

Node.js runtime and request handling

- [App entry](https://github.com/rcln/cartographies.sonores/blob/master/index.js): node entry · Main Node.js process and startup wiring · `index.js`
- [Config](https://github.com/rcln/cartographies.sonores/blob/master/config.js): runtime config · Loads server path, port, and DB settings · `config.js`
- [DB layer](https://github.com/rcln/cartographies.sonores/blob/master/db.js): mysql access · Application boundary for MySQL queries · `db.js`
- [Base shell](https://github.com/rcln/cartographies.sonores/blob/master/views/base.html): html template · Shared page frame for the app · `views/base.html`
- [Languages page](https://github.com/rcln/cartographies.sonores/blob/master/views/languages.html): html template · Page template for language browsing · `views/languages.html`

### Client

Browser app and UI modules

- [Client app](https://github.com/rcln/cartographies.sonores/blob/master/src/app.js): ui composition · Browser application composition root · `src/app.js`
- [Actions](https://github.com/rcln/cartographies.sonores/blob/master/src/actions.js): flux actions · User intent and event creators · `src/actions.js`
- [Dispatcher](https://github.com/rcln/cartographies.sonores/blob/master/src/dispatcher.js): flux dispatcher · Event hub between actions and store · `src/dispatcher.js`
- [Store](https://github.com/rcln/cartographies.sonores/blob/master/src/store.js): state store · Central client state and data coordination · `src/store.js`
- [List view](https://github.com/rcln/cartographies.sonores/blob/master/src/list.js): ui view · Language browsing and search interface · `src/list.js`
- [Details view](https://github.com/rcln/cartographies.sonores/blob/master/src/details.js): ui view · Selected language detail panel · `src/details.js`
- [Map view](https://github.com/rcln/cartographies.sonores/blob/master/src/map.js): ui view · Geographic visualization of language locations · `src/map.js`
- [Bundled JS](https://github.com/rcln/cartographies.sonores/blob/master/public/js/app.js): compiled client · Deployed browser modules and source maps · `public/js/app.js`
- **Browser**: client runtime · Loads the app shell and interactive frontend

### Data

Database, fixtures, and loading path

- [Loader](https://github.com/rcln/cartographies.sonores/blob/master/load_fixtures.js): bootstrap script · Top-level database fixture loading entrypoint · `load_fixtures.js`
- [SQL dump](https://github.com/rcln/cartographies.sonores/blob/master/fixtures/cartographies.sql): seed dataset · Database backup/import source · `fixtures/cartographies.sql`
- [YAML data](https://github.com/rcln/cartographies.sonores/blob/master/fixtures/authors.yml): seed data · Structured authors and languages fixture files · `fixtures/authors.yml`
- [Fixture scripts](https://github.com/rcln/cartographies.sonores/blob/master/fixtures/load_fixtures.py): loader scripts · Python helpers used to prepare and test fixture imports · `fixtures/load_fixtures.py`
- **MySQL**: database · Authoritative persistent data store

### Assets

Static media and themed frontend assets

- [Styles](https://github.com/rcln/cartographies.sonores/blob/master/public/css/base.css): static css · Base and responsive styling for the site · `public/css/base.css`
- [Theme assets](https://github.com/rcln/cartographies.sonores/blob/master/public/dashgum/css/style.css): ui theme · Third-party dashboard/theme CSS and fonts · `public/dashgum/css/style.css`
- [Media library](https://github.com/rcln/cartographies.sonores/blob/master/public/audio/bambara.mp3): static media · Audio clips, thumbnails, and language images · `public/audio/bambara.mp3`

## Connections

- Loader → SQL dump: imports · Loads seed data into the database
- Loader → YAML data: reads · Consumes structured fixture metadata
- Fixture scripts → YAML data: parses · Helper scripts process YAML fixture inputs
- Fixture scripts → SQL dump: builds · Fixture tooling can generate or validate import data
- SQL dump → MySQL: loads · Populates the MySQL schema and content
- App entry → Config: configures · Startup reads runtime configuration
- App entry → DB layer: queries · Server uses DB boundary for persistence access
- App entry → Base shell: renders · Serves the shared application shell
- App entry → Languages page: renders · Serves the language browsing page
- DB layer → MySQL: executes SQL · All persistent reads and writes go through MySQL
- Base shell → Styles: includes · Base shell pulls core styles
- Base shell → Bundled JS: loads · Base shell bootstraps browser code
- Base shell → Media library: references · Shell can reference static media assets
- Languages page → Bundled JS: loads · Language page loads the client bundle
- Client app → Actions: wires · Composition root connects user actions
- Actions → Dispatcher: dispatches · Actions flow through the dispatcher
- Dispatcher → Store: updates · Dispatcher delivers events to the store
- Store → List view: feeds · List view subscribes to shared state
- Store → Details view: feeds · Details view subscribes to selected-item state
- Store → Map view: feeds · Map view subscribes to location state
- List view → Actions: triggers · User interactions create actions
- Details view → Actions: triggers · Detail interactions create actions
- Map view → Actions: triggers · Map interactions create actions
- Client app → Bundled JS: builds into · Source modules are compiled for the browser
- Bundled JS → Browser: runs in · Deployed JavaScript executes in the browser
- Browser → Languages page: requests · Browser loads the language page from the server
- Browser → Media library: loads assets · Browser fetches images, thumbnails, and audio
