# sujanirig-web/relife-entry-book architecture

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

- Interactive diagram: https://gitdiagram.com/sujanirig-web/relife-entry-book
- Repository: https://github.com/sujanirig-web/relife-entry-book

## Overview

RE-LiFE is a mobile repair-entry and repair-record management app. Staff use the browser app to enter and review repairs, navigate records by date, search, inspect business totals, and view change logs; repair photos can be uploaded. The browser app also synchronizes search records through a Worker API, which protects staff-only endpoints and connects to Algolia and ImgBB. The excerpts show these responsibilities but omit much of app.js, so links for unsampled repair operations are not asserted.

Main entry points: [`app.js`](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js) (Repair app), [`worker/index.js`](https://github.com/sujanirig-web/relife-entry-book/blob/main/worker/index.js) (API router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Staff app"]
  node_app["Repair app<br/>[app.js]"]
  node_entry["Repair entry<br/>[app.js]"]
  node_records["Repair records<br/>[app.js]"]
  node_calendar["Date navigation<br/>[app.js]"]
  node_search["Repair search<br/>[app.js]"]
  node_metrics["Revenue and due<br/>[app.js]"]
  node_logs["Change logs<br/>[app.js]"]
  node_photos["Photo handling<br/>[app.js]"]
end

subgraph group_api["Worker API"]
  node_worker["API router<br/>[index.js]"]
  node_verify["Staff verification<br/>[index.js]"]
end

subgraph group_services["External services"]
  node_auth["Firebase auth"]
  node_firestore[("Firestore")]
  node_algolia[("Algolia index")]
  node_imgbb["ImgBB"]
  node_googlekeys["Google signing keys"]
end

node_staff(("Staff member"))

node_staff -->|"uses"| node_app
node_app -->|"presents"| node_entry
node_app -->|"manages"| node_records
node_app -->|"navigates"| node_calendar
node_app -->|"searches via"| node_search
node_app -->|"displays"| node_metrics
node_app -->|"loads and writes"| node_logs
node_app -->|"previews"| node_photos
node_app -->|"gets tokens"| node_auth
node_app -->|"reads and writes"| node_firestore
node_app -->|"calls endpoints"| node_worker
node_worker -->|"guards routes"| node_verify
node_verify -->|"fetches keys"| node_googlekeys
node_worker -->|"searches and updates"| node_algolia
node_worker -->|"uploads images"| node_imgbb

click node_app "https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js"
click node_entry "https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js"
click node_records "https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js"
click node_calendar "https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js"
click node_search "https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js"
click node_metrics "https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js"
click node_logs "https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js"
click node_photos "https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js"
click node_worker "https://github.com/sujanirig-web/relife-entry-book/blob/main/worker/index.js"
click node_verify "https://github.com/sujanirig-web/relife-entry-book/blob/main/worker/index.js"

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_entry,node_records,node_calendar,node_search,node_metrics,node_logs,node_photos toneBlue
class node_worker,node_verify toneAmber
class node_auth,node_firestore,node_algolia,node_imgbb,node_googlekeys toneMint
class node_staff toneIndigo
```

## Components

### Staff app

- [Repair app](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js): `app.js`
- [Repair entry](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js): `app.js`
- [Repair records](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js): `app.js`
- [Date navigation](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js): `app.js`
- [Repair search](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js): `app.js`
- [Revenue and due](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js): `app.js`
- [Change logs](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js): `app.js`
- [Photo handling](https://github.com/sujanirig-web/relife-entry-book/blob/main/app.js): `app.js`

### Worker API

- [API router](https://github.com/sujanirig-web/relife-entry-book/blob/main/worker/index.js): `worker/index.js`
- [Staff verification](https://github.com/sujanirig-web/relife-entry-book/blob/main/worker/index.js): `worker/index.js`

### External services

- **Firebase auth**
- **Firestore**
- **Algolia index**
- **ImgBB**
- **Google signing keys**

### Other components

- **Staff member**

## Connections

- Staff member → Repair app: uses
- Repair app → Repair entry: presents (evidence: `app.js`)
- Repair app → Repair records: manages (evidence: `app.js`)
- Repair app → Date navigation: navigates (evidence: `app.js`)
- Repair app → Repair search: searches via (evidence: `app.js`)
- Repair app → Revenue and due: displays (evidence: `app.js`)
- Repair app → Change logs: loads and writes (evidence: `app.js`)
- Repair app → Photo handling: previews (evidence: `app.js`)
- Repair app → Firebase auth: gets tokens (evidence: `app.js`)
- Repair app → Firestore: reads and writes (evidence: `app.js`)
- Repair app → API router: calls endpoints (evidence: `app.js`)
- API router → Staff verification: guards routes (evidence: `worker/index.js`)
- Staff verification → Google signing keys: fetches keys (evidence: `worker/index.js`)
- API router → Algolia index: searches and updates (evidence: `worker/index.js`)
- API router → ImgBB: uploads images (evidence: `worker/index.js`)
