# anamikasharma1509/nivora architecture

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

- Interactive diagram: https://gitdiagram.com/anamikasharma1509/nivora
- Repository: https://github.com/anamikasharma1509/nivora

## Overview

Nivora is an AI-powered goal and productivity platform whose primary journey is: a user creates a personal destination and daily tasks, tracks progress on a private timeline, and receives episodic story representations of that journey. The graph also preserves onboarding and authentication, avatars and traits, domain-specific roadmaps, and the separate read-only Explore Other Lives experience. Some API implementations were not sampled; their documented capabilities are represented without speculative internal call paths.

Main entry points: [`services/api/app/services/story_service.py`](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/story_service.py) (Episode generation), [`services/api/app/services/productivity_service.py`](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/productivity_service.py) (Goals and tasks), [`services/api/app/models/story.py`](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/models/story.py) (User, goal and story records), [`apps/web/lib/api.ts`](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_app["Web application<br/>[page.tsx]"]
  node_auth_ui["Sign-in and callback<br/>[page.tsx]"]
  node_onboarding_ui["Identity onboarding<br/>[page.tsx]"]
  node_identity_builder["Identity builder"]
  node_daily_ui["Daily tasks<br/>[page.tsx]"]
  node_timeline_ui["Personal timeline<br/>[page.tsx]"]
  node_explore_ui["Explore stories<br/>[page.tsx]"]
  node_explore_detail["Character story<br/>[page.tsx]"]
  node_avatar_ui["Avatar and traits"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API workflows"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_task_api["Task API<br/>[tasks.py]"]
  node_timeline_api["Timeline API<br/>[timeline.py]"]
  node_avatar_api["Avatar API<br/>[avatars.py]"]
  node_story_api["Episodes and series API<br/>[episodes.py]"]
  node_api_entry["API application<br/>[main.py]"]
end

subgraph group_domain["Goal and story domain"]
  node_auth_service["Account service<br/>[auth_service.py]"]
  node_productivity["Goals and tasks"]
  node_goal_alignment["Goal alignment"]
  node_roadmap["Personalized roadmap<br/>[roadmap_service.py]"]
  node_story_service["Episode generation<br/>[story_service.py]"]
  node_providers["Story and media providers<br/>[factory.py]"]
end

subgraph group_infra["Persistence and media"]
  node_media_pipeline["Video assembly<br/>[media_pipeline.py]"]
  node_storage["Media storage<br/>[storage.py]"]
  node_models["User, goal and story records<br/>[story.py]"]
  node_database[("Relational database<br/>[database.py]")]
end

node_user(("User"))

node_user -->|"uses"| node_web_app
node_web_app -.->|"starts sign-in"| node_auth_ui
node_auth_ui -.->|"requests auth"| node_api_client
node_onboarding_ui -.->|"opens"| node_identity_builder
node_daily_ui -.->|"requests tasks"| node_api_client
node_timeline_ui -.->|"requests timeline"| node_api_client
node_timeline_ui -->|"loads user timeline"| node_timeline_api
node_explore_ui -->|"opens character"| node_explore_detail
node_avatar_ui -.->|"saves identity"| node_api_client
node_api_entry -->|"creates tables"| node_database
node_api_entry -->|"registers routes"| node_auth_api
node_task_api -->|"delegates tasks"| node_productivity
node_auth_api -->|"delegates accounts"| node_auth_service
node_story_service -->|"reads productivity"| node_productivity
node_productivity -->|"assesses alignment"| node_goal_alignment
node_story_service -->|"selects provider"| node_providers
node_story_service -->|"assembles episode"| node_media_pipeline
node_story_service -.->|"stores media"| node_storage
node_models -->|"uses ORM base"| node_database
node_auth_service -->|"persists accounts"| node_models
node_productivity -->|"persists tasks"| node_models
node_roadmap -->|"reads goal domain"| node_models

click node_web_app "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/page.tsx"
click node_auth_ui "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/auth/callback/page.tsx"
click node_onboarding_ui "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/onboarding/page.tsx"
click node_identity_builder "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/components/IdentityBuilderModal.tsx"
click node_daily_ui "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/today/page.tsx"
click node_timeline_ui "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/timeline/page.tsx"
click node_explore_ui "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/explore-other-lives/page.tsx"
click node_explore_detail "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/explore-other-lives/%5BcharacterKey%5D/page.tsx"
click node_avatar_ui "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/components/TraitAdoptionModal.tsx"
click node_api_client "https://github.com/anamikasharma1509/nivora/blob/main/apps/web/lib/api.ts"
click node_auth_api "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/auth.py"
click node_task_api "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/tasks.py"
click node_timeline_api "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/timeline.py"
click node_avatar_api "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/avatars.py"
click node_story_api "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/episodes.py"
click node_auth_service "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/auth_service.py"
click node_productivity "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/productivity_service.py"
click node_goal_alignment "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/goal_alignment_service.py"
click node_roadmap "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/roadmap_service.py"
click node_story_service "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/story_service.py"
click node_providers "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/providers/factory.py"
click node_media_pipeline "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/media_pipeline.py"
click node_storage "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/providers/storage.py"
click node_models "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/models/story.py"
click node_database "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/core/database.py"
click node_api_entry "https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/main.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_web_app,node_auth_ui,node_onboarding_ui,node_identity_builder,node_daily_ui,node_timeline_ui,node_explore_ui,node_explore_detail,node_avatar_ui,node_api_client,node_user toneBlue
class node_auth_api,node_task_api,node_timeline_api,node_avatar_api,node_story_api,node_api_entry toneAmber
class node_auth_service,node_productivity,node_goal_alignment,node_roadmap,node_story_service,node_providers toneMint
class node_media_pipeline,node_storage,node_models,node_database toneRose
```

## Components

### Web experience

- [Web application](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/page.tsx): `apps/web/app/page.tsx`
- [Sign-in and callback](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/auth/callback/page.tsx): `apps/web/app/auth/callback/page.tsx`
- [Identity onboarding](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/onboarding/page.tsx): `apps/web/app/onboarding/page.tsx`
- [Identity builder](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/components/IdentityBuilderModal.tsx): `apps/web/components/IdentityBuilderModal.tsx`
- [Daily tasks](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/today/page.tsx): `apps/web/app/today/page.tsx`
- [Personal timeline](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/timeline/page.tsx): `apps/web/app/timeline/page.tsx`
- [Explore stories](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/explore-other-lives/page.tsx): `apps/web/app/explore-other-lives/page.tsx`
- [Character story](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/app/explore-other-lives/%5BcharacterKey%5D/page.tsx): `apps/web/app/explore-other-lives/[characterKey]/page.tsx`
- [Avatar and traits](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/components/TraitAdoptionModal.tsx): `apps/web/components/TraitAdoptionModal.tsx`
- [API client](https://github.com/anamikasharma1509/nivora/blob/main/apps/web/lib/api.ts): `apps/web/lib/api.ts`

### API workflows

- [Authentication API](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/auth.py): `services/api/app/api/v1/auth.py`
- [Task API](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/tasks.py): `services/api/app/api/v1/tasks.py`
- [Timeline API](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/timeline.py): `services/api/app/api/v1/timeline.py`
- [Avatar API](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/avatars.py): `services/api/app/api/v1/avatars.py`
- [Episodes and series API](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/api/v1/episodes.py): `services/api/app/api/v1/episodes.py`
- [API application](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/main.py): `services/api/app/main.py`

### Goal and story domain

- [Account service](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/auth_service.py): `services/api/app/services/auth_service.py`
- [Goals and tasks](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/productivity_service.py): `services/api/app/services/productivity_service.py`
- [Goal alignment](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/goal_alignment_service.py): `services/api/app/services/goal_alignment_service.py`
- [Personalized roadmap](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/roadmap_service.py): `services/api/app/services/roadmap_service.py`
- [Episode generation](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/story_service.py): `services/api/app/services/story_service.py`
- [Story and media providers](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/providers/factory.py): `services/api/app/providers/factory.py`

### Persistence and media

- [Video assembly](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/services/media_pipeline.py): `services/api/app/services/media_pipeline.py`
- [Media storage](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/providers/storage.py): `services/api/app/providers/storage.py`
- [User, goal and story records](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/models/story.py): `services/api/app/models/story.py`
- [Relational database](https://github.com/anamikasharma1509/nivora/blob/main/services/api/app/core/database.py): `services/api/app/core/database.py`

### Other components

- **User**

## Connections

- User → Web application: uses
- Web application → Sign-in and callback: starts sign-in
- Sign-in and callback → API client: requests auth
- Identity onboarding → Identity builder: opens
- Daily tasks → API client: requests tasks
- Personal timeline → API client: requests timeline
- Personal timeline → Timeline API: loads user timeline
- Explore stories → Character story: opens character
- Avatar and traits → API client: saves identity
- API application → Relational database: creates tables (evidence: `services/api/app/main.py`)
- API application → Authentication API: registers routes (evidence: `services/api/app/main.py`)
- Task API → Goals and tasks: delegates tasks (evidence: `services/api/app/api/v1/tasks.py`)
- Authentication API → Account service: delegates accounts (evidence: `services/api/app/api/v1/auth.py`)
- Episode generation → Goals and tasks: reads productivity (evidence: `services/api/app/services/story_service.py`)
- Goals and tasks → Goal alignment: assesses alignment (evidence: `services/api/app/services/productivity_service.py`)
- Episode generation → Story and media providers: selects provider (evidence: `services/api/app/services/story_service.py`)
- Episode generation → Video assembly: assembles episode (evidence: `services/api/app/services/story_service.py`)
- Episode generation → Media storage: stores media
- User, goal and story records → Relational database: uses ORM base (evidence: `services/api/app/models/story.py`)
- Account service → User, goal and story records: persists accounts (evidence: `services/api/app/services/auth_service.py`)
- Goals and tasks → User, goal and story records: persists tasks (evidence: `services/api/app/services/productivity_service.py`)
- Personalized roadmap → User, goal and story records: reads goal domain (evidence: `services/api/app/services/roadmap_service.py`)
