# semjanivnikola/smart-money architecture

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

- Interactive diagram: https://gitdiagram.com/semjanivnikola/smart-money
- Repository: https://github.com/semjanivnikola/smart-money

## Overview

Smart Money is a Next.js personal-finance interface for authentication, account and wallet overviews, payment creation, transaction records, and analytics. The main user flow enters the authenticated area, chooses a payment type, fills in payment or shopping-invoice details, and reviews payment information; separate screens expose accounts, wallets, transactions, and analytics. The tree supports these product areas, but most page and API implementations were not sampled, so uncertain page-to-API wiring is omitted. The sampled authentication code does show a credentials request to an external backend.

Main entry points: [`app/(main)/payments/create/page.tsx`](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/page.tsx) (Payment type chooser), [`app/(auth)/sign-in/page.tsx`](https://github.com/semjanivnikola/smart-money/blob/develop/app/(auth)/sign-in/page.tsx) (Sign-in / sign-up), [`app/(main)/layout.tsx`](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/layout.tsx) (Finance workspace), [`app/(main)/payments/create/(payment-types)/regular/page.tsx`](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/regular/page.tsx) (Regular payment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access"]
  node_auth_pages["Sign-in / sign-up<br/>[page.tsx]"]
  node_auth_forms["Auth forms<br/>[SignInForm.tsx]"]
end

subgraph group_finance["Finance workspace"]
  node_workspace["Finance workspace<br/>[layout.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_accounts["Accounts<br/>[page.tsx]"]
  node_wallets["Wallets<br/>[page.tsx]"]
  node_analytics["Analytics<br/>[page.tsx]"]
  node_transactions["Transactions<br/>[page.tsx]"]
  node_receipt["Transaction receipt<br/>[page.tsx]"]
end

subgraph group_payment["Payment flows"]
  node_payment_list["Payment records<br/>[page.tsx]"]
  node_payment_types["Payment type chooser<br/>[page.tsx]"]
  node_payment_wizard["Payment wizard<br/>[PaymentWizard.tsx]"]
  node_regular_payment["Regular payment<br/>[page.tsx]"]
  node_payment_review["Review and pay<br/>[page.tsx]"]
  node_transfer["Internal transfer<br/>[page.tsx]"]
  node_shopping_payment["Shopping payment<br/>[page.tsx]"]
  node_shopping_form["Invoice details"]
  node_shopping_draft["Shopping draft"]
end

subgraph group_integration["Service integration"]
  node_auth_endpoint["Auth endpoint<br/>[route.ts]"]
  node_auth_config["Credentials auth<br/>[auth.ts]"]
  node_payment_api["Payment APIs<br/>[createPayment.ts]"]
  node_account_api["Account APIs<br/>[fetchPayments.ts]"]
  node_transaction_api["Transaction APIs"]
end

node_user(("User"))
node_backend{{"Finance backend"}}

node_user -->|"opens access"| node_auth_pages
node_auth_pages -->|"presents form"| node_auth_forms
node_user -->|"enters workspace"| node_workspace
node_workspace -->|"shows overview"| node_dashboard
node_user -->|"starts payment"| node_payment_types
node_payment_types -->|"opens wizard"| node_payment_wizard
node_payment_types -->|"chooses regular"| node_regular_payment
node_payment_types -->|"chooses transfer"| node_transfer
node_payment_types -->|"chooses shopping"| node_shopping_payment
node_regular_payment -->|"reviews details"| node_payment_review
node_shopping_payment -->|"enters invoice"| node_shopping_form
node_auth_endpoint -->|"dispatches handlers"| node_auth_config
node_auth_config -->|"posts credentials"| node_backend

click node_auth_pages "https://github.com/semjanivnikola/smart-money/blob/develop/app/(auth)/sign-in/page.tsx"
click node_auth_forms "https://github.com/semjanivnikola/smart-money/blob/develop/src/forms/SignInForm.tsx"
click node_auth_endpoint "https://github.com/semjanivnikola/smart-money/blob/develop/app/api/auth/%5B...nextauth%5D/route.ts"
click node_auth_config "https://github.com/semjanivnikola/smart-money/blob/develop/auth.ts"
click node_workspace "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/layout.tsx"
click node_dashboard "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/page.tsx"
click node_accounts "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/accounts/page.tsx"
click node_wallets "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/wallets/page.tsx"
click node_analytics "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/analytics/page.tsx"
click node_payment_list "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/page.tsx"
click node_payment_types "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/page.tsx"
click node_payment_wizard "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/PaymentWizard.tsx"
click node_regular_payment "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/regular/page.tsx"
click node_payment_review "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/regular/review-%26-pay/page.tsx"
click node_transfer "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/internal-transfer/page.tsx"
click node_shopping_payment "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/shopping/page.tsx"
click node_shopping_form "https://github.com/semjanivnikola/smart-money/blob/develop/src/forms/ShoppingPaymentForm.tsx"
click node_shopping_draft "https://github.com/semjanivnikola/smart-money/blob/develop/api/fetchShoppingPaymentDraft.ts"
click node_transactions "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/transactions/page.tsx"
click node_receipt "https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/transactions/%5Bid%5D/page.tsx"
click node_payment_api "https://github.com/semjanivnikola/smart-money/blob/develop/api/createPayment.ts"
click node_account_api "https://github.com/semjanivnikola/smart-money/blob/develop/api/payments/fetchPayments.ts"
click node_transaction_api "https://github.com/semjanivnikola/smart-money/blob/develop/api/transactions/fetchTransactios.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_auth_pages,node_auth_forms,node_user toneBlue
class node_workspace,node_dashboard,node_accounts,node_wallets,node_analytics,node_transactions,node_receipt toneAmber
class node_payment_list,node_payment_types,node_payment_wizard,node_regular_payment,node_payment_review,node_transfer,node_shopping_payment,node_shopping_form,node_shopping_draft toneMint
class node_auth_endpoint,node_auth_config,node_payment_api,node_account_api,node_transaction_api toneRose
class node_backend toneIndigo
```

## Components

### Access

- [Sign-in / sign-up](https://github.com/semjanivnikola/smart-money/blob/develop/app/(auth)/sign-in/page.tsx): `app/(auth)/sign-in/page.tsx`
- [Auth forms](https://github.com/semjanivnikola/smart-money/blob/develop/src/forms/SignInForm.tsx): `src/forms/SignInForm.tsx`

### Finance workspace

- [Finance workspace](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/layout.tsx): `app/(main)/layout.tsx`
- [Dashboard](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/page.tsx): `app/(main)/page.tsx`
- [Accounts](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/accounts/page.tsx): `app/(main)/accounts/page.tsx`
- [Wallets](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/wallets/page.tsx): `app/(main)/wallets/page.tsx`
- [Analytics](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/analytics/page.tsx): `app/(main)/analytics/page.tsx`
- [Transactions](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/transactions/page.tsx): `app/(main)/transactions/page.tsx`
- [Transaction receipt](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/transactions/%5Bid%5D/page.tsx): `app/(main)/transactions/[id]/page.tsx`

### Payment flows

- [Payment records](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/page.tsx): `app/(main)/payments/page.tsx`
- [Payment type chooser](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/page.tsx): `app/(main)/payments/create/page.tsx`
- [Payment wizard](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/PaymentWizard.tsx): `app/(main)/payments/create/PaymentWizard.tsx`
- [Regular payment](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/regular/page.tsx): `app/(main)/payments/create/(payment-types)/regular/page.tsx`
- [Review and pay](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/regular/review-%26-pay/page.tsx): `app/(main)/payments/create/(payment-types)/regular/review-&-pay/page.tsx`
- [Internal transfer](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/internal-transfer/page.tsx): `app/(main)/payments/create/(payment-types)/internal-transfer/page.tsx`
- [Shopping payment](https://github.com/semjanivnikola/smart-money/blob/develop/app/(main)/payments/create/(payment-types)/shopping/page.tsx): `app/(main)/payments/create/(payment-types)/shopping/page.tsx`
- [Invoice details](https://github.com/semjanivnikola/smart-money/blob/develop/src/forms/ShoppingPaymentForm.tsx): `src/forms/ShoppingPaymentForm.tsx`
- [Shopping draft](https://github.com/semjanivnikola/smart-money/blob/develop/api/fetchShoppingPaymentDraft.ts): `api/fetchShoppingPaymentDraft.ts`

### Service integration

- [Auth endpoint](https://github.com/semjanivnikola/smart-money/blob/develop/app/api/auth/%5B...nextauth%5D/route.ts): `app/api/auth/[...nextauth]/route.ts`
- [Credentials auth](https://github.com/semjanivnikola/smart-money/blob/develop/auth.ts): `auth.ts`
- [Payment APIs](https://github.com/semjanivnikola/smart-money/blob/develop/api/createPayment.ts): `api/createPayment.ts`
- [Account APIs](https://github.com/semjanivnikola/smart-money/blob/develop/api/payments/fetchPayments.ts): `api/payments/fetchPayments.ts`
- [Transaction APIs](https://github.com/semjanivnikola/smart-money/blob/develop/api/transactions/fetchTransactios.ts): `api/transactions/fetchTransactios.ts`

### Other components

- **User**
- **Finance backend**

## Connections

- User → Sign-in / sign-up: opens access
- Sign-in / sign-up → Auth forms: presents form
- User → Finance workspace: enters workspace
- Finance workspace → Dashboard: shows overview
- User → Payment type chooser: starts payment
- Payment type chooser → Payment wizard: opens wizard
- Payment type chooser → Regular payment: chooses regular
- Payment type chooser → Internal transfer: chooses transfer
- Payment type chooser → Shopping payment: chooses shopping
- Regular payment → Review and pay: reviews details
- Shopping payment → Invoice details: enters invoice
- Auth endpoint → Credentials auth: dispatches handlers
- Credentials auth → Finance backend: posts credentials
