# niteboy17/wallet-app architecture

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

- Interactive diagram: https://gitdiagram.com/niteboy17/wallet-app
- Repository: https://github.com/niteboy17/wallet-app

## Overview

Wallet App is a personal-finance tracker whose main workflow is signing in, recording income or expenses, and reviewing transaction history and calculated totals. The mobile app also exposes configurable presets and an app-date control for testing monthly automation; backend services apply preset entries and monthly balance rollovers. The mobile client communicates with an Express API, which stores transaction and automation state in a SQL database. Clerk, Redis rate limiting, and scheduled rollover are documented or represented in the source index; some connections to unsampled screens and services are therefore shown only where supported by documentation.

Main entry points: [`backend/src/server.js`](https://github.com/niteboy17/wallet-app/blob/main/backend/src/server.js) (Express server), [`mobile/hooks/useTransactions.js`](https://github.com/niteboy17/wallet-app/blob/main/mobile/hooks/useTransactions.js) (Transaction data hook), [`backend/src/config/db.js`](https://github.com/niteboy17/wallet-app/blob/main/backend/src/config/db.js) (SQL connection and schema), [`mobile/app/(root)/presets.jsx`](https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(root)/presets.jsx) (Automation presets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile experience"]
  node_signin["Sign in<br/>[sign-in.jsx]"]
  node_signup["Sign up<br/>[sign-up.jsx]"]
  node_home["Home and history<br/>[index.jsx]"]
  node_transactionform["Transaction entry<br/>[create.jsx]"]
  node_appdate["App date state<br/>[AppDateContext.jsx]"]
  node_transactionhook["Transaction data hook<br/>[useTransactions.js]"]
  node_apiurl["API endpoint config<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_server["Express server<br/>[server.js]"]
  node_routes["Transaction routes"]
  node_controller["Transaction handlers"]
  node_limiter["Rate limiter<br/>[rateLimiter.js]"]
end

subgraph group_automation["Monthly automation"]
  node_automationui["Automation presets<br/>[presets.jsx]"]
  node_automationhandler["Automation service"]
  node_rollover["Monthly rollover<br/>[monthlyRollover.js]"]
  node_cron["Rollover scheduler<br/>[cron.js]"]
end

subgraph group_state["Data and infrastructure"]
  node_sqlconfig["SQL connection and schema<br/>[db.js]"]
  node_database[("SQL database")]
  node_redisconfig["Redis configuration<br/>[upstash.js]"]
end

node_user(("Wallet user"))
node_clerk{{"Clerk auth"}}
node_upstash[("Upstash Redis")]

node_user -->|"signs in"| node_signin
node_user -->|"creates account"| node_signup
node_signin -->|"authenticates with"| node_clerk
node_signup -->|"registers with"| node_clerk
node_user -->|"reviews activity"| node_home
node_home -->|"loads transactions"| node_transactionhook
node_home -->|"opens entry"| node_transactionform
node_transactionform -.->|"submits transaction"| node_server
node_user -->|"configures presets"| node_automationui
node_automationui -->|"loads summary"| node_transactionhook
node_automationui -->|"sets app date"| node_appdate
node_automationui -->|"requests automation"| node_server
node_transactionhook -->|"uses endpoint"| node_apiurl
node_transactionhook -->|"reads date"| node_appdate
node_transactionhook -->|"fetches data"| node_server
node_server -->|"mounts routes"| node_routes
node_server -->|"applies limiter"| node_limiter
node_server -->|"initializes database"| node_sqlconfig
node_server -->|"starts scheduler"| node_cron
node_routes -->|"dispatches requests"| node_controller
node_controller -->|"queries and writes"| node_sqlconfig
node_controller -->|"runs automation"| node_automationhandler
node_automationhandler -->|"queries and writes"| node_sqlconfig
node_automationhandler -->|"ensures rollover"| node_rollover
node_cron -->|"schedules rollover"| node_rollover
node_rollover -->|"reads and writes"| node_sqlconfig
node_sqlconfig -->|"connects to"| node_database
node_limiter -->|"uses configuration"| node_redisconfig
node_redisconfig -.->|"connects to"| node_upstash

click node_signin "https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(auth)/sign-in.jsx"
click node_signup "https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(auth)/sign-up.jsx"
click node_home "https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(root)/index.jsx"
click node_transactionform "https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(root)/create.jsx"
click node_automationui "https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(root)/presets.jsx"
click node_appdate "https://github.com/niteboy17/wallet-app/blob/main/mobile/context/AppDateContext.jsx"
click node_transactionhook "https://github.com/niteboy17/wallet-app/blob/main/mobile/hooks/useTransactions.js"
click node_apiurl "https://github.com/niteboy17/wallet-app/blob/main/mobile/constants/api.js"
click node_server "https://github.com/niteboy17/wallet-app/blob/main/backend/src/server.js"
click node_routes "https://github.com/niteboy17/wallet-app/blob/main/backend/src/routes/transactionsRoute.js"
click node_controller "https://github.com/niteboy17/wallet-app/blob/main/backend/src/controllers/transactionsController.js"
click node_limiter "https://github.com/niteboy17/wallet-app/blob/main/backend/src/middleware/rateLimiter.js"
click node_automationhandler "https://github.com/niteboy17/wallet-app/blob/main/backend/src/services/monthlyAutomation.js"
click node_rollover "https://github.com/niteboy17/wallet-app/blob/main/backend/src/services/monthlyRollover.js"
click node_cron "https://github.com/niteboy17/wallet-app/blob/main/backend/src/config/cron.js"
click node_sqlconfig "https://github.com/niteboy17/wallet-app/blob/main/backend/src/config/db.js"
click node_redisconfig "https://github.com/niteboy17/wallet-app/blob/main/backend/src/config/upstash.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_signin,node_signup,node_home,node_transactionform,node_appdate,node_transactionhook,node_apiurl,node_user toneBlue
class node_server,node_routes,node_controller,node_limiter,node_upstash toneAmber
class node_automationui,node_automationhandler,node_rollover,node_cron toneMint
class node_sqlconfig,node_database,node_redisconfig toneRose
class node_clerk toneIndigo
```

## Components

### Mobile experience

- [Sign in](https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(auth)/sign-in.jsx): `mobile/app/(auth)/sign-in.jsx`
- [Sign up](https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(auth)/sign-up.jsx): `mobile/app/(auth)/sign-up.jsx`
- [Home and history](https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(root)/index.jsx): `mobile/app/(root)/index.jsx`
- [Transaction entry](https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(root)/create.jsx): `mobile/app/(root)/create.jsx`
- [App date state](https://github.com/niteboy17/wallet-app/blob/main/mobile/context/AppDateContext.jsx): `mobile/context/AppDateContext.jsx`
- [Transaction data hook](https://github.com/niteboy17/wallet-app/blob/main/mobile/hooks/useTransactions.js): `mobile/hooks/useTransactions.js`
- [API endpoint config](https://github.com/niteboy17/wallet-app/blob/main/mobile/constants/api.js): `mobile/constants/api.js`

### Backend API

- [Express server](https://github.com/niteboy17/wallet-app/blob/main/backend/src/server.js): `backend/src/server.js`
- [Transaction routes](https://github.com/niteboy17/wallet-app/blob/main/backend/src/routes/transactionsRoute.js): `backend/src/routes/transactionsRoute.js`
- [Transaction handlers](https://github.com/niteboy17/wallet-app/blob/main/backend/src/controllers/transactionsController.js): `backend/src/controllers/transactionsController.js`
- [Rate limiter](https://github.com/niteboy17/wallet-app/blob/main/backend/src/middleware/rateLimiter.js): `backend/src/middleware/rateLimiter.js`

### Monthly automation

- [Automation presets](https://github.com/niteboy17/wallet-app/blob/main/mobile/app/(root)/presets.jsx): `mobile/app/(root)/presets.jsx`
- [Automation service](https://github.com/niteboy17/wallet-app/blob/main/backend/src/services/monthlyAutomation.js): `backend/src/services/monthlyAutomation.js`
- [Monthly rollover](https://github.com/niteboy17/wallet-app/blob/main/backend/src/services/monthlyRollover.js): `backend/src/services/monthlyRollover.js`
- [Rollover scheduler](https://github.com/niteboy17/wallet-app/blob/main/backend/src/config/cron.js): `backend/src/config/cron.js`

### Data and infrastructure

- [SQL connection and schema](https://github.com/niteboy17/wallet-app/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- **SQL database**
- [Redis configuration](https://github.com/niteboy17/wallet-app/blob/main/backend/src/config/upstash.js): `backend/src/config/upstash.js`

### Other components

- **Wallet user**
- **Clerk auth**
- **Upstash Redis**

## Connections

- Wallet user → Sign in: signs in (evidence: `README.md`)
- Wallet user → Sign up: creates account (evidence: `README.md`)
- Sign in → Clerk auth: authenticates with (evidence: `README.md`)
- Sign up → Clerk auth: registers with (evidence: `README.md`)
- Wallet user → Home and history: reviews activity (evidence: `README.md`)
- Home and history → Transaction data hook: loads transactions (evidence: `mobile/app/(root)/index.jsx`)
- Home and history → Transaction entry: opens entry (evidence: `mobile/app/(root)/index.jsx`)
- Transaction entry → Express server: submits transaction
- Wallet user → Automation presets: configures presets (evidence: `README.md`)
- Automation presets → Transaction data hook: loads summary (evidence: `mobile/app/(root)/presets.jsx`)
- Automation presets → App date state: sets app date (evidence: `mobile/app/(root)/presets.jsx`)
- Automation presets → Express server: requests automation (evidence: `mobile/app/(root)/presets.jsx`)
- Transaction data hook → API endpoint config: uses endpoint (evidence: `mobile/hooks/useTransactions.js`)
- Transaction data hook → App date state: reads date (evidence: `mobile/hooks/useTransactions.js`)
- Transaction data hook → Express server: fetches data (evidence: `mobile/hooks/useTransactions.js`)
- Express server → Transaction routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Rate limiter: applies limiter (evidence: `backend/src/server.js`)
- Express server → SQL connection and schema: initializes database (evidence: `backend/src/server.js`)
- Express server → Rollover scheduler: starts scheduler (evidence: `backend/src/server.js`)
- Transaction routes → Transaction handlers: dispatches requests (evidence: `backend/src/routes/transactionsRoute.js`)
- Transaction handlers → SQL connection and schema: queries and writes (evidence: `backend/src/controllers/transactionsController.js`)
- Transaction handlers → Automation service: runs automation (evidence: `backend/src/controllers/transactionsController.js`)
- Automation service → SQL connection and schema: queries and writes (evidence: `backend/src/services/monthlyAutomation.js`)
- Automation service → Monthly rollover: ensures rollover (evidence: `backend/src/services/monthlyAutomation.js`)
- Rollover scheduler → Monthly rollover: schedules rollover (evidence: `backend/src/config/cron.js`)
- Monthly rollover → SQL connection and schema: reads and writes (evidence: `backend/src/services/monthlyRollover.js`)
- SQL connection and schema → SQL database: connects to (evidence: `README.md`)
- Rate limiter → Redis configuration: uses configuration (evidence: `backend/src/middleware/rateLimiter.js`)
- Redis configuration → Upstash Redis: connects to (evidence: `README.md`)
