# rilda-r/smart_shared_grocery_manager architecture

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

- Interactive diagram: https://gitdiagram.com/rilda-r/smart_shared_grocery_manager
- Repository: https://github.com/rilda-r/smart_shared_grocery_manager

## Overview

GrocEase is a Streamlit grocery-sharing application whose implemented runtime is currently centered on account access: users register, verify an email code, log in, and manage their session or account. The dashboard mentions shared-group activity and personal spending, but presents them as placeholders; the README also mentions OCR and product assignment without implementation detail in the supplied tree. The graph focuses on implemented authentication and account flows, with those documented/visible product areas called out as unimplemented. Relationships are limited to imports, calls, and page navigation shown in excerpts.

Main entry points: [`pages/01_Login.py`](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/01_Login.py) (Login page), [`app.py`](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/app.py) (Login and dashboard), [`pages/02_Create_Account.py`](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/02_Create_Account.py) (Account creation), [`pages/03_Verify_Email.py`](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/03_Verify_Email.py) (Email verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Streamlit interface"]
  node_launch["Login and dashboard<br/>[app.py]"]
  node_login["Login page<br/>[01_Login.py]"]
  node_logout["Logout page<br/>[05_Logout.py]"]
  node_groups["Shared group activity<br/>[app.py]"]
  node_spending["Personal spend tracker<br/>[app.py]"]
  node_ocr["OCR capability"]
  node_assignment["Product assignment"]
end

subgraph group_auth["Account access"]
  node_register["Account creation"]
  node_verify["Email verification<br/>[03_Verify_Email.py]"]
  node_forgot["Password recovery"]
  node_auth_rules["Email and OTP rules<br/>[authentication.py]"]
  node_passwords["Password hashing<br/>[password_hash.py]"]
end

subgraph group_data["Account persistence"]
  node_account_store[("User accounts<br/>[database.py]")]
end

subgraph group_internal["Shared runtime"]
  node_session["Session timeout<br/>[session_manager.py]"]
  node_styling["Shared styling<br/>[style.py]"]
end

node_user(("GrocEase user"))

node_user -->|"opens"| node_launch
node_user -->|"opens"| node_login
node_user -->|"registers"| node_register
node_register -->|"validates and generates OTP"| node_auth_rules
node_register -->|"hashes password"| node_passwords
node_register -->|"creates account; stores OTP"| node_account_store
node_register -->|"routes to"| node_verify
node_verify -->|"reads and verifies account"| node_account_store
node_verify -->|"checks OTP expiry"| node_auth_rules
node_verify -->|"routes to"| node_login
node_login -->|"reads account; updates lockout"| node_account_store
node_login -->|"checks password"| node_passwords
node_login -->|"routes unverified users"| node_verify
node_launch -->|"initializes and reads accounts"| node_account_store
node_launch -->|"checks password"| node_passwords
node_login -->|"checks timeout"| node_session
node_register -->|"checks timeout"| node_session
node_verify -->|"checks timeout"| node_session
node_session -->|"routes expired session"| node_logout
node_launch -->|"deletes account"| node_account_store
node_login -->|"deletes account"| node_account_store
node_logout -->|"routes back"| node_login
node_launch -->|"renders placeholder"| node_groups
node_launch -->|"renders placeholder"| node_spending
node_user -->|"can open"| node_forgot
node_launch -->|"applies style and navigation"| node_styling
node_login -->|"applies style and navigation"| node_styling
node_register -->|"applies style and navigation"| node_styling
node_verify -->|"applies style and navigation"| node_styling
node_logout -->|"applies style and navigation"| node_styling

click node_launch "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/app.py"
click node_login "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/01_Login.py"
click node_register "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/02_Create_Account.py"
click node_verify "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/03_Verify_Email.py"
click node_forgot "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/04_Forgot_Password.py"
click node_logout "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/05_Logout.py"
click node_groups "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/app.py"
click node_spending "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/app.py"
click node_account_store "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/database/database.py"
click node_auth_rules "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/security/authentication.py"
click node_passwords "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/security/password_hash.py"
click node_session "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/session_manager.py"
click node_styling "https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/style.py"

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_launch,node_login,node_logout,node_groups,node_spending,node_ocr,node_assignment,node_user toneBlue
class node_register,node_verify,node_forgot,node_auth_rules,node_passwords toneAmber
class node_account_store toneMint
class node_session,node_styling toneRose
```

## Components

### Streamlit interface

- [Login and dashboard](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/app.py): `app.py`
- [Login page](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/01_Login.py): `pages/01_Login.py`
- [Logout page](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/05_Logout.py): `pages/05_Logout.py`
- [Shared group activity](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/app.py): `app.py`
- [Personal spend tracker](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/app.py): `app.py`
- **OCR capability**
- **Product assignment**

### Account access

- [Account creation](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/02_Create_Account.py): `pages/02_Create_Account.py`
- [Email verification](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/03_Verify_Email.py): `pages/03_Verify_Email.py`
- [Password recovery](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/pages/04_Forgot_Password.py): `pages/04_Forgot_Password.py`
- [Email and OTP rules](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/security/authentication.py): `security/authentication.py`
- [Password hashing](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/security/password_hash.py): `security/password_hash.py`

### Account persistence

- [User accounts](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/database/database.py): `database/database.py`

### Shared runtime

- [Session timeout](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/session_manager.py): `session_manager.py`
- [Shared styling](https://github.com/rilda-r/smart_shared_grocery_manager/blob/main/style.py): `style.py`

### Other components

- **GrocEase user**

## Connections

- GrocEase user → Login and dashboard: opens (evidence: `app.py`)
- GrocEase user → Login page: opens (evidence: `pages/01_Login.py`)
- GrocEase user → Account creation: registers (evidence: `pages/02_Create_Account.py`)
- Account creation → Email and OTP rules: validates and generates OTP (evidence: `pages/02_Create_Account.py`)
- Account creation → Password hashing: hashes password (evidence: `pages/02_Create_Account.py`)
- Account creation → User accounts: creates account; stores OTP (evidence: `pages/02_Create_Account.py`)
- Account creation → Email verification: routes to (evidence: `pages/02_Create_Account.py`)
- Email verification → User accounts: reads and verifies account (evidence: `pages/03_Verify_Email.py`)
- Email verification → Email and OTP rules: checks OTP expiry (evidence: `pages/03_Verify_Email.py`)
- Email verification → Login page: routes to (evidence: `pages/03_Verify_Email.py`)
- Login page → User accounts: reads account; updates lockout (evidence: `pages/01_Login.py`)
- Login page → Password hashing: checks password (evidence: `pages/01_Login.py`)
- Login page → Email verification: routes unverified users (evidence: `pages/01_Login.py`)
- Login and dashboard → User accounts: initializes and reads accounts (evidence: `app.py`)
- Login and dashboard → Password hashing: checks password (evidence: `app.py`)
- Login page → Session timeout: checks timeout (evidence: `pages/01_Login.py`)
- Account creation → Session timeout: checks timeout (evidence: `pages/02_Create_Account.py`)
- Email verification → Session timeout: checks timeout (evidence: `pages/03_Verify_Email.py`)
- Session timeout → Logout page: routes expired session (evidence: `session_manager.py`)
- Login and dashboard → User accounts: deletes account (evidence: `app.py`)
- Login page → User accounts: deletes account (evidence: `pages/01_Login.py`)
- Logout page → Login page: routes back (evidence: `pages/05_Logout.py`)
- Login and dashboard → Shared group activity: renders placeholder (evidence: `app.py`)
- Login and dashboard → Personal spend tracker: renders placeholder (evidence: `app.py`)
- GrocEase user → Password recovery: can open
- Login and dashboard → Shared styling: applies style and navigation (evidence: `app.py`)
- Login page → Shared styling: applies style and navigation (evidence: `pages/01_Login.py`)
- Account creation → Shared styling: applies style and navigation (evidence: `pages/02_Create_Account.py`)
- Email verification → Shared styling: applies style and navigation (evidence: `pages/03_Verify_Email.py`)
- Logout page → Shared styling: applies style and navigation (evidence: `pages/05_Logout.py`)
