# braian-de-liz/amotif architecture

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

- Interactive diagram: https://gitdiagram.com/braian-de-liz/amotif
- Repository: https://github.com/braian-de-liz/amotif

## Overview

AMOTIF is a collaborative, asynchronous music-production platform: musicians create projects, contribute offset-aligned audio layers, and let project owners approve contributions. The frontend supports project creation and a virtual studio with synchronized playback; the Fastify API handles identity, projects, collaboration, audio, and version history. The graph preserves the README’s social, discovery, and studio capabilities. Some backend routes were not sampled, so documented links are cited to the README; unsampled implementation details are not inferred.

Main entry points: [`backend/src/routers/plugin_routes.ts`](https://github.com/braian-de-liz/amotif/blob/main/backend/src/routers/plugin_routes.ts) (Route registry), [`frontend/src/pages/studio.tsx`](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/pages/studio.tsx) (Virtual studio), [`backend/src/routers/layers`](https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/layers) (Audio layers), [`frontend/src/utility/url_apis.ts`](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/utility/url_apis.ts) (API endpoint config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Music workspace"]
  node_app["Web application<br/>[App.tsx]"]
  node_create["Project creation<br/>[novoStudio.tsx]"]
  node_studio["Virtual studio<br/>[studio.tsx]"]
  node_audio_ui["Audio editor<br/>[AudioEditor.tsx]"]
  node_waveforms["Waveform tracks<br/>[WaveformTrack.tsx]"]
  node_branch_ui["Branch manager<br/>[BranchManager.tsx]"]
  node_user_context["User context"]
  node_api_client["API endpoint config<br/>[url_apis.ts]"]
end

subgraph group_api["API and identity"]
  node_api_server["Fastify API<br/>[server.ts]"]
  node_route_registry["Route registry<br/>[plugin_routes.ts]"]
  node_auth["JWT authentication<br/>[JWT_verific.ts]"]
end

subgraph group_music["Music collaboration"]
  node_projects["Project management"]
  node_layers["Audio layers"]
  node_version_service["Version history<br/>[versionService.ts]"]
  node_branches["Layer branches<br/>[branchService.ts]"]
  node_collaboration["Project collaboration"]
  node_upload["Audio upload<br/>[upload.ts]"]
end

subgraph group_social["Discovery and community"]
  node_profiles["Profiles and follows"]
  node_discovery["Search and feed"]
  node_community["Community activity"]
  node_project_interactions["Mural and suggestions"]
end

node_musician(("Musician"))
node_storage[("Supabase Storage")]
node_database[("PostgreSQL database")]
node_email["Email service"]

node_musician -->|"uses"| node_app
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_studio
node_create -->|"uses editor"| node_audio_ui
node_studio -->|"renders tracks"| node_waveforms
node_studio -->|"reads user"| node_user_context
node_branch_ui -.->|"manages branches"| node_branches
node_create -->|"uses endpoint"| node_api_client
node_studio -->|"requests data"| node_api_client
node_user_context -->|"uses endpoint"| node_api_client
node_api_client -.->|"targets API"| node_api_server
node_api_server -->|"registers routes"| node_route_registry
node_route_registry -->|"registers"| node_projects
node_route_registry -->|"registers"| node_layers
node_route_registry -->|"registers"| node_collaboration
node_route_registry -->|"registers"| node_discovery
node_projects -.->|"persists projects"| node_database
node_layers -->|"uploads audio"| node_upload
node_upload -->|"streams files"| node_storage
node_layers -->|"records versions"| node_version_service
node_layers -->|"uses branch service"| node_branches
node_version_service -.->|"stores versions"| node_database
node_branches -.->|"updates layer history"| node_database
node_collaboration -.->|"sends invitations"| node_email
node_profiles -.->|"stores profiles"| node_database
node_discovery -.->|"queries content"| node_database
node_community -.->|"stores notifications"| node_database
node_project_interactions -.->|"stores activity"| node_database

click node_app "https://github.com/braian-de-liz/amotif/blob/main/frontend/src/App.tsx"
click node_create "https://github.com/braian-de-liz/amotif/blob/main/frontend/src/pages/novoStudio.tsx"
click node_studio "https://github.com/braian-de-liz/amotif/blob/main/frontend/src/pages/studio.tsx"
click node_audio_ui "https://github.com/braian-de-liz/amotif/blob/main/frontend/src/components/AudioEditor.tsx"
click node_waveforms "https://github.com/braian-de-liz/amotif/blob/main/frontend/src/components/WaveformTrack.tsx"
click node_branch_ui "https://github.com/braian-de-liz/amotif/blob/main/frontend/src/components/BranchManager.tsx"
click node_user_context "https://github.com/braian-de-liz/amotif/blob/main/frontend/src/contexts/UserDataContext.tsx"
click node_api_client "https://github.com/braian-de-liz/amotif/blob/main/frontend/src/utility/url_apis.ts"
click node_api_server "https://github.com/braian-de-liz/amotif/blob/main/backend/src/server.ts"
click node_route_registry "https://github.com/braian-de-liz/amotif/blob/main/backend/src/routers/plugin_routes.ts"
click node_auth "https://github.com/braian-de-liz/amotif/blob/main/backend/src/hooks/JWT_verific.ts"
click node_projects "https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/projetos"
click node_layers "https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/layers"
click node_version_service "https://github.com/braian-de-liz/amotif/blob/main/backend/src/services/versionService.ts"
click node_branches "https://github.com/braian-de-liz/amotif/blob/main/backend/src/services/branchService.ts"
click node_collaboration "https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/colaboration"
click node_upload "https://github.com/braian-de-liz/amotif/blob/main/backend/src/lib/upload.ts"
click node_profiles "https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/user"
click node_discovery "https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/search"
click node_community "https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/notification"
click node_project_interactions "https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/projetos"

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,node_create,node_studio,node_audio_ui,node_waveforms,node_branch_ui,node_user_context,node_api_client toneBlue
class node_api_server,node_route_registry,node_auth,node_storage,node_database toneAmber
class node_projects,node_layers,node_version_service,node_branches,node_collaboration,node_upload toneMint
class node_profiles,node_discovery,node_community,node_project_interactions toneRose
class node_musician,node_email toneIndigo
```

## Components

### Music workspace

- [Web application](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Project creation](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/pages/novoStudio.tsx): `frontend/src/pages/novoStudio.tsx`
- [Virtual studio](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/pages/studio.tsx): `frontend/src/pages/studio.tsx`
- [Audio editor](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/components/AudioEditor.tsx): `frontend/src/components/AudioEditor.tsx`
- [Waveform tracks](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/components/WaveformTrack.tsx): `frontend/src/components/WaveformTrack.tsx`
- [Branch manager](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/components/BranchManager.tsx): `frontend/src/components/BranchManager.tsx`
- [User context](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/contexts/UserDataContext.tsx): `frontend/src/contexts/UserDataContext.tsx`
- [API endpoint config](https://github.com/braian-de-liz/amotif/blob/main/frontend/src/utility/url_apis.ts): `frontend/src/utility/url_apis.ts`

### API and identity

- [Fastify API](https://github.com/braian-de-liz/amotif/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Route registry](https://github.com/braian-de-liz/amotif/blob/main/backend/src/routers/plugin_routes.ts): `backend/src/routers/plugin_routes.ts`
- [JWT authentication](https://github.com/braian-de-liz/amotif/blob/main/backend/src/hooks/JWT_verific.ts): `backend/src/hooks/JWT_verific.ts`

### Music collaboration

- [Project management](https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/projetos): `backend/src/routers/projetos`
- [Audio layers](https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/layers): `backend/src/routers/layers`
- [Version history](https://github.com/braian-de-liz/amotif/blob/main/backend/src/services/versionService.ts): `backend/src/services/versionService.ts`
- [Layer branches](https://github.com/braian-de-liz/amotif/blob/main/backend/src/services/branchService.ts): `backend/src/services/branchService.ts`
- [Project collaboration](https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/colaboration): `backend/src/routers/colaboration`
- [Audio upload](https://github.com/braian-de-liz/amotif/blob/main/backend/src/lib/upload.ts): `backend/src/lib/upload.ts`

### Discovery and community

- [Profiles and follows](https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/user): `backend/src/routers/user`
- [Search and feed](https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/search): `backend/src/routers/search`
- [Community activity](https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/notification): `backend/src/routers/notification`
- [Mural and suggestions](https://github.com/braian-de-liz/amotif/tree/main/backend/src/routers/projetos): `backend/src/routers/projetos`

### Other components

- **Musician**
- **Supabase Storage**
- **PostgreSQL database**
- **Email service**

## Connections

- Musician → Web application: uses
- Web application → Project creation: routes to (evidence: `frontend/src/App.tsx`)
- Web application → Virtual studio: routes to (evidence: `frontend/src/App.tsx`)
- Project creation → Audio editor: uses editor (evidence: `frontend/src/pages/novoStudio.tsx`)
- Virtual studio → Waveform tracks: renders tracks (evidence: `frontend/src/pages/studio.tsx`)
- Virtual studio → User context: reads user (evidence: `frontend/src/pages/studio.tsx`)
- Branch manager → Layer branches: manages branches
- Project creation → API endpoint config: uses endpoint (evidence: `frontend/src/pages/novoStudio.tsx`)
- Virtual studio → API endpoint config: requests data (evidence: `frontend/src/pages/studio.tsx`)
- User context → API endpoint config: uses endpoint (evidence: `frontend/src/contexts/UserDataContext.tsx`)
- API endpoint config → Fastify API: targets API
- Fastify API → Route registry: registers routes (evidence: `backend/src/server.ts`)
- Route registry → Project management: registers (evidence: `backend/src/routers/plugin_routes.ts`)
- Route registry → Audio layers: registers (evidence: `backend/src/routers/plugin_routes.ts`)
- Route registry → Project collaboration: registers (evidence: `backend/src/routers/plugin_routes.ts`)
- Route registry → Search and feed: registers (evidence: `backend/src/routers/plugin_routes.ts`)
- Project management → PostgreSQL database: persists projects
- Audio layers → Audio upload: uploads audio (evidence: `backend/src/routers/layers/create_layer.ts`)
- Audio upload → Supabase Storage: streams files
- Audio layers → Version history: records versions (evidence: `backend/src/routers/layers/create_layer.ts`)
- Audio layers → Layer branches: uses branch service (evidence: `backend/src/routers/layers/create_layer.ts`)
- Version history → PostgreSQL database: stores versions
- Layer branches → PostgreSQL database: updates layer history
- Project collaboration → Email service: sends invitations
- Profiles and follows → PostgreSQL database: stores profiles
- Search and feed → PostgreSQL database: queries content
- Community activity → PostgreSQL database: stores notifications
- Mural and suggestions → PostgreSQL database: stores activity
