# michadasis/generic-restaurant-app architecture

> Architecture diagram of the GitHub repository michadasis/generic-restaurant-app, 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/michadasis/generic-restaurant-app
- Repository: https://github.com/michadasis/generic-restaurant-app

## Overview

UoWM Restaurant Menu App is a mobile menu viewer: students open today’s lunch and dinner, browse adjacent days or jump to a calendar date, and can also submit and vote on suggestions. The menu is fetched from Supabase with an on-device cache fallback; Android widgets independently refresh and display today’s meal. Other documented capabilities include bilingual/theme preferences, seasonal closure notices, and GitHub release checks. The README supports the major unsampled screens and services; their detailed call wiring is therefore shown only where documented.

Main entry points: [`app/(tabs)/index.tsx`](https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/index.tsx) (Today menu), [`widget/widget-task-handler.ts`](https://github.com/michadasis/generic-restaurant-app/blob/main/widget/widget-task-handler.ts) (Widget refresh), [`data/menuService.ts`](https://github.com/michadasis/generic-restaurant-app/blob/main/data/menuService.ts) (Menu service), [`app/(tabs)/Calendar.tsx`](https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/Calendar.tsx) (Date calendar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_menu["Menu browsing"]
  node_home["Today menu<br/>[index.tsx]"]
  node_calendar["Date calendar<br/>[Calendar.tsx]"]
  node_menu_hook["Menu hook<br/>[menu.ts]"]
  node_menu_service["Menu service<br/>[menuService.ts]"]
  node_week["Cycle week<br/>[getWeek.ts]"]
  node_today["Today lookup<br/>[getToday.ts]"]
end

subgraph group_community["Student suggestions"]
  node_suggestions_screen["Suggestions screen<br/>[Suggestions.tsx]"]
  node_suggestions_hook["Suggestion actions<br/>[suggestions.ts]"]
  node_suggestions_service["Suggestions service"]
  node_vote_state[("Local vote state")]
end

subgraph group_presentation["App experience"]
  node_tabs["Tab navigation<br/>[_layout.tsx]"]
  node_root["App layout<br/>[_layout.tsx]"]
  node_preferences["Language and theme<br/>[i18n.ts]"]
end

subgraph group_widget["Home widgets"]
  node_widget_handler["Widget refresh"]
  node_compact_widget["Compact widget"]
  node_full_widget["Full widget"]
end

subgraph group_support["Updates and notices"]
  node_update_check["Release checker"]
  node_closure["Closure notice"]
end

node_student(("Student"))
node_menu_db[("Menu database")]
node_menu_cache[("Menu cache")]
node_suggestions_db[("Suggestions database")]
node_github["GitHub releases"]

node_student -->|"opens"| node_home
node_student -->|"chooses date"| node_calendar
node_student -->|"browses or posts"| node_suggestions_screen
node_home -->|"loads menu"| node_menu_hook
node_calendar -->|"loads menu"| node_menu_hook
node_menu_hook -->|"loads raw menu"| node_menu_service
node_menu_service -->|"fetches rows"| node_menu_db
node_menu_service -->|"reads or writes"| node_menu_cache
node_home -->|"finds cycle week"| node_week
node_calendar -->|"maps date to week"| node_week
node_home -->|"finds today"| node_today
node_suggestions_screen -->|"uses actions"| node_suggestions_hook
node_suggestions_hook -->|"fetches and submits"| node_suggestions_service
node_suggestions_service -->|"reads and writes"| node_suggestions_db
node_suggestions_hook -->|"stores vote choice"| node_vote_state
node_student -->|"navigates"| node_tabs
node_root -->|"sets up"| node_tabs
node_home -->|"uses translations"| node_preferences
node_widget_handler -->|"loads menu"| node_menu_service
node_widget_handler -->|"finds cycle week"| node_week
node_widget_handler -->|"finds today"| node_today
node_widget_handler -->|"renders compact"| node_compact_widget
node_widget_handler -->|"renders full"| node_full_widget
node_home -->|"gets notice"| node_closure
node_home -->|"checks release"| node_update_check
node_update_check -.->|"queries releases"| node_github

click node_home "https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/index.tsx"
click node_calendar "https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/Calendar.tsx"
click node_menu_hook "https://github.com/michadasis/generic-restaurant-app/blob/main/data/menu.ts"
click node_menu_service "https://github.com/michadasis/generic-restaurant-app/blob/main/data/menuService.ts"
click node_week "https://github.com/michadasis/generic-restaurant-app/blob/main/utils/getWeek.ts"
click node_today "https://github.com/michadasis/generic-restaurant-app/blob/main/utils/getToday.ts"
click node_suggestions_screen "https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/Suggestions.tsx"
click node_suggestions_hook "https://github.com/michadasis/generic-restaurant-app/blob/main/data/suggestions.ts"
click node_suggestions_service "https://github.com/michadasis/generic-restaurant-app/blob/main/data/suggestionsService.ts"
click node_tabs "https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/_layout.tsx"
click node_root "https://github.com/michadasis/generic-restaurant-app/blob/main/app/_layout.tsx"
click node_preferences "https://github.com/michadasis/generic-restaurant-app/blob/main/constants/i18n.ts"
click node_widget_handler "https://github.com/michadasis/generic-restaurant-app/blob/main/widget/widget-task-handler.ts"
click node_compact_widget "https://github.com/michadasis/generic-restaurant-app/blob/main/widget/TodayMenuCompactWidget.tsx"
click node_full_widget "https://github.com/michadasis/generic-restaurant-app/blob/main/widget/TodayMenuFullWidget.tsx"
click node_update_check "https://github.com/michadasis/generic-restaurant-app/blob/main/hooks/useUpdateChecker.ts"
click node_closure "https://github.com/michadasis/generic-restaurant-app/blob/main/utils/getClosureNotice.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_home,node_calendar,node_menu_hook,node_menu_service,node_week,node_today toneBlue
class node_suggestions_screen,node_suggestions_hook,node_suggestions_service,node_vote_state,node_menu_db,node_menu_cache,node_suggestions_db toneAmber
class node_tabs,node_root,node_preferences toneMint
class node_widget_handler,node_compact_widget,node_full_widget toneRose
class node_update_check,node_closure,node_student,node_github toneIndigo
```

## Components

### Menu browsing

- [Today menu](https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/index.tsx): `app/(tabs)/index.tsx`
- [Date calendar](https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/Calendar.tsx): `app/(tabs)/Calendar.tsx`
- [Menu hook](https://github.com/michadasis/generic-restaurant-app/blob/main/data/menu.ts): `data/menu.ts`
- [Menu service](https://github.com/michadasis/generic-restaurant-app/blob/main/data/menuService.ts): `data/menuService.ts`
- [Cycle week](https://github.com/michadasis/generic-restaurant-app/blob/main/utils/getWeek.ts): `utils/getWeek.ts`
- [Today lookup](https://github.com/michadasis/generic-restaurant-app/blob/main/utils/getToday.ts): `utils/getToday.ts`

### Student suggestions

- [Suggestions screen](https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/Suggestions.tsx): `app/(tabs)/Suggestions.tsx`
- [Suggestion actions](https://github.com/michadasis/generic-restaurant-app/blob/main/data/suggestions.ts): `data/suggestions.ts`
- [Suggestions service](https://github.com/michadasis/generic-restaurant-app/blob/main/data/suggestionsService.ts): `data/suggestionsService.ts`
- **Local vote state**

### App experience

- [Tab navigation](https://github.com/michadasis/generic-restaurant-app/blob/main/app/(tabs)/_layout.tsx): `app/(tabs)/_layout.tsx`
- [App layout](https://github.com/michadasis/generic-restaurant-app/blob/main/app/_layout.tsx): `app/_layout.tsx`
- [Language and theme](https://github.com/michadasis/generic-restaurant-app/blob/main/constants/i18n.ts): `constants/i18n.ts`

### Home widgets

- [Widget refresh](https://github.com/michadasis/generic-restaurant-app/blob/main/widget/widget-task-handler.ts): `widget/widget-task-handler.ts`
- [Compact widget](https://github.com/michadasis/generic-restaurant-app/blob/main/widget/TodayMenuCompactWidget.tsx): `widget/TodayMenuCompactWidget.tsx`
- [Full widget](https://github.com/michadasis/generic-restaurant-app/blob/main/widget/TodayMenuFullWidget.tsx): `widget/TodayMenuFullWidget.tsx`

### Updates and notices

- [Release checker](https://github.com/michadasis/generic-restaurant-app/blob/main/hooks/useUpdateChecker.ts): `hooks/useUpdateChecker.ts`
- [Closure notice](https://github.com/michadasis/generic-restaurant-app/blob/main/utils/getClosureNotice.ts): `utils/getClosureNotice.ts`

### Other components

- **Student**
- **Menu database**
- **Menu cache**
- **Suggestions database**
- **GitHub releases**

## Connections

- Student → Today menu: opens
- Student → Date calendar: chooses date
- Student → Suggestions screen: browses or posts
- Today menu → Menu hook: loads menu
- Date calendar → Menu hook: loads menu
- Menu hook → Menu service: loads raw menu
- Menu service → Menu database: fetches rows
- Menu service → Menu cache: reads or writes
- Today menu → Cycle week: finds cycle week
- Date calendar → Cycle week: maps date to week
- Today menu → Today lookup: finds today
- Suggestions screen → Suggestion actions: uses actions
- Suggestion actions → Suggestions service: fetches and submits
- Suggestions service → Suggestions database: reads and writes
- Suggestion actions → Local vote state: stores vote choice
- Student → Tab navigation: navigates
- App layout → Tab navigation: sets up
- Today menu → Language and theme: uses translations
- Widget refresh → Menu service: loads menu
- Widget refresh → Cycle week: finds cycle week
- Widget refresh → Today lookup: finds today
- Widget refresh → Compact widget: renders compact
- Widget refresh → Full widget: renders full
- Today menu → Closure notice: gets notice
- Today menu → Release checker: checks release
- Release checker → GitHub releases: queries releases
