How rcln/cartographies.sonores works
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: actions.js Actions · index.js App entry · base.html Base shell · store.js Store
Components 22
Server
Node.js runtime and request handling
- App entry · Main Node.js process and startup wiring
index.js - Config · Loads server path, port, and DB settings
config.js - DB layer · Application boundary for MySQL queries
db.js - Base shell · Shared page frame for the app
views/base.html - Languages page · Page template for language browsing
views/languages.html
Client
Browser app and UI modules
- Client app · Browser application composition root
src/app.js - Actions · User intent and event creators
src/actions.js - Dispatcher · Event hub between actions and store
src/dispatcher.js - Store · Central client state and data coordination
src/store.js - List view · Language browsing and search interface
src/list.js - Details view · Selected language detail panel
src/details.js - Map view · Geographic visualization of language locations
src/map.js - Bundled JS · Deployed browser modules and source maps
public/js/app.js - Browser · Loads the app shell and interactive frontend
Data
Database, fixtures, and loading path
- Loader · Top-level database fixture loading entrypoint
load_fixtures.js - SQL dump · Database backup/import source
fixtures/cartographies.sql - YAML data · Structured authors and languages fixture files
fixtures/authors.yml - Fixture scripts · Python helpers used to prepare and test fixture imports
fixtures/load_fixtures.py - MySQL · Authoritative persistent data store
Assets
Static media and themed frontend assets
- Styles · Base and responsive styling for the site
public/css/base.css - Theme assets · Third-party dashboard/theme CSS and fonts
public/dashgum/css/style.css - Media library · Audio clips, thumbnails, and language images
public/audio/bambara.mp3
Connections 27
- 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