How mohana-575/ledgerline-safe-payments works
LedgerLine is a role-based banking ledger application: people use the React app to authenticate and reach account, money-movement, statement, audit, and administration features; the FastAPI backend handles those operations against PostgreSQL. The clearest evidenced backend flow is API registration of route modules, with movement routes delegating ledger work. Ledger persistence and authentication are represented as separate internal layers. The frontend’s page components are present, but the sampled source does not establish their HTTP calls to the API, so those links are omitted.
Main entry points: ledger.py Ledger service · main.py API application · App.tsx Route shell · auth.py Authentication
Components 27
Web application
- Route shell
frontend/src/App.tsx - Auth pages
frontend/src/pages/AuthPages.tsx - Banking pages
frontend/src/pages/AppPages.tsx - Auth provider
frontend/src/auth/AuthProvider.tsx - Auth context
frontend/src/auth/authContext.ts - Auth hook
frontend/src/auth/useAuth.ts - Role guards
frontend/src/auth/RouteGuards.tsx - Money form
frontend/src/components/MoneyForm.tsx
API and access
- API application
backend/app/main.py - Authentication
backend/app/api/routes/auth.py - Accounts
backend/app/api/routes/accounts.py - Administration
backend/app/api/routes/admin.py - Money movements
backend/app/api/routes/movements.py - Statements and audit
backend/app/api/routes/statements.py - Auth dependencies
backend/app/api/dependencies.py - Token security
backend/app/core/security.py
Ledger domain
- Ledger service
backend/app/services/ledger.py - Ledger verification
backend/app/services/verify.py
Persistence
- DB sessions
backend/app/db/session.py - Account records
backend/app/models/account.py - Account membership
backend/app/models/account_member.py - Ledger entries
backend/app/models/ledger_entry.py - Transactions
backend/app/models/transaction.py - Audit records
backend/app/models/audit_log.py - User records
backend/app/models/user.py
Other components
- User
- PostgreSQL
Connections 31
- User → Route shell: uses
- Route shell → Auth pages: routes to
frontend/src/App.tsx - Route shell → Banking pages: routes to
frontend/src/App.tsx - Route shell → Auth provider: wraps
frontend/src/App.tsx - Route shell → Role guards: protects routes
frontend/src/App.tsx - Auth provider → Auth context: provides
frontend/src/auth/AuthProvider.tsx - Auth hook → Auth context: reads
frontend/src/auth/useAuth.ts - Role guards → Auth hook: checks user
frontend/src/auth/RouteGuards.tsx - Banking pages → Money form: renders
frontend/src/pages/AppPages.tsx - API application → Authentication: registers
backend/app/main.py - API application → Accounts: registers
backend/app/main.py - API application → Administration: registers
backend/app/main.py - API application → Money movements: registers
backend/app/main.py - API application → Statements and audit: registers
backend/app/main.py - Authentication → Token security: uses
backend/app/api/routes/auth.py - Authentication → Audit records: writes
backend/app/api/routes/auth.py - Authentication → User records: reads and writes
backend/app/api/routes/auth.py - Auth dependencies → Token security: decodes token
backend/app/api/dependencies.py - Auth dependencies → User records: loads user
backend/app/api/dependencies.py - Money movements → Ledger service: delegates
backend/app/api/routes/movements.py - Administration → Ledger service: uses
backend/app/api/routes/admin.py - Administration → Ledger verification: uses
backend/app/api/routes/admin.py - Ledger service → Account records: updates
backend/app/services/ledger.py - Ledger service → Account membership: checks access
backend/app/services/ledger.py - Ledger service → Ledger entries: creates entries
backend/app/services/ledger.py - Ledger service → Transactions: records movement
backend/app/services/ledger.py - Ledger service → Audit records: records action
backend/app/services/ledger.py - DB sessions → PostgreSQL: connects
backend/app/db/session.py - Authentication → DB sessions: opens session
backend/app/api/routes/auth.py - Money movements → DB sessions: opens session
backend/app/api/routes/movements.py - Statements and audit → DB sessions: opens session
backend/app/api/routes/statements.py