How rohitsai4429/ledgerline works
LedgerLine is an internal financial ledger for account holders, administrators, and auditors. Users authenticate with a password or Google sign-in, verify by email OTP, then manage accounts or perform internal deposits, withdrawals, and transfers; they can review transactions and statements, while oversight roles manage account status and inspect audit events. The backend is documented as a modular FastAPI monolith backed by PostgreSQL. README capabilities fill in important unsampled areas; dashed links mark relationships not established by the excerpts or explicit documentation.
Main entry points: client.ts HTTP client · useLedgerData.ts Ledger data hooks · App.tsx Application routes · router.py API router
Components 34
Web application
- Application routes
frontend/src/App.tsx - Sign-in and registration
frontend/src/pages/AuthPages.tsx - HTTP client
frontend/src/api/client.ts - Role-based workspace
frontend/src/components/AppShell.tsx - Dashboard
frontend/src/pages/DashboardPage.tsx - Account management
frontend/src/pages/AccountsPage.tsx - Money actions
frontend/src/pages/MoneyActionPage.tsx - Transaction history
frontend/src/pages/TransactionsPage.tsx - Statements
frontend/src/pages/StatementsPage.tsx - Ledger data hooks
frontend/src/hooks/useLedgerData.ts - Account API
frontend/src/api/accounts.ts - Transaction API
frontend/src/api/transactions.ts - Statement API
frontend/src/api/statements.ts - Audit API
frontend/src/api/audit.ts - Admin API
frontend/src/api/admin.ts
Identity and access
- Auth session
frontend/src/auth/AuthProvider.tsx - Auth API client
frontend/src/api/auth.ts - Authentication routes
backend/app/api/routes/auth.py - Authentication service
backend/app/services/auth.py - Google identity
backend/app/services/google_auth.py - Email OTP
backend/app/services/otp.py - Identity and OTP models
backend/app/models/auth.py
Ledger operations
- Account routes
backend/app/api/routes/accounts.py - Transaction routes
backend/app/api/routes/transactions.py - Account service
backend/app/services/accounts.py - Transaction service
backend/app/services/transactions.py
Oversight and records
- Admin account review
frontend/src/pages/AdminPages.tsx - Audit events
frontend/src/pages/AuditPage.tsx - Audit service
backend/app/services/audit.py
Backend platform
- API router
backend/app/api/router.py - Ledger and user models
backend/app/models - Data repositories
backend/app/repositories
Other components
- Account holder
- Administrator / auditor
Connections 48
- Account holder → Sign-in and registration: signs in
- Sign-in and registration → Auth session: starts authentication
frontend/src/pages/AuthPages.tsx - Auth session → Auth API client: calls
frontend/src/auth/AuthProvider.tsx - Auth API client → HTTP client: sends requests
frontend/src/api/auth.ts - HTTP client → Authentication routes: calls auth endpoints
- Sign-in and registration → Google identity: offers Google sign-in
- Authentication routes → Google identity: resolves Google identity
backend/app/services/google_auth.py - Authentication routes → Email OTP: starts verification
- Email OTP → Identity and OTP models: persists challenges
- Google identity → Data repositories: looks up users
backend/app/services/google_auth.py - Google identity → Audit service: records registration
backend/app/services/google_auth.py - Auth session → Application routes: provides session
frontend/src/App.tsx - Account holder → Account management: manages accounts
- Account holder → Money actions: moves ledger funds
- Money actions → Ledger data hooks: loads and mutates data
- Account management → Ledger data hooks: loads accounts
- Ledger data hooks → Account API: calls
frontend/src/hooks/useLedgerData.ts - Ledger data hooks → Transaction API: calls
frontend/src/hooks/useLedgerData.ts - Ledger data hooks → Statement API: calls
frontend/src/hooks/useLedgerData.ts - Ledger data hooks → Audit API: calls
frontend/src/hooks/useLedgerData.ts - Ledger data hooks → Admin API: calls
frontend/src/hooks/useLedgerData.ts - Account API → HTTP client: sends requests
- Transaction API → HTTP client: sends requests
- Statement API → HTTP client: sends requests
- Audit API → HTTP client: sends requests
- Admin API → HTTP client: sends requests
- HTTP client → API router: calls API
- API router → Authentication routes: registers routes
backend/app/api/router.py - API router → Account routes: registers routes
backend/app/api/router.py - API router → Transaction routes: registers routes
backend/app/api/router.py - Account routes → Account service: serves account operations
- Transaction routes → Transaction service: serves money movement
- Account service → Data repositories: uses persistence
- Transaction service → Data repositories: uses persistence
- Transaction service → Audit service: records audit events
- Data repositories → Ledger and user models: persists records
- Administrator / auditor → Admin account review: reviews accounts
- Administrator / auditor → Audit events: reviews audit trail
- Administrator / auditor → Transaction history: reviews transactions
- Administrator / auditor → Statements: reviews statements
- Account holder → Dashboard: views overview
- Account holder → Transaction history: reviews activity
- Account holder → Statements: reviews statements
- Application routes → Sign-in and registration: routes to
frontend/src/App.tsx - Application routes → Role-based workspace: wraps workspace
frontend/src/App.tsx - Application routes → Dashboard: routes to
frontend/src/App.tsx - Application routes → Account management: routes to
frontend/src/App.tsx - Application routes → Money actions: routes to
frontend/src/App.tsx