# jingyi012/bloom architecture

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

- Interactive diagram: https://gitdiagram.com/jingyi012/bloom
- Repository: https://github.com/jingyi012/bloom

## Overview

Bloom is a private, delayed-sharing diary: members create sealed circles, write entries for selected circles, and share the resulting timeline after each circle blooms. The mobile app also supports circle invitations and archiving, calendar and profile views, photos, reactions, and comments. The graph follows the documented mobile/API/PostgreSQL architecture and sampled service calls; some controller and screen wiring is inferred only at the documented feature level, so uncertain internal links are omitted.

Main entry points: [`apps/mobile/src/api/client.ts`](https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/api/client.ts) (API client), [`backend/src/Bloom.Infrastructure/Persistence/BloomDbContext.cs`](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Persistence/BloomDbContext.cs) (Bloom database), [`backend/src/Bloom.Infrastructure/Entries/EfEntryService.cs`](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Entries/EfEntryService.cs) (Entry service), [`apps/mobile/src/features/write/WriteScreen.tsx`](https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/features/write/WriteScreen.tsx) (Entry composer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_mobileui["Diary and circle screens"]
  node_write["Entry composer<br/>[WriteScreen.tsx]"]
  node_drafts[("Local drafts<br/>[draftStorage.ts]")]
  node_authmobile["Mobile session<br/>[AuthProvider.tsx]"]
  node_apiclient["API client<br/>[client.ts]"]
end

subgraph group_api["API and auth"]
  node_authcontroller["Authentication endpoints<br/>[AuthController.cs]"]
  node_circlecontroller["Circle endpoints"]
  node_entrycontroller["Entry endpoints"]
  node_timelinecontroller["Timeline endpoints"]
  node_mediacontroller["Media endpoints<br/>[MediaController.cs]"]
  node_tokens["Session token service"]
end

subgraph group_services["Domain services"]
  node_circles["Circle service<br/>[EfCircleService.cs]"]
  node_entries["Entry service<br/>[EfEntryService.cs]"]
  node_identity["Google user service"]
  node_mediaservice["Media service<br/>[EfMediaService.cs]"]
  node_protector["Entry protection"]
end

subgraph group_storage["Persistence and media"]
  node_db[("Bloom database<br/>[BloomDbContext.cs]")]
  node_imagestore[("Local image files")]
end

node_person(("Diary member"))
node_google["Google sign-in"]
node_postgres[("PostgreSQL")]

node_person -->|"uses"| node_mobileui
node_person -->|"composes"| node_write
node_write -->|"saves drafts"| node_drafts
node_mobileui -->|"requests data"| node_apiclient
node_write -->|"submits entries"| node_apiclient
node_authmobile -->|"uses session"| node_apiclient
node_authmobile -.->|"signs in with"| node_google
node_apiclient -->|"calls"| node_authcontroller
node_apiclient -->|"calls"| node_circlecontroller
node_apiclient -->|"calls"| node_entrycontroller
node_apiclient -->|"calls"| node_timelinecontroller
node_apiclient -->|"calls"| node_mediacontroller
node_authcontroller -->|"calls"| node_identity
node_authcontroller -->|"issues sessions"| node_tokens
node_circlecontroller -->|"calls"| node_circles
node_entrycontroller -->|"calls"| node_entries
node_timelinecontroller -->|"reads timeline"| node_entries
node_mediacontroller -->|"calls"| node_mediaservice
node_circles -->|"reads and writes"| node_db
node_entries -->|"reads and writes"| node_db
node_entries -->|"stores images"| node_imagestore
node_entries -->|"protects text"| node_protector
node_mediaservice -->|"stores metadata"| node_db
node_mediaservice -->|"stores files"| node_imagestore
node_identity -->|"reads and writes"| node_db
node_tokens -->|"persists sessions"| node_db
node_db -->|"persists data"| node_postgres

click node_mobileui "https://github.com/jingyi012/bloom/tree/main/apps/mobile/src/features"
click node_write "https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/features/write/WriteScreen.tsx"
click node_drafts "https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/features/write/draftStorage.ts"
click node_authmobile "https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/auth/AuthProvider.tsx"
click node_apiclient "https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/api/client.ts"
click node_authcontroller "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/AuthController.cs"
click node_circlecontroller "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/CirclesController.cs"
click node_entrycontroller "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/EntriesController.cs"
click node_timelinecontroller "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/TimelineController.cs"
click node_mediacontroller "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/MediaController.cs"
click node_circles "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Circles/EfCircleService.cs"
click node_entries "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Entries/EfEntryService.cs"
click node_identity "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Identity/EfGoogleUserService.cs"
click node_tokens "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Security/SessionTokenService.cs"
click node_mediaservice "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Media/EfMediaService.cs"
click node_protector "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Security/DataProtectionEntryProtector.cs"
click node_db "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Persistence/BloomDbContext.cs"
click node_imagestore "https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Media/LocalImageStorage.cs"

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_mobileui,node_write,node_drafts,node_authmobile,node_apiclient toneBlue
class node_authcontroller,node_circlecontroller,node_entrycontroller,node_timelinecontroller,node_mediacontroller,node_tokens,node_postgres toneAmber
class node_circles,node_entries,node_identity,node_mediaservice,node_protector toneMint
class node_db,node_imagestore toneRose
class node_person,node_google toneIndigo
```

## Components

### Mobile app

- [Diary and circle screens](https://github.com/jingyi012/bloom/tree/main/apps/mobile/src/features): `apps/mobile/src/features`
- [Entry composer](https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/features/write/WriteScreen.tsx): `apps/mobile/src/features/write/WriteScreen.tsx`
- [Local drafts](https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/features/write/draftStorage.ts): `apps/mobile/src/features/write/draftStorage.ts`
- [Mobile session](https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/auth/AuthProvider.tsx): `apps/mobile/src/auth/AuthProvider.tsx`
- [API client](https://github.com/jingyi012/bloom/blob/main/apps/mobile/src/api/client.ts): `apps/mobile/src/api/client.ts`

### API and auth

- [Authentication endpoints](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/AuthController.cs): `backend/src/Bloom.Api/Controllers/AuthController.cs`
- [Circle endpoints](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/CirclesController.cs): `backend/src/Bloom.Api/Controllers/CirclesController.cs`
- [Entry endpoints](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/EntriesController.cs): `backend/src/Bloom.Api/Controllers/EntriesController.cs`
- [Timeline endpoints](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/TimelineController.cs): `backend/src/Bloom.Api/Controllers/TimelineController.cs`
- [Media endpoints](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Controllers/MediaController.cs): `backend/src/Bloom.Api/Controllers/MediaController.cs`
- [Session token service](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Api/Security/SessionTokenService.cs): `backend/src/Bloom.Api/Security/SessionTokenService.cs`

### Domain services

- [Circle service](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Circles/EfCircleService.cs): `backend/src/Bloom.Infrastructure/Circles/EfCircleService.cs`
- [Entry service](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Entries/EfEntryService.cs): `backend/src/Bloom.Infrastructure/Entries/EfEntryService.cs`
- [Google user service](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Identity/EfGoogleUserService.cs): `backend/src/Bloom.Infrastructure/Identity/EfGoogleUserService.cs`
- [Media service](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Media/EfMediaService.cs): `backend/src/Bloom.Infrastructure/Media/EfMediaService.cs`
- [Entry protection](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Security/DataProtectionEntryProtector.cs): `backend/src/Bloom.Infrastructure/Security/DataProtectionEntryProtector.cs`

### Persistence and media

- [Bloom database](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Persistence/BloomDbContext.cs): `backend/src/Bloom.Infrastructure/Persistence/BloomDbContext.cs`
- [Local image files](https://github.com/jingyi012/bloom/blob/main/backend/src/Bloom.Infrastructure/Media/LocalImageStorage.cs): `backend/src/Bloom.Infrastructure/Media/LocalImageStorage.cs`

### Other components

- **Diary member**
- **Google sign-in**
- **PostgreSQL**

## Connections

- Diary member → Diary and circle screens: uses
- Diary member → Entry composer: composes
- Entry composer → Local drafts: saves drafts
- Diary and circle screens → API client: requests data
- Entry composer → API client: submits entries
- Mobile session → API client: uses session
- Mobile session → Google sign-in: signs in with
- API client → Authentication endpoints: calls
- API client → Circle endpoints: calls
- API client → Entry endpoints: calls
- API client → Timeline endpoints: calls
- API client → Media endpoints: calls
- Authentication endpoints → Google user service: calls
- Authentication endpoints → Session token service: issues sessions
- Circle endpoints → Circle service: calls
- Entry endpoints → Entry service: calls
- Timeline endpoints → Entry service: reads timeline
- Media endpoints → Media service: calls
- Circle service → Bloom database: reads and writes
- Entry service → Bloom database: reads and writes
- Entry service → Local image files: stores images
- Entry service → Entry protection: protects text
- Media service → Bloom database: stores metadata
- Media service → Local image files: stores files
- Google user service → Bloom database: reads and writes
- Session token service → Bloom database: persists sessions
- Bloom database → PostgreSQL: persists data
