# saibhavani-git/since architecture

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

- Interactive diagram: https://gitdiagram.com/saibhavani-git/since
- Repository: https://github.com/saibhavani-git/since

## Overview

Since turns market activity since a chosen moment into ranked, cited stock cards, with quiet items separated and optional narration. Users manage watchlists in the web app; the API also exposes the digest engine to broker partners. The graph follows the documented API/web split and sampled route, composition, authentication, and speech code. Several service internals and web feature hooks were not sampled, so uncertain call chains are omitted.

Main entry points: [`api/src/main.ts`](https://github.com/saibhavani-git/since/blob/main/api/src/main.ts) (Composition root), [`api/src/app.ts`](https://github.com/saibhavani-git/since/blob/main/api/src/app.ts) (HTTP app), [`web/src/app`](https://github.com/saibhavani-git/since/tree/main/web/src/app) (Since web app), [`api/src/modules/digest/digest.routes.ts`](https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/digest.routes.ts) (Digest routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Since web app"]
  node_webdigest["Catch-up UI"]
  node_webwatch["Watchlist UI"]
  node_webstock["Stock views"]
  node_apiclient["API client<br/>[client.ts]"]
end

subgraph group_http["API access"]
  node_httpapp["HTTP app<br/>[app.ts]"]
  node_authroutes["Auth routes<br/>[auth.routes.ts]"]
  node_watchroutes["Watchlist routes"]
  node_marketroutes["Market routes<br/>[market.routes.ts]"]
  node_digestroutes["Digest routes<br/>[digest.routes.ts]"]
  node_partnroutes["Partner routes<br/>[partner.routes.ts]"]
end

subgraph group_domain["Product services"]
  node_authservice["Authentication<br/>[auth.service.ts]"]
  node_watchservice["Watchlist service"]
  node_marketservice["Market service<br/>[market.service.ts]"]
  node_digestservice["Digest service<br/>[digest.service.ts]"]
  node_storyservice["Story and reports<br/>[story.service.ts]"]
  node_partnerservice["Partner service<br/>[partner.service.ts]"]
  node_engine["Digest ranking<br/>[index.ts]"]
end

subgraph group_data["Data and providers"]
  node_speech["Speech synthesis<br/>[index.ts]"]
  node_marketdata["Market data providers<br/>[index.ts]"]
  node_news["News providers<br/>[index.ts]"]
  node_ai["Story model<br/>[index.ts]"]
end

subgraph group_runtime["Runtime support"]
  node_database[("Postgres<br/>[client.ts]")]
  node_worker["Prewarming<br/>[prewarm.service.ts]"]
  node_main["Composition root<br/>[main.ts]"]
end

node_user(("User"))
node_broker(("Broker partner"))

node_user -->|"uses"| node_webapp
node_webapp -->|"shows catch-up"| node_webdigest
node_webapp -->|"manages lists"| node_webwatch
node_webapp -->|"browses stocks"| node_webstock
node_webdigest -->|"requests data"| node_apiclient
node_webwatch -->|"requests data"| node_apiclient
node_webstock -->|"requests data"| node_apiclient
node_apiclient -->|"calls API"| node_httpapp
node_broker -->|"calls API"| node_partnroutes
node_httpapp -->|"registers routes"| node_authroutes
node_httpapp -->|"registers routes"| node_watchroutes
node_httpapp -->|"registers routes"| node_marketroutes
node_httpapp -->|"registers routes"| node_digestroutes
node_httpapp -->|"registers routes"| node_partnroutes
node_authroutes -->|"calls"| node_authservice
node_watchroutes -->|"calls"| node_watchservice
node_marketroutes -->|"calls"| node_marketservice
node_digestroutes -->|"calls"| node_digestservice
node_digestroutes -->|"calls"| node_storyservice
node_digestroutes -->|"synthesizes"| node_speech
node_partnroutes -->|"calls"| node_partnerservice
node_main -->|"builds"| node_httpapp
node_main -->|"constructs"| node_authservice
node_main -->|"constructs"| node_watchservice
node_main -->|"constructs"| node_marketservice
node_main -->|"constructs"| node_digestservice
node_main -->|"constructs"| node_storyservice
node_main -->|"constructs"| node_partnerservice
node_main -->|"selects provider"| node_marketdata
node_main -->|"selects provider"| node_news
node_main -->|"selects model"| node_ai
node_main -->|"selects provider"| node_speech
node_main -->|"connects"| node_database
node_marketservice -->|"uses data"| node_marketdata
node_storyservice -->|"retrieves sources"| node_news
node_storyservice -->|"writes story"| node_ai
node_digestservice -->|"ranks changes"| node_engine
node_worker -->|"warms market data"| node_marketservice
node_worker -->|"warms evidence"| node_news
node_worker -->|"reads symbols"| node_database

click node_webapp "https://github.com/saibhavani-git/since/tree/main/web/src/app"
click node_webdigest "https://github.com/saibhavani-git/since/tree/main/web/src/features/digest"
click node_webwatch "https://github.com/saibhavani-git/since/tree/main/web/src/features/watchlist"
click node_webstock "https://github.com/saibhavani-git/since/tree/main/web/src/features/stock"
click node_apiclient "https://github.com/saibhavani-git/since/blob/main/web/src/lib/api/client.ts"
click node_httpapp "https://github.com/saibhavani-git/since/blob/main/api/src/app.ts"
click node_authroutes "https://github.com/saibhavani-git/since/blob/main/api/src/modules/auth/auth.routes.ts"
click node_watchroutes "https://github.com/saibhavani-git/since/blob/main/api/src/modules/watchlist/watchlist.routes.ts"
click node_marketroutes "https://github.com/saibhavani-git/since/blob/main/api/src/modules/market/market.routes.ts"
click node_digestroutes "https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/digest.routes.ts"
click node_partnroutes "https://github.com/saibhavani-git/since/blob/main/api/src/modules/partner/partner.routes.ts"
click node_authservice "https://github.com/saibhavani-git/since/blob/main/api/src/modules/auth/auth.service.ts"
click node_watchservice "https://github.com/saibhavani-git/since/blob/main/api/src/modules/watchlist/watchlist.service.ts"
click node_marketservice "https://github.com/saibhavani-git/since/blob/main/api/src/modules/market/market.service.ts"
click node_digestservice "https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/digest.service.ts"
click node_storyservice "https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/story.service.ts"
click node_partnerservice "https://github.com/saibhavani-git/since/blob/main/api/src/modules/partner/partner.service.ts"
click node_engine "https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/engine/index.ts"
click node_speech "https://github.com/saibhavani-git/since/blob/main/api/src/providers/speech/index.ts"
click node_marketdata "https://github.com/saibhavani-git/since/blob/main/api/src/providers/market-data/index.ts"
click node_news "https://github.com/saibhavani-git/since/blob/main/api/src/providers/news/index.ts"
click node_ai "https://github.com/saibhavani-git/since/blob/main/api/src/providers/ai/index.ts"
click node_database "https://github.com/saibhavani-git/since/blob/main/api/src/db/client.ts"
click node_worker "https://github.com/saibhavani-git/since/blob/main/api/src/modules/prewarm/prewarm.service.ts"
click node_main "https://github.com/saibhavani-git/since/blob/main/api/src/main.ts"

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_webapp,node_webdigest,node_webwatch,node_webstock,node_apiclient,node_user toneBlue
class node_httpapp,node_authroutes,node_watchroutes,node_marketroutes,node_digestroutes,node_partnroutes toneAmber
class node_authservice,node_watchservice,node_marketservice,node_digestservice,node_storyservice,node_partnerservice,node_engine toneMint
class node_speech,node_marketdata,node_news,node_ai toneRose
class node_database,node_worker,node_main,node_broker toneIndigo
```

## Components

### Web experience

- [Since web app](https://github.com/saibhavani-git/since/tree/main/web/src/app): `web/src/app`
- [Catch-up UI](https://github.com/saibhavani-git/since/tree/main/web/src/features/digest): `web/src/features/digest`
- [Watchlist UI](https://github.com/saibhavani-git/since/tree/main/web/src/features/watchlist): `web/src/features/watchlist`
- [Stock views](https://github.com/saibhavani-git/since/tree/main/web/src/features/stock): `web/src/features/stock`
- [API client](https://github.com/saibhavani-git/since/blob/main/web/src/lib/api/client.ts): `web/src/lib/api/client.ts`

### API access

- [HTTP app](https://github.com/saibhavani-git/since/blob/main/api/src/app.ts): `api/src/app.ts`
- [Auth routes](https://github.com/saibhavani-git/since/blob/main/api/src/modules/auth/auth.routes.ts): `api/src/modules/auth/auth.routes.ts`
- [Watchlist routes](https://github.com/saibhavani-git/since/blob/main/api/src/modules/watchlist/watchlist.routes.ts): `api/src/modules/watchlist/watchlist.routes.ts`
- [Market routes](https://github.com/saibhavani-git/since/blob/main/api/src/modules/market/market.routes.ts): `api/src/modules/market/market.routes.ts`
- [Digest routes](https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/digest.routes.ts): `api/src/modules/digest/digest.routes.ts`
- [Partner routes](https://github.com/saibhavani-git/since/blob/main/api/src/modules/partner/partner.routes.ts): `api/src/modules/partner/partner.routes.ts`

### Product services

- [Authentication](https://github.com/saibhavani-git/since/blob/main/api/src/modules/auth/auth.service.ts): `api/src/modules/auth/auth.service.ts`
- [Watchlist service](https://github.com/saibhavani-git/since/blob/main/api/src/modules/watchlist/watchlist.service.ts): `api/src/modules/watchlist/watchlist.service.ts`
- [Market service](https://github.com/saibhavani-git/since/blob/main/api/src/modules/market/market.service.ts): `api/src/modules/market/market.service.ts`
- [Digest service](https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/digest.service.ts): `api/src/modules/digest/digest.service.ts`
- [Story and reports](https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/story.service.ts): `api/src/modules/digest/story.service.ts`
- [Partner service](https://github.com/saibhavani-git/since/blob/main/api/src/modules/partner/partner.service.ts): `api/src/modules/partner/partner.service.ts`
- [Digest ranking](https://github.com/saibhavani-git/since/blob/main/api/src/modules/digest/engine/index.ts): `api/src/modules/digest/engine/index.ts`

### Data and providers

- [Speech synthesis](https://github.com/saibhavani-git/since/blob/main/api/src/providers/speech/index.ts): `api/src/providers/speech/index.ts`
- [Market data providers](https://github.com/saibhavani-git/since/blob/main/api/src/providers/market-data/index.ts): `api/src/providers/market-data/index.ts`
- [News providers](https://github.com/saibhavani-git/since/blob/main/api/src/providers/news/index.ts): `api/src/providers/news/index.ts`
- [Story model](https://github.com/saibhavani-git/since/blob/main/api/src/providers/ai/index.ts): `api/src/providers/ai/index.ts`

### Runtime support

- [Postgres](https://github.com/saibhavani-git/since/blob/main/api/src/db/client.ts): `api/src/db/client.ts`
- [Prewarming](https://github.com/saibhavani-git/since/blob/main/api/src/modules/prewarm/prewarm.service.ts): `api/src/modules/prewarm/prewarm.service.ts`
- [Composition root](https://github.com/saibhavani-git/since/blob/main/api/src/main.ts): `api/src/main.ts`

### Other components

- **User**
- **Broker partner**

## Connections

- User → Since web app: uses
- Since web app → Catch-up UI: shows catch-up
- Since web app → Watchlist UI: manages lists
- Since web app → Stock views: browses stocks
- Catch-up UI → API client: requests data
- Watchlist UI → API client: requests data
- Stock views → API client: requests data
- API client → HTTP app: calls API
- Broker partner → Partner routes: calls API
- HTTP app → Auth routes: registers routes
- HTTP app → Watchlist routes: registers routes
- HTTP app → Market routes: registers routes
- HTTP app → Digest routes: registers routes
- HTTP app → Partner routes: registers routes
- Auth routes → Authentication: calls
- Watchlist routes → Watchlist service: calls
- Market routes → Market service: calls
- Digest routes → Digest service: calls
- Digest routes → Story and reports: calls
- Digest routes → Speech synthesis: synthesizes
- Partner routes → Partner service: calls
- Composition root → HTTP app: builds
- Composition root → Authentication: constructs
- Composition root → Watchlist service: constructs
- Composition root → Market service: constructs
- Composition root → Digest service: constructs
- Composition root → Story and reports: constructs
- Composition root → Partner service: constructs
- Composition root → Market data providers: selects provider
- Composition root → News providers: selects provider
- Composition root → Story model: selects model
- Composition root → Speech synthesis: selects provider
- Composition root → Postgres: connects
- Market service → Market data providers: uses data
- Story and reports → News providers: retrieves sources
- Story and reports → Story model: writes story
- Digest service → Digest ranking: ranks changes
- Prewarming → Market service: warms market data
- Prewarming → News providers: warms evidence
- Prewarming → Postgres: reads symbols
