How sprints-team-13/onlinebanking works
Purpose and runtime
MERN e-banking application with separate React frontend and Node.js backend. It supports customer account/transaction operations and a privileged admin workflow for user activation and account-request decisions. Backend starts at src/index.js; React starts at frontend/src/index.js. Procfile indicates deployment as a process-hosted service.
Client application shell and access state
frontend/src/App.jsx composes the application’s top-level views. Authentication/session state is centralized in frontend/src/context/Auth-context.js, with browser persistence handled by frontend/src/helpers/localStorage.js. Login and registration are distinct entry flows at frontend/src/components/login/Login.jsx and frontend/src/components/register/Register.jsx; route/view access is expected to depend on the resulting user role and activation state.
Role-specific dashboard boundaries
The frontend separates customer and administrator experiences:
• Customer shell: frontend/src/Pages/UserDashboard/UserDashboard.jsx
• Admin shell: frontend/src/Pages/AdminPanel/AdminPanel.jsx
• Role-specific navigation: frontend/src/layout/sidebar/UserSidebar.jsx, frontend/src/layout/sidebar/AdminSidebar.jsx
Customer pages cover overview, accounts, transfers, profile, and transactions. Admin pages cover overview, users, accounts, and transactions, preserving a clear UI boundary between self-service banking and supervisory operations.
Banking operations and presentation
Customer operations are staged through pages for account visibility, transaction history, and money movement: frontend/src/Pages/UserDashboard/Accounts/Accounts.jsx, frontend/src/Pages/UserDashboard/Transactions/Transactions.jsx, and frontend/src/Pages/UserDashboard/Transfer/Transfer.jsx. Transfer validation is defined in frontend/src/schemas/transferSchema.js. Reusable table, chart, and dialog components provide common rendering and action-confirmation surfaces: frontend/src/components/table/Table.jsx, frontend/src/components/chart/Chart.jsx, frontend/src/components/dialog/Dialog.js.
API access and query layer
The frontend isolates HTTP interaction behind CRUD/API utilities and hooks: frontend/src/api/apiCrud.js, frontend/src/hooks/useApi.js, and role-oriented query modules such as frontend/src/hooks/queries/users/useGetUserAccounts.js. Admin data retrieval is similarly segmented by domain, including frontend/src/hooks/queries/admin/useGetUsers.js and frontend/src/hooks/queries/admin/useGetTransactions.js. UI pages should consume these abstractions rather than directly own transport behavior.
Backend HTTP and domain control
The backend’s routing boundary is src/routes/user.js for customer-facing APIs and src/routes/admin/auth.js for admin authentication/API scope. Controllers implement domain actions: account lifecycle in src/controllers/account.js, monetary transaction handling in src/controllers/transactions.js, user operations in src/controllers/user.js, and admin authorization/actions in src/controllers/admin/auth.js. Authentication input validation is separated into src/validators/auth.js.
Persistence model and core flow
MongoDB/Mongoose-style domain models represent users, accounts, and transactions: src/models/user.js, src/models/account.js, and src/models/transactions.js. Primary flow is React action → API/query layer → backend route → controller → model persistence → response-driven dashboard refresh. Transaction and transfer operations are the critical integrity boundary: controllers must validate actor authorization, account state, and balances before writing transaction/account changes. The deployed application is referenced by the README as a Cyclic-hosted service.
Main entry points: App.jsx Application shell · apiCrud.js API and query layer · user.js Customer API routes · auth.js User and admin control
Components 20
React client
- Frontend entry
frontend/src/index.js - Application shell · Selects views and top-level application structure.
frontend/src/App.jsx - Auth session state · Tracks session, role, and activation-dependent access.
frontend/src/context/Auth-context.js - Browser session storage
frontend/src/helpers/localStorage.js - Login and registration
frontend/src/components/login/Login.jsx - Customer dashboard · Self-service banking area with customer navigation.
frontend/src/Pages/UserDashboard/UserDashboard.jsx - Admin panel · Supervisory area with role-specific navigation.
frontend/src/Pages/AdminPanel/AdminPanel.jsx - Accounts, transfers, history · Account visibility, money movement, and transaction history.
frontend/src/Pages/UserDashboard/Transfer/Transfer.jsx - Transfer validation
frontend/src/schemas/transferSchema.js - Admin data views · Retrieves users and transaction data for supervision.
frontend/src/hooks/queries/admin/useGetUsers.js - API and query layer · Pages use shared CRUD transport and query hooks.
frontend/src/api/apiCrud.js - Tables, charts, dialogs · Reusable rendering and confirmation surfaces.
frontend/src/components/table/Table.jsx
Node.js backend
- Backend entry · Starts the process-hosted API service.
src/index.js - Customer API routes
src/routes/user.js - Admin API routes
src/routes/admin/auth.js - Account and transaction control · Authorizes account state and balances before persistence changes.
src/controllers/transactions.js - User and admin control · Handles user operations, activation, and admin actions.
src/controllers/admin/auth.js - Auth validation
src/validators/auth.js
MongoDB domain data
- Accounts and transactions · Persistent banking balances and transaction records.
src/models/account.js - Users · Persistent identities, roles, and activation state.
src/models/user.js
Connections 24
- Frontend entry → Application shell: mounts
- Application shell → Auth session state: uses
- Auth session state → Browser session storage: persists session
- Application shell → Login and registration: unauthenticated access
- Application shell → Customer dashboard: customer role
- Application shell → Admin panel: admin role
- Customer dashboard → Accounts, transfers, history: hosts
- Accounts, transfers, history → Transfer validation: validates transfers
- Customer dashboard → API and query layer: queries and actions
- Admin panel → Admin data views: retrieves oversight data
- Admin data views → API and query layer: uses
- Accounts, transfers, history → Tables, charts, dialogs: renders with
- API and query layer → Customer API routes: customer requests
- API and query layer → Admin API routes: admin requests
- Backend entry → Customer API routes: serves
- Backend entry → Admin API routes: serves
- Customer API routes → Account and transaction control: dispatches
- Customer API routes → User and admin control: dispatches user actions
- Admin API routes → User and admin control: dispatches
- User and admin control → Auth validation: validates auth input
- Account and transaction control → Accounts and transactions: reads and writes
- Account and transaction control → Users: authorizes actor
- User and admin control → Users: manages users
- Accounts and transactions → API and query layer: response refreshes dashboards