# michaelvu1207/optimat-front-sk architecture

> Architecture diagram of the GitHub repository michaelvu1207/optimat-front-sk, 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/michaelvu1207/optimat-front-sk
- Repository: https://github.com/michaelvu1207/optimat-front-sk

## Overview

OPTIMAT helps seniors and people with disabilities find transportation providers for trips in Contra Costa County. Its main workflow is a rider using the web app to search providers or ask the assistant about a trip, then viewing provider or route results. The product also includes provider self-service and trip-record analytics, alongside location, voice, and administrative API capabilities. The README documents the AWS runtime; sampled source supports selected frontend and API links. Other backend wiring is shown only where documented or evident from the tree.

Main entry points: [`src/App.svelte`](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/App.svelte) (Web app), [`src/lib/api.ts`](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/lib/api.ts) (API client), [`src/routes/ChatView.svelte`](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/ChatView.svelte) (Trip assistant), [`src/components/ProviderResults.svelte`](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/components/ProviderResults.svelte) (Provider results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web app<br/>[App.svelte]"]
  node_chatview["Trip assistant<br/>[ChatView.svelte]"]
  node_providerresults["Provider results"]
  node_routeview["Route dashboard"]
  node_portal["Provider portal"]
  node_trippairs["Trip analytics<br/>[TripPairs.svelte]"]
  node_client["API client<br/>[api.ts]"]
end

subgraph group_api["Public API"]
  node_gateway["API Gateway"]
  node_providers["Provider API<br/>[index.ts]"]
  node_chat["Chat API<br/>[index.ts]"]
  node_directions["Directions API<br/>[index.ts]"]
  node_transcribe["Voice API<br/>[index.ts]"]
  node_records["Trip records API<br/>[index.ts]"]
  node_feedback["Feedback API<br/>[index.ts]"]
  node_admin["Provider admin API<br/>[index.ts]"]
end

subgraph group_data["Provider and trip data"]
  node_db[("Aurora PostgreSQL")]
end

subgraph group_integrations["External services"]
  node_bedrock["Amazon Bedrock"]
  node_location["Amazon Location"]
  node_speech["Amazon Transcribe"]
end

node_rider(("Rider"))

node_rider -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_chatview
node_webapp -->|"shows"| node_providerresults
node_webapp -->|"routes to"| node_routeview
node_webapp -->|"routes to"| node_portal
node_webapp -->|"routes to"| node_trippairs
node_chatview -->|"requests"| node_client
node_providerresults -->|"requests"| node_client
node_routeview -->|"requests"| node_client
node_portal -->|"requests"| node_client
node_trippairs -->|"requests"| node_client
node_client -->|"calls"| node_gateway
node_gateway -->|"dispatches"| node_providers
node_gateway -->|"dispatches"| node_chat
node_gateway -->|"dispatches"| node_directions
node_gateway -->|"dispatches"| node_transcribe
node_gateway -->|"dispatches"| node_records
node_gateway -->|"dispatches"| node_feedback
node_gateway -->|"dispatches"| node_admin
node_providers -->|"reads and writes"| node_db
node_records -->|"queries"| node_db
node_chat -->|"uses"| node_bedrock
node_directions -->|"uses"| node_location
node_transcribe -->|"transcribes"| node_speech

click node_webapp "https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/App.svelte"
click node_chatview "https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/ChatView.svelte"
click node_providerresults "https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/components/ProviderResults.svelte"
click node_routeview "https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/UniversalServiceDashboard.svelte"
click node_portal "https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/ProviderPortal.svelte"
click node_trippairs "https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/TripPairs.svelte"
click node_client "https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/lib/api.ts"
click node_providers "https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/providers/index.ts"
click node_chat "https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/chat/index.ts"
click node_directions "https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/directions/index.ts"
click node_transcribe "https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/transcribe/index.ts"
click node_records "https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/trip-records/index.ts"
click node_feedback "https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/feedback/index.ts"
click node_admin "https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/provider-import-admin/index.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_chatview,node_providerresults,node_routeview,node_portal,node_trippairs,node_client toneBlue
class node_gateway,node_providers,node_chat,node_directions,node_transcribe,node_records,node_feedback,node_admin toneAmber
class node_db toneMint
class node_bedrock,node_location,node_speech toneRose
class node_rider toneIndigo
```

## Components

### Web experience

- [Web app](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/App.svelte): `src/App.svelte`
- [Trip assistant](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/ChatView.svelte): `src/routes/ChatView.svelte`
- [Provider results](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/components/ProviderResults.svelte): `src/components/ProviderResults.svelte`
- [Route dashboard](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/UniversalServiceDashboard.svelte): `src/routes/UniversalServiceDashboard.svelte`
- [Provider portal](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/ProviderPortal.svelte): `src/routes/ProviderPortal.svelte`
- [Trip analytics](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/routes/TripPairs.svelte): `src/routes/TripPairs.svelte`
- [API client](https://github.com/michaelvu1207/optimat-front-sk/blob/master/src/lib/api.ts): `src/lib/api.ts`

### Public API

- **API Gateway**
- [Provider API](https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/providers/index.ts): `infra/lambda/providers/index.ts`
- [Chat API](https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/chat/index.ts): `infra/lambda/chat/index.ts`
- [Directions API](https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/directions/index.ts): `infra/lambda/directions/index.ts`
- [Voice API](https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/transcribe/index.ts): `infra/lambda/transcribe/index.ts`
- [Trip records API](https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/trip-records/index.ts): `infra/lambda/trip-records/index.ts`
- [Feedback API](https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/feedback/index.ts): `infra/lambda/feedback/index.ts`
- [Provider admin API](https://github.com/michaelvu1207/optimat-front-sk/blob/master/infra/lambda/provider-import-admin/index.ts): `infra/lambda/provider-import-admin/index.ts`

### Provider and trip data

- **Aurora PostgreSQL**

### External services

- **Amazon Bedrock**
- **Amazon Location**
- **Amazon Transcribe**

### Other components

- **Rider**

## Connections

- Rider → Web app: uses
- Web app → Trip assistant: routes to
- Web app → Provider results: shows
- Web app → Route dashboard: routes to
- Web app → Provider portal: routes to
- Web app → Trip analytics: routes to
- Trip assistant → API client: requests
- Provider results → API client: requests
- Route dashboard → API client: requests
- Provider portal → API client: requests
- Trip analytics → API client: requests
- API client → API Gateway: calls
- API Gateway → Provider API: dispatches
- API Gateway → Chat API: dispatches
- API Gateway → Directions API: dispatches
- API Gateway → Voice API: dispatches
- API Gateway → Trip records API: dispatches
- API Gateway → Feedback API: dispatches
- API Gateway → Provider admin API: dispatches
- Provider API → Aurora PostgreSQL: reads and writes
- Trip records API → Aurora PostgreSQL: queries
- Chat API → Amazon Bedrock: uses
- Directions API → Amazon Location: uses
- Voice API → Amazon Transcribe: transcribes
