How kaushikp020603/myarthiq works
1. Overall shape
- This is a modular monolith for personal/family/business finance.
- The system is split into a React/Vite frontend and a FastAPI backend, with a shared domain broken into feature modules rather than separate services.
2. Frontend presentation shell
- The frontend lives under frontend/ and is a single-page app built with React + TypeScript + Vite + Tailwind.
- src/main.tsx bootstraps the app, and src/App.tsx plus src/components/layout/Shell.tsx define the top-level chrome/navigation and feature routing experience.
3. Feature-oriented UI structure
- UI code is organized by business capability under src/features/ rather than by technical layer.
- Major user-facing areas include auth, dashboard, budgets, accounts, transactions, assets, goals, insurance, portfolio, reports, planning, sharing, security, admin, tools, and tutorials.
- This makes the frontend diagram best represented as a shell with many feature panels, each owning its own page and local components.
4. Frontend data and state flow
- Shared client utilities live in src/lib/, including the API wrapper layer, query client, profile context, and finance-specific helper data.
- Global UI/account state is handled in src/store/ for auth, profile, and theme.
- Most feature pages appear to call backend endpoints through feature-local api.ts files, with shared request/query infrastructure underneath.
5. Backend application boundary
- The backend is a FastAPI app rooted at backend/app/main.py.
- API routing is composed in backend/app/api/v1/, with module routers wired into a versioned API surface.
- From an architecture diagram perspective, the backend is the central domain/API boundary between the frontend and persistence.
6. Backend modular domains
- Business logic is split into backend/app/modules/*, including auth, admin, accounts, budgets, dashboard, finance, goals, household, insurance, public, and wealth.
- Each module typically contains its own models, schemas, services, and/or router, showing a layered vertical-slice structure inside the monolith.
- The frontend feature names map closely to these backend modules, which is the main functional correspondence in the system.
7. Security and access control
- Authentication is JWT-based, with security support in backend/app/core/security.py.
- RBAC is a first-class boundary in backend/app/core/rbac.py, and admin-specific data flows exist under backend/app/modules/admin.
- This means the architecture should show authenticated user flows and admin-only flows as separate access paths through the same API.
8. Persistence layer
- SQLAlchemy models are used for persistence, with database session management in backend/app/db/session.py.
- The project is SQLite-friendly for local development but explicitly designed to be PostgreSQL-ready.
- Alembic migrations in backend/alembic/versions/ define the evolving schema, including families, joint accounts/transfers, goals metadata, budgets, and admin-related tables.
9. Runtime support and background work
- There is a Celery worker setup in backend/app/workers/, indicating asynchronous/background processing.
- Notification-related background jobs are present, and email support exists in backend/app/core/email.py.
- This adds a second execution path besides the request/response API: scheduled or async tasks for notifications and similar jobs.
10. Initialization and operational scripts
- backend/database/ contains bootstrap and migration helpers such as create_admin.py, seed.py, and schema conversion utilities.
- These scripts support first-run setup and data migration rather than end-user features.
- For architecture, they are best shown as operational tooling attached to the backend/data layer.
11. Domain cross-cuts
- Shared finance helpers live in backend core/modules and frontend src/lib/ rather than inside a single feature.
- The app includes shared concepts like families, profiles, banks, expense categories, and net worth/wealth calculations, which cut across several user flows.
- These are important conceptual boundaries when drawing the domain model, because many screens depend on the same household/profile context.
12. Public vs authenticated surfaces
- The frontend includes landing, legal, login/signup/password-change, and other onboarding pages alongside the authenticated product shell.
- The backend has a public module, suggesting some endpoints are intentionally available without login.
- So the system has a clear split between public marketing/onboarding, authenticated finance workspace, and admin console.
13. Testing and documentation
- Backend tests cover smoke, family behavior, and budgets/privacy concerns.
- The docs/ folder contains architecture and product breakdown documentation, which likely aligns with the intended module boundaries.
- These are supporting artifacts, but they confirm that the main architectural concerns are privacy, multi-family context, and feature modularity.
14. Key diagram takeaway
- The best architecture diagram is: React SPA shell → feature pages/hooks/api clients → FastAPI versioned routers → module services/models → SQLAlchemy/PostgreSQL/SQLite, with JWT/RBAC guarding access and Celery/email handling asynchronous side effects.
Main entry points: DashboardPage.tsx Workspace · App.tsx App · __init__.py Modules · router.py V1 Router
Components 23
Frontend
React/Vite single-page app and feature modules
- Main · Mounts the React app and initializes client runtime.
frontend/src/main.tsx - App · Top-level application routing and product mode switching.
frontend/src/App.tsx - Shell · Authenticated workspace chrome, navigation, and feature framing.
frontend/src/components/layout/Shell.tsx - Auth UI · Login, signup, password reset, and auth-specific presentation.
frontend/src/features/auth/AuthPage.tsx - Workspace · Core authenticated finance workspace composed of major feature pages.
frontend/src/features/dashboard/DashboardPage.tsx - Budgets · Budget grid, insights, reports, and daily logging.
frontend/src/features/budgets/BudgetsPage.tsx - Accounts · Account management and transfer workflows.
frontend/src/features/accounts/AccountsPage.tsx - Transactions · Transaction review and operational transaction workflows.
frontend/src/features/transactions/TransactionsPage.tsx - Goals · Goal planning, cards, and goal drawer workflows.
frontend/src/features/goals/GoalsPage.tsx - Insurance · Insurance records and detail drawer flows.
frontend/src/features/insurance/InsurancePage.tsx - Portfolio · Portfolio and wealth-oriented views.
frontend/src/features/portfolio/PortfolioPage.tsx - Reports · Reporting and financial summaries.
frontend/src/features/reports/ReportsPage.tsx - Tools · Import, install, settings, onboarding, feedback, and release-note tools.
frontend/src/features/tools/SettingsPage.tsx - Admin UI · Admin analytics, families, marketing, support, and user detail screens.
frontend/src/features/admin/AdminPage.tsx - Shared Lib · API client, query client, profile context, and finance helpers.
frontend/src/lib/api.ts
Backend
FastAPI application, domain modules, and persistence
- API App · Backend application entrypoint and server assembly.
backend/app/main.py - V1 Router · Versioned API router that wires module endpoints together.
backend/app/api/v1/router.py - Core · Shared backend concerns: config, JWT security, RBAC, email, and error handling.
backend/app/core/security.py - Modules · Business modules for auth, admin, accounts, budgets, dashboard, finance, goals, household, insurance, public, and wealth.
backend/app/modules/__init__.py - Persistence · SQLAlchemy models and database session management.
backend/app/db/session.py - Migrations · Alembic migrations for evolving family, budget, account, goal, and admin schema.
backend/alembic/versions/0001_initial_schema.py
Connections 24
- Main → App: boots · React entrypoint initializes the application shell.
- App → Shell: uses · Authenticated product views are framed by the shell.
- App → Auth UI: routes · Public and onboarding paths flow into auth screens.
- App → Workspace: routes · Primary app navigation lands in the finance workspace.
- Workspace → Budgets: includes · Budgeting is one of the central workspace panels.
- Workspace → Accounts: includes · Accounts management is a core workspace area.
- Workspace → Transactions: includes · Transactions are surfaced as a primary workspace area.
- Workspace → Goals: includes · Goals are a first-class workspace feature.
- Workspace → Insurance: includes · Insurance views participate in the main product shell.
- Workspace → Portfolio: includes · Wealth and portfolio views are part of the core product.
- Workspace → Reports: includes · Reports summarize household financial activity.
- Workspace → Tools: includes · Settings, import, install, and onboarding utilities live here.
- Workspace → Admin UI: includes · Admin-only screens share the same frontend app.
- Workspace → Shared Lib: depends on · Feature pages rely on shared API, state, and finance helpers.
- Shared Lib → V1 Router: calls · Client requests target the versioned backend API.
- Auth UI → V1 Router: calls · Authentication flows use backend auth endpoints.
- API App → V1 Router: mounts · The FastAPI app composes the v1 router surface.
- V1 Router → Modules: dispatches to · Routers forward requests into feature modules.
- Modules → Core: guards with · Domain access is protected by auth, RBAC, and shared config.
- Modules → Persistence: persists via · Modules store and load data through ORM models and sessions.
- Persistence → Migrations: evolves with · Schema changes are tracked through Alembic migrations.
- Modules → Workers: enqueues · Some domain actions trigger background notification jobs.
- DB Tools → Persistence: initializes · Operational scripts prepare and seed the database.
- Core → Workers: supports · Email and security support async side effects and notifications.