# metilda-uw/metilda architecture

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

- Interactive diagram: https://gitdiagram.com/metilda-uw/metilda
- Repository: https://github.com/metilda-uw/metilda
- Video tour (about a minute): https://gitdiagram.com/metilda-uw/metilda/video

## Overview

Metilda is an audio-analysis web app with a React frontend and Flask backend. Users sign in, upload or select audio, and work with pitch-analysis and annotation tools; results and files can then be reviewed or managed. The README also identifies learning, PELDA, conversion, collections, feedback, messaging, and administration capabilities. The graph preserves these as product areas, while sampled backend code shows database-backed routes and pitch-analysis services. Some feature internals and frontend-to-backend wiring were not sampled, so uncertain connections are omitted or marked dashed.

Main entry points: [`frontend/src/App.tsx`](https://github.com/metilda-uw/metilda/blob/master/frontend/src/App.tsx) (App routing), [`frontend/src/Create/AudioAnalysis.tsx`](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Create/AudioAnalysis.tsx) (Audio analysis), [`src/metilda/__init__.py`](https://github.com/metilda-uw/metilda/blob/master/src/metilda/__init__.py) (Flask application), [`src/metilda/controllers/pitch_art_wizard.py`](https://github.com/metilda-uw/metilda/blob/master/src/metilda/controllers/pitch_art_wizard.py) (Pitch and file routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and identity"]
  node_app_router["App routing<br/>[App.tsx]"]
  node_auth["Authentication"]
  node_firebase["Firebase integration<br/>[firebase.ts]"]
end

subgraph group_audio["Audio and pitch work"]
  node_create["Pitch-art creation<br/>[CreatePitchArt.tsx]"]
  node_analysis["Audio analysis<br/>[AudioAnalysis.tsx]"]
  node_pitch_view["Pitch-art viewer"]
  node_pelda["PELDA annotation<br/>[PeldaView.tsx]"]
  node_converter["Audio converter<br/>[Converter.tsx]"]
  node_audio_state["Audio state<br/>[actions.tsx]"]
end

subgraph group_workspace["Files and learning"]
  node_my_files["File workspace<br/>[MyFiles.tsx]"]
  node_collections["Collections<br/>[Collections.tsx]"]
  node_learning["Syllable learning"]
  node_history["Analysis history<br/>[History.tsx]"]
end

subgraph group_community["Community and administration"]
  node_feedback["Feedback<br/>[Feedback.tsx]"]
  node_notifications["Messaging<br/>[Notifications.tsx]"]
  node_admin["User administration<br/>[ManageUsers.tsx]"]
end

subgraph group_backend["Backend services"]
  node_api["Flask application<br/>[__init__.py]"]
  node_routes["Pitch and file routes"]
  node_analysis_service["Analysis services<br/>[audio_analysis.py]"]
  node_praat["Praat integration<br/>[praat.py]"]
  node_postgres[("Postgres access<br/>[Postgres.py]")]
  node_collection_routes["Collection and feedback routes"]
end

node_user(("User"))

node_user -->|"uses"| node_app_router
node_app_router -->|"wraps"| node_auth
node_app_router -->|"routes to"| node_create
node_app_router -->|"routes to"| node_pelda
node_app_router -->|"routes to"| node_learning
node_app_router -->|"routes to"| node_my_files
node_user -.->|"analyzes audio"| node_analysis
node_create -.->|"uses"| node_analysis
node_analysis -.->|"updates"| node_audio_state
node_pelda -->|"dispatches"| node_audio_state
node_learning -->|"embeds"| node_analysis
node_learning -->|"renders"| node_pitch_view
node_my_files -->|"uses storage"| node_firebase
node_user -.->|"converts audio"| node_converter
node_api -->|"registers routes"| node_routes
node_api -->|"registers routes"| node_collection_routes
node_routes -->|"queries"| node_postgres
node_collection_routes -->|"queries"| node_postgres
node_routes -->|"calls"| node_analysis_service
node_routes -->|"calls"| node_praat
node_analysis -.->|"requests analysis"| node_api
node_pelda -.->|"requests analysis"| node_api
node_my_files -.->|"requests file data"| node_api

click node_app_router "https://github.com/metilda-uw/metilda/blob/master/frontend/src/App.tsx"
click node_auth "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Session/withAuthentication.tsx"
click node_firebase "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Firebase/firebase.ts"
click node_create "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Create/CreatePitchArt.tsx"
click node_analysis "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Create/AudioAnalysis.tsx"
click node_pitch_view "https://github.com/metilda-uw/metilda/blob/master/frontend/src/PitchArtWizard/PitchArtViewer/PitchArtDrawingWindow.tsx"
click node_pelda "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Pelda/PeldaView.tsx"
click node_converter "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Converter/Converter.tsx"
click node_audio_state "https://github.com/metilda-uw/metilda/blob/master/frontend/src/store/audio/actions.tsx"
click node_my_files "https://github.com/metilda-uw/metilda/blob/master/frontend/src/MyFiles/MyFiles.tsx"
click node_collections "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Pages/Collections.tsx"
click node_learning "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Learn/WordSyllableReview.tsx"
click node_history "https://github.com/metilda-uw/metilda/blob/master/frontend/src/History/History.tsx"
click node_feedback "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Feedback/Feedback.tsx"
click node_notifications "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Notifications/Notifications.tsx"
click node_admin "https://github.com/metilda-uw/metilda/blob/master/frontend/src/Admin/ManageUsers.tsx"
click node_api "https://github.com/metilda-uw/metilda/blob/master/src/metilda/__init__.py"
click node_routes "https://github.com/metilda-uw/metilda/blob/master/src/metilda/controllers/pitch_art_wizard.py"
click node_analysis_service "https://github.com/metilda-uw/metilda/blob/master/src/metilda/services/audio_analysis.py"
click node_praat "https://github.com/metilda-uw/metilda/blob/master/src/metilda/services/praat.py"
click node_postgres "https://github.com/metilda-uw/metilda/blob/master/src/metilda/controllers/Postgres.py"
click node_collection_routes "https://github.com/metilda-uw/metilda/blob/master/src/metilda/controllers/controller_firestore.py"

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_app_router,node_auth,node_firebase,node_user toneBlue
class node_create,node_analysis,node_pitch_view,node_pelda,node_converter,node_audio_state toneAmber
class node_my_files,node_collections,node_learning,node_history toneMint
class node_feedback,node_notifications,node_admin toneRose
class node_api,node_routes,node_analysis_service,node_praat,node_postgres,node_collection_routes toneIndigo
```

## Components

### Application and identity

- [App routing](https://github.com/metilda-uw/metilda/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Session/withAuthentication.tsx): `frontend/src/Session/withAuthentication.tsx`
- [Firebase integration](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Firebase/firebase.ts): `frontend/src/Firebase/firebase.ts`

### Audio and pitch work

- [Pitch-art creation](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Create/CreatePitchArt.tsx): `frontend/src/Create/CreatePitchArt.tsx`
- [Audio analysis](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Create/AudioAnalysis.tsx): `frontend/src/Create/AudioAnalysis.tsx`
- [Pitch-art viewer](https://github.com/metilda-uw/metilda/blob/master/frontend/src/PitchArtWizard/PitchArtViewer/PitchArtDrawingWindow.tsx): `frontend/src/PitchArtWizard/PitchArtViewer/PitchArtDrawingWindow.tsx`
- [PELDA annotation](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Pelda/PeldaView.tsx): `frontend/src/Pelda/PeldaView.tsx`
- [Audio converter](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Converter/Converter.tsx): `frontend/src/Converter/Converter.tsx`
- [Audio state](https://github.com/metilda-uw/metilda/blob/master/frontend/src/store/audio/actions.tsx): `frontend/src/store/audio/actions.tsx`

### Files and learning

- [File workspace](https://github.com/metilda-uw/metilda/blob/master/frontend/src/MyFiles/MyFiles.tsx): `frontend/src/MyFiles/MyFiles.tsx`
- [Collections](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Pages/Collections.tsx): `frontend/src/Pages/Collections.tsx`
- [Syllable learning](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Learn/WordSyllableReview.tsx): `frontend/src/Learn/WordSyllableReview.tsx`
- [Analysis history](https://github.com/metilda-uw/metilda/blob/master/frontend/src/History/History.tsx): `frontend/src/History/History.tsx`

### Community and administration

- [Feedback](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Feedback/Feedback.tsx): `frontend/src/Feedback/Feedback.tsx`
- [Messaging](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Notifications/Notifications.tsx): `frontend/src/Notifications/Notifications.tsx`
- [User administration](https://github.com/metilda-uw/metilda/blob/master/frontend/src/Admin/ManageUsers.tsx): `frontend/src/Admin/ManageUsers.tsx`

### Backend services

- [Flask application](https://github.com/metilda-uw/metilda/blob/master/src/metilda/__init__.py): `src/metilda/__init__.py`
- [Pitch and file routes](https://github.com/metilda-uw/metilda/blob/master/src/metilda/controllers/pitch_art_wizard.py): `src/metilda/controllers/pitch_art_wizard.py`
- [Analysis services](https://github.com/metilda-uw/metilda/blob/master/src/metilda/services/audio_analysis.py): `src/metilda/services/audio_analysis.py`
- [Praat integration](https://github.com/metilda-uw/metilda/blob/master/src/metilda/services/praat.py): `src/metilda/services/praat.py`
- [Postgres access](https://github.com/metilda-uw/metilda/blob/master/src/metilda/controllers/Postgres.py): `src/metilda/controllers/Postgres.py`
- [Collection and feedback routes](https://github.com/metilda-uw/metilda/blob/master/src/metilda/controllers/controller_firestore.py): `src/metilda/controllers/controller_firestore.py`

### Other components

- **User**

## Connections

- User → App routing: uses (evidence: `frontend/src/App.tsx`)
- App routing → Authentication: wraps (evidence: `frontend/src/App.tsx`)
- App routing → Pitch-art creation: routes to (evidence: `frontend/src/App.tsx`)
- App routing → PELDA annotation: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Syllable learning: routes to (evidence: `frontend/src/App.tsx`)
- App routing → File workspace: routes to (evidence: `frontend/src/App.tsx`)
- User → Audio analysis: analyzes audio
- Pitch-art creation → Audio analysis: uses
- Audio analysis → Audio state: updates
- PELDA annotation → Audio state: dispatches (evidence: `frontend/src/Pelda/PeldaView.tsx`)
- Syllable learning → Audio analysis: embeds (evidence: `frontend/src/Learn/WordSyllableReview.tsx`)
- Syllable learning → Pitch-art viewer: renders (evidence: `frontend/src/Learn/WordSyllableReview.tsx`)
- File workspace → Firebase integration: uses storage (evidence: `frontend/src/MyFiles/MyFiles.tsx`)
- User → Audio converter: converts audio
- Flask application → Pitch and file routes: registers routes (evidence: `src/metilda/__init__.py`)
- Flask application → Collection and feedback routes: registers routes (evidence: `src/metilda/__init__.py`)
- Pitch and file routes → Postgres access: queries (evidence: `src/metilda/controllers/pitch_art_wizard.py`)
- Collection and feedback routes → Postgres access: queries (evidence: `src/metilda/controllers/controller_firestore.py`)
- Pitch and file routes → Analysis services: calls (evidence: `src/metilda/controllers/pitch_art_wizard.py`)
- Pitch and file routes → Praat integration: calls (evidence: `src/metilda/controllers/pitch_art_wizard.py`)
- Audio analysis → Flask application: requests analysis
- PELDA annotation → Flask application: requests analysis
- File workspace → Flask application: requests file data
