How chamodhpasindu/bsdm-frontend works
Purpose and runtime
BSMSFrontend is an Angular 16 single-page frontend for a business/sales management workflow. It provides distinct administrator and field-sales experiences, covering inventory, billing, payment collection, delivery tracking, operational records, and notifications. It runs in the browser via Angular CLI; PWA/service-worker assets are configured through ngsw-config.json and src/manifest.webmanifest.
Bootstrap and application shell
The browser bootstraps from src/main.ts, rendering the root component declared by src/app/app.module.ts. Global route selection is centralized in src/app/app-routing.module.ts; src/app/app.component.ts is the root host. Environment-specific frontend settings are separated into src/environment/environment.ts and src/environment/environment.prod.ts.
Administrative workspace
The admin feature module and router establish the back-office boundary: src/app/admin/admin.module.ts, src/app/admin/admin-routing.module.ts, and src/app/admin/layout/layout.component.ts. Its dashboard, management, tracking, and audit screens form the operational control plane, including src/app/admin/dashboard/dashboard.component.ts, src/app/admin/employee-management/employee-management.component.ts, and src/app/admin/audit-trail/audit-trail.component.ts.
Inventory and fulfillment domain
Inventory is a nested admin module with independent routing in src/app/admin/inventory-management/inventory-management.module.ts and src/app/admin/inventory-management/inventory-management.routing.module.ts. It separates product catalog, batch/item records, stock movements, returns, and sales-stock views: src/app/admin/inventory-management/product/product.component.ts, src/app/admin/inventory-management/item-batch/item-batch.component.ts, and src/app/admin/inventory-management/stock/stock.component.ts. Vehicle, customer-route, and delivery tracking features connect inventory operations to field fulfillment.
Sales workspace and billing flow
The sales module is the field-user boundary, anchored by src/app/sales/sales.module.ts, src/app/sales/sales-routing.module.ts, and src/app/sales/layout/layout.component.ts. Billing is a staged feature module: route/customer selection, product selection, then bill summary, represented by src/app/sales/bill/bill.module.ts, src/app/sales/bill/select-route/select-route.component.ts, and src/app/sales/bill/bill-summary/bill-summary.component.ts. This suggests UI-driven workflow state passed across routed or nested billing screens; no API/service layer is present in the supplied tree.
Payment collection flow
Payment is an independently routed sales workflow in src/app/sales/payment/payment.module.ts and src/app/sales/payment/payment-routing.module.ts. It guides the user through route, customer, and bill selection before payment handling: src/app/sales/payment/select-route/select-route.component.ts, src/app/sales/payment/select-customer/select-customer.component.ts, and src/app/sales/payment/select-bill/select-bill.component.ts. Admin payment screens provide a separate oversight/view boundary at src/app/admin/payments/payments.component.ts.
Shared presentation and interaction boundary
Reusable chrome differentiates the two user experiences: src/app/shared/shared.module.ts, src/app/shared/admin-header/admin-header.component.ts, and src/app/shared/sales-bottom-nav/sales-bottom-nav.component.ts. Sales bottom sheets encapsulate transient payment summaries, payment actions, and quick menus; their common mechanism is src/utils/directives/base-bottom-sheet.directive.ts. Styling, icons, fonts, and dashboard-chart presentation assets remain client-side under src/styles.scss and src/assets/.
Main entry points: sales.module.ts Sales Module · admin.module.ts Admin Module · shared.module.ts Shared Module · app.module.ts Root App Module
Components 26
Application Core
- Browser Bootstrap
src/main.ts - Root App Module
src/app/app.module.ts - Global Routes · Selects the admin and sales workspaces.
src/app/app-routing.module.ts - Root App Shell
src/app/app.component.ts
Admin Workspace
- Admin Module · Back-office workspace boundary.
src/app/admin/admin.module.ts - Admin Routes
src/app/admin/admin-routing.module.ts - Admin Layout
src/app/admin/layout/layout.component.ts - Operational Control Screens · Dashboard, employee management, and audit trail.
src/app/admin/dashboard/dashboard.component.ts - Inventory Module · Catalog, batches, stock, returns, and sales-stock operations.
src/app/admin/inventory-management/inventory-management.module.ts - Inventory Routes
src/app/admin/inventory-management/inventory-management.routing.module.ts - Stock Management
src/app/admin/inventory-management/stock/stock.component.ts - Payment Oversight
src/app/admin/payments/payments.component.ts
Sales Workspace
- Sales Module · Field-sales workspace boundary.
src/app/sales/sales.module.ts - Sales Routes
src/app/sales/sales-routing.module.ts - Sales Layout
src/app/sales/layout/layout.component.ts - Billing Workflow · Route/customer selection, product selection, and bill summary.
src/app/sales/bill/bill.module.ts - Billing Route Selection
src/app/sales/bill/select-route/select-route.component.ts - Bill Summary
src/app/sales/bill/bill-summary/bill-summary.component.ts - Payment Workflow · Route, customer, bill selection, then payment handling.
src/app/sales/payment/payment.module.ts - Payment Routes
src/app/sales/payment/payment-routing.module.ts - Payment Customer Selection
src/app/sales/payment/select-customer/select-customer.component.ts - Payment Bill Selection
src/app/sales/payment/select-bill/select-bill.component.ts
Shared UI
- Shared Module · Common presentation components for both workspaces.
src/app/shared/shared.module.ts - Admin Header
src/app/shared/admin-header/admin-header.component.ts - Sales Bottom Navigation
src/app/shared/sales-bottom-nav/sales-bottom-nav.component.ts - Bottom Sheet Base · Common mechanism for transient sales actions and summaries.
src/utils/directives/base-bottom-sheet.directive.ts
Connections 26
- Browser Bootstrap → Root App Module: bootstraps
- Root App Module → Root App Shell: declares
- Root App Module → Global Routes: registers
- Global Routes → Admin Module: routes to
- Global Routes → Sales Module: routes to
- Admin Module → Admin Routes: configures
- Admin Routes → Admin Layout: renders
- Admin Layout → Operational Control Screens: hosts
- Admin Module → Inventory Module: contains
- Inventory Module → Inventory Routes: configures
- Inventory Routes → Stock Management: routes to
- Admin Layout → Payment Oversight: hosts
- Sales Module → Sales Routes: configures
- Sales Routes → Sales Layout: renders
- Sales Module → Billing Workflow: contains
- Billing Workflow → Billing Route Selection: starts with
- Billing Route Selection → Bill Summary: workflow state
- Sales Module → Payment Workflow: contains
- Payment Workflow → Payment Routes: configures
- Payment Routes → Payment Customer Selection: guides to
- Payment Customer Selection → Payment Bill Selection: selects bill
- Admin Module → Shared Module: uses
- Sales Module → Shared Module: uses
- Shared Module → Admin Header: provides
- Shared Module → Sales Bottom Navigation: provides
- Sales Bottom Navigation → Bottom Sheet Base: uses