# rishabhchowkikar/finance-management-system architecture

> Architecture diagram of the GitHub repository rishabhchowkikar/finance-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rishabhchowkikar/finance-management-system
- Repository: https://github.com/rishabhchowkikar/finance-management-system

## Overview

##### Project type and purpose
- This is a full-stack, server-rendered web application built with Next.js (App Router) that provides a banking dashboard.
- Users can sign up/in, link their bank accounts (via Plaid), view balances and transaction histories, and transfer money (via Dwolla).
- It uses Appwrite as its backend-as-a-service (authentication & database), integrates external payment APIs (Plaid, Dwolla), and includes instrumentation (Sentry).

##### File structure
- app/
- (auth): sign-in & sign-up routes (server components + pages)
- (root): protected routes (my-banks, payment-transfer, transaction-history)
- layout.tsx: top-level layout & global styling (Tailwind)
- components/: reusable React UI components (bank cards, charts, forms)
- ui/: design system primitives (button, input, table, etc.)
- lib/actions/: “service layer” that encapsulates all API calls
- bank.actions.ts, transaction.actions.ts, user.actions.ts, dwolla.actions.ts
- lib/appwrite.ts, lib/plaid.ts: SDK wrappers & configuration
- constants/, types/: domain constants and TypeScript definitions
- instrumentation.ts(.client/.server): Sentry setup for edge & server environments
- next.config.ts, tsconfig.json, tailwind.config.js: build & linting configs

##### README for additional insights
- Indicates use of next/font, standard deploy on Vercel.

a. Main components (containers)
- Browser Client (Next.js React UI)
- Next.js Server / Edge Functions (Server Components & Server Actions)
- Service Layer (lib/actions)
- Appwrite (Auth & Database)
- Plaid API (Bank linking & data)
- Dwolla API (Payment transfers)
- Sentry (Error & performance monitoring)
b. Relationships & data flows
- User → Browser UI → Next.js server components → service layer → external services
- Service layer ↔ Appwrite for user & transaction data
- Service layer ↔ Plaid for bank data
- Service layer ↔ Dwolla for payment initiation
- Next.js edge functions report errors & metrics to Sentry
c. Architectural patterns
- Server-Side Rendering + Server Actions (Next.js App Router)
- Backend-for-Frontend (BFF) pattern via lib/actions
- Externalized services for auth, DB, payments, instrumentation
d. Key technologies
- Next.js (React, App Router, Server Components)
- Appwrite (backend-as-a-service)
- Plaid & Dwolla (external financial APIs)
- Tailwind CSS (utility styling)
- Sentry (monitoring)
- TypeScript

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% Presentation Layer
  subgraph "Presentation (Browser UI)"
    direction TB
    Layout["layout.tsx"] 
    Globals["globals.css"] 
    SignIn["sign-in/page.tsx"] 
    SignUp["sign-up/page.tsx"] 
    RootPage["root page.tsx"] 
    MyBanks["my-banks/page.tsx"] 
    Transactions["transaction-history/page.tsx"] 
    Transfer["payment-transfer/page.tsx"] 
    Components["components/*.tsx"] 
    UI["components/ui/*.tsx"] 
  end

  %% Application Layer
  subgraph "Application (Next.js Server & Edge)"
    direction TB
    AuthLayout["(auth)/layout.tsx"] 
    RootLayout["(root)/layout.tsx"] 
    InstrEdge["instrumentation.ts"] 
    InstrClient["instrumentation-client.ts"] 
    SentryEdgeCfg["sentry.edge.config.ts"] 
    SentryServerCfg["sentry.server.config.ts"] 
  end

  %% Service Layer
  subgraph "Service Layer (lib/actions)"
    direction TB
    BankAct["bank.actions.ts"] 
    TransAct["transaction.actions.ts"] 
    UserAct["user.actions.ts"] 
    DwollaAct["dwolla.actions.ts"] 
  end

  %% External Services & Data
  subgraph "External Services & Data"
    direction TB
    Appwrite["lib/appwrite.ts"] 
    Plaid["lib/plaid.ts"] 
    DwollaAPI["Dwolla API"] 
    Sentry["Sentry"] 
  end

  %% Presentation to Application
  SignIn -->|renders| AuthLayout
  SignUp -->|renders| AuthLayout
  RootPage -->|renders| RootLayout
  MyBanks -->|renders| RootLayout
  Transactions -->|renders| RootLayout
  Transfer -->|renders| RootLayout
  Components -->|used by| Layout
  UI -->|used by| Layout
  Layout -->|renders| AuthLayout
  Layout -->|renders| RootLayout

  %% Application to Service Layer
  AuthLayout -->|"Server Actions"| UserAct
  RootLayout -->|"Server Actions"| TransAct
  RootLayout -->|"Server Actions"| BankAct
  RootLayout -->|"Server Actions"| DwollaAct

  %% Service Layer to External
  UserAct <-->|"REST API"| Appwrite
  TransAct <-->|"REST API"| Appwrite
  BankAct <-->|"HTTP"| Plaid
  DwollaAct <-->|"HTTP"| DwollaAPI

  %% Instrumentation
  AuthLayout -->|"Errors&Metrics"| InstrEdge
  AuthLayout -->|"Errors&Metrics"| InstrClient
  InstrEdge -->|"Report"| Sentry
  InstrClient -->|"Report"| Sentry
  SentryEdgeCfg -->|"Config"| Sentry
  SentryServerCfg -->|"Config"| Sentry

  %% Click Events
  click Layout "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/layout.tsx"
  click Globals "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/globals.css"
  click SignIn "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/(auth)/sign-in/page.tsx"
  click SignUp "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/(auth)/sign-up/page.tsx"
  click RootPage "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/(root)/page.tsx"
  click MyBanks "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/(root)/my-banks/page.tsx"
  click Transactions "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/(root)/transaction-history/page.tsx"
  click Transfer "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/(root)/payment-transfer/page.tsx"
  click Components "https://github.com/rishabhchowkikar/finance-management-system/tree/main/components/"
  click UI "https://github.com/rishabhchowkikar/finance-management-system/tree/main/components/ui/"
  click AuthLayout "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/(auth)/layout.tsx"
  click RootLayout "https://github.com/rishabhchowkikar/finance-management-system/blob/main/app/(root)/layout.tsx"
  click InstrEdge "https://github.com/rishabhchowkikar/finance-management-system/blob/main/instrumentation.ts"
  click InstrClient "https://github.com/rishabhchowkikar/finance-management-system/blob/main/instrumentation-client.ts"
  click SentryEdgeCfg "https://github.com/rishabhchowkikar/finance-management-system/blob/main/sentry.edge.config.ts"
  click SentryServerCfg "https://github.com/rishabhchowkikar/finance-management-system/blob/main/sentry.server.config.ts"
  click BankAct "https://github.com/rishabhchowkikar/finance-management-system/blob/main/lib/actions/bank.actions.ts"
  click TransAct "https://github.com/rishabhchowkikar/finance-management-system/blob/main/lib/actions/transaction.actions.ts"
  click UserAct "https://github.com/rishabhchowkikar/finance-management-system/blob/main/lib/actions/user.actions.ts"
  click DwollaAct "https://github.com/rishabhchowkikar/finance-management-system/blob/main/lib/actions/dwolla.actions.ts"
  click Appwrite "https://github.com/rishabhchowkikar/finance-management-system/blob/main/lib/appwrite.ts"
  click Plaid "https://github.com/rishabhchowkikar/finance-management-system/blob/main/lib/plaid.ts"

  %% Styles
  classDef frontend fill:#a2d2ff,stroke:#0366d6
  classDef backend fill:#cce6aa,stroke:#2d6a4f
  classDef service fill:#ffd6a5,stroke:#e07a5f
  classDef external fill:#ffadad,stroke:#d00000
  class Layout,Globals,SignIn,SignUp,RootPage,MyBanks,Transactions,Transfer,Components,UI frontend
  class AuthLayout,RootLayout,InstrEdge,InstrClient,SentryEdgeCfg,SentryServerCfg backend
  class BankAct,TransAct,UserAct,DwollaAct service
  class Appwrite,Plaid,DwollaAPI,Sentry external
```
