Backend architecture and application services
Overview
Section titled “Overview”FastAPI exposes authenticated CRM operations and specialized routers for commercial documents, workflows, approvals, revenue, integrations, files and administration. Pydantic and domain validation reject unsupported input. SQLAlchemy transactions combine business changes with their audit and scheduling effects. The backend is organized by functional services inside one application codebase; the worker imports those services for delayed processing.
Purpose
Section titled “Purpose”Use the service boundaries to locate the correct support evidence and to avoid treating every visible page as an independent deployment service.
Prerequisites
Section titled “Prerequisites”-
A known product release.
-
A reproducible symptom, the affected module and the approximate time.
Procedure
Section titled “Procedure”-
Identify whether the failure is an HTTP request or delayed work. Requests are handled by the API; queued work is handled by the worker.
-
Check the response status and safe user-facing message. Use field-level validation feedback for rejected data, and refresh for a stale-version conflict.
-
Check System Health for database, storage and worker evidence before changing application data.
-
For a commercial or automation operation, inspect its history or execution receipt. This identifies which business transition actually committed.
-
Escalate persistent failures with the module, operation, time, request identifier when available and a sanitized reproduction.
Expected result
Section titled “Expected result”The incident is associated with the API, a domain rule, a persisted job or an infrastructure dependency, making corrective work specific.
Screenshots and diagrams
Section titled “Screenshots and diagrams”Important notes
Section titled “Important notes”-
Authentication, CSRF, authorization and licensed capability checks run on the server. Direct API requests do not bypass them.
-
Core record updates use optimistic versions; conversions and commercial transitions also use transactional locking and uniqueness constraints.
-
The safe server entry point is app.server. Ad hoc server commands can bypass the intended logging configuration and should not replace package service definitions.
Troubleshooting
Section titled “Troubleshooting”-
A conflict response follows repeated submission: inspect the current record and operation history before submitting again.
-
An unexpected error persists: preserve the safe diagnostic context and contact support; do not repair live records directly in the database.