How appgitusers/detailing_crm works
Purpose and entry points
This is a garage/workshop management system: customer vehicles, service estimates, job cards, inventory/vendor procurement, sales, staff, finance, notifications, and public invoice/estimate sharing. It is a Django backend API plus a Vite/React SPA.
Backend entry points are backend/manage.py, routing in backend/core/urls.py, and deployment adapters backend/core/asgi.py / backend/core/wsgi.py. Frontend boots at frontend/src/main.jsx and composes routes/UI in frontend/src/App.jsx.
Frontend application boundary
The React SPA provides authenticated operational screens, plus token-based public document views. Shared API clients isolate browser-to-backend calls under frontend/src/api/axios.js and domain modules such as frontend/src/api/jobcards.js; access control is represented by frontend/src/components/RequireAuth.jsx.
Primary operator workflows live in pages: job-card creation/detail/edit (frontend/src/pages/JobCards/Create.jsx, frontend/src/pages/JobCards/Detail.jsx), vendor/inventory operations (frontend/src/pages/Vendors/index.jsx), and dashboard reporting (frontend/src/pages/Dashboard/index.jsx). Public estimate and invoice views are separate from the authenticated layout in frontend/src/pages/Public/EstimationView.jsx, frontend/src/pages/Public/InvoiceView.jsx, and frontend/src/pages/Public/SalesInvoiceView.jsx.
Customer, vehicle, and service catalog
customers owns customer, garage-owner, and vehicle/asset records, exposed through backend/apps/customers/models.py, backend/apps/customers/serializers.py, and backend/apps/customers/views.py. These records feed estimates and job cards.
services defines the service catalog, vehicle-specific pricing, warranties, and service-to-product/stock relationships: backend/apps/services/models.py, backend/apps/services/views.py, and backend/apps/services/serializers.py. Service selection is therefore a boundary between quoting/work execution and inventory consumption.
Estimation-to-job-card lifecycle
Estimates are a pre-work commercial document with line items, selected services, vehicle metadata, and share tokens, represented in backend/apps/estimation/models.py and exposed through backend/apps/estimation/views.py. Its frontend workflow is frontend/src/pages/Estimation/estimation.jsx and frontend/src/pages/Estimation/Detail.jsx.
Job cards are the execution and billing core. backend/apps/jobcards/models.py includes job cards, service statuses, assigned employees, products/usages, payments, sales products, and sales orders. API behavior resides in backend/apps/jobcards/views.py, while job-card-specific calculations/document logic is centralized in backend/apps/jobcards/utils.py. This stage connects customers/assets, catalog services/products, employees, payments, and invoice sharing.
Procurement, inventory, and sales
The vendors domain owns vendors, products, inventory, purchase invoices/items, and invoice payments, in backend/apps/vendors/models.py, backend/apps/vendors/views.py, and backend/apps/vendors/serializers.py. Inventory state is changed by procurement and by job-card/service product use; frontend management is consolidated in frontend/src/pages/Vendors/InventoryTab.jsx and frontend/src/pages/Vendors/InvoicesTab.jsx.
Retail sales are modeled alongside job cards/sales orders, rather than as a separate backend app, in backend/apps/jobcards/models.py; the operator UI is frontend/src/pages/Sales/index.jsx.
Workforce, finance, and settings
employees manages staff, roles, attendance, shifts, payroll/advance salary, and incentives (backend/apps/employees/models.py, backend/apps/employees/views.py). Job-card employee assignment provides the operational link to performance and compensation.
finance records expenses and daily balances. Signals and balance utilities indicate finance is updated as a cross-domain side effect: backend/apps/finance/models.py, backend/apps/finance/signals.py, backend/apps/finance/balance_utils.py.
Site-level operational defaults, user profiles, notification behavior, incentive thresholds, and UPI settings are held by backend/apps/site_settings/models.py and administered through backend/apps/site_settings/views.py.
Notifications and runtime infrastructure
Notifications are persisted and exposed by backend/apps/notifications/models.py and backend/apps/notifications/views.py. Scheduled/background behavior is organized through backend/apps/notifications/scheduler.py and backend/apps/notifications/jobs.py; WhatsApp integration is isolated in backend/apps/notifications/whatsapp.py.
Django is the backend runtime with ORM migrations under each app; dependencies are declared in backend/requirements.txt. The frontend is a Node/Vite React build (frontend/package.json, frontend/vite.config.js). No database, hosting provider, task queue, or WhatsApp vendor is identifiable from the supplied tree.
Main entry points: jobcards/models.py Job cards & sales · urls.py Django API routing · estimation/models.py Estimates · vendors/models.py Vendors & inventory
Components 17
React SPA
- SPA bootstrap & routes
frontend/src/main.jsx - Authenticated access
frontend/src/components/RequireAuth.jsx - API client modules
frontend/src/api/axios.js - Operator workflows · Job cards, vendors, inventory, and dashboard operations.
frontend/src/pages/JobCards/Detail.jsx - Public document views
frontend/src/pages/Public/InvoiceView.jsx
Django API
- Django API routing
backend/core/urls.py
Operational domains
- Customers & vehicles
backend/apps/customers/models.py - Service catalog · Pricing, warranties, and service-product relationships.
backend/apps/services/models.py - Estimates · Pre-work documents with line items and share tokens.
backend/apps/estimation/models.py - Job cards & sales · Work execution, billing, payments, product usage, and sales orders.
backend/apps/jobcards/models.py - Job-card calculations
backend/apps/jobcards/utils.py - Vendors & inventory · Products, stock, purchase invoices, and vendor payments.
backend/apps/vendors/models.py - Workforce · Staff, attendance, payroll, advances, and incentives.
backend/apps/employees/models.py
Cross-cutting services
- Finance balances · Expenses and daily balances updated by cross-domain effects.
backend/apps/finance/models.py - Site settings · Profiles, defaults, notifications, incentives, and UPI settings.
backend/apps/site_settings/models.py - Notifications · Persisted notifications plus scheduled jobs and WhatsApp delivery.
backend/apps/notifications/models.py - Scheduled notification jobs
backend/apps/notifications/scheduler.py
Connections 24
- SPA bootstrap & routes → Authenticated access: protects operator routes
- SPA bootstrap & routes → Operator workflows: renders
- SPA bootstrap & routes → Public document views: renders public routes
- Operator workflows → API client modules: uses
- Public document views → API client modules: uses token requests
- API client modules → Django API routing: HTTP API
- Django API routing → Customers & vehicles: routes domain APIs
- Django API routing → Estimates: routes domain APIs
- Django API routing → Job cards & sales: routes domain APIs
- Django API routing → Vendors & inventory: routes domain APIs
- Estimates → Customers & vehicles: quotes customer vehicles
- Estimates → Service catalog: selects services
- Estimates → Job cards & sales: converts to work
- Job cards & sales → Customers & vehicles: serves vehicles
- Job cards & sales → Service catalog: executes services
- Job cards & sales → Job-card calculations: calculates documents
- Job cards & sales → Vendors & inventory: consumes stock
- Vendors & inventory → Service catalog: supplies linked products
- Job cards & sales → Workforce: assigns staff
- Job cards & sales → Finance balances: updates balances
- Vendors & inventory → Finance balances: procurement side effects
- Job cards & sales → Notifications: emits events
- Scheduled notification jobs → Notifications: schedules delivery
- Site settings → Notifications: configures behavior