Skip to main content

OmniCRM System Architecture

This document provides an overview of the OmniCRM system architecture, including component relationships and data flow.

High-Level System Overview

OmniCRM is a comprehensive BSS/OSS platform that integrates several key components to provide complete service management for telecom providers.

Core Components

1. Frontend Applications

OmniCRM Web UI

  • React single-page application
  • Staff interface for customer management, service provisioning, billing
  • Real-time provisioning status updates
  • Role-based access control

Self-Care Portal

  • Customer-facing portal
  • Service management and usage tracking
  • Invoice viewing and payment
  • Shared codebase with staff UI, different views

2. API Layer

OmniCRM API (Flask/Python)

  • RESTful API for all operations
  • OpenAPI/Swagger documentation
  • JWT-based authentication
  • Rate limiting and caching
  • WebSocket support for real-time updates

Key API Routes:

  • /crm/customer/* - Customer management
  • /crm/service/* - Service operations
  • /crm/product/* - Product catalog
  • /crm/provision/* - Provisioning operations
  • /crm/transaction/* - Billing transactions
  • /crm/invoice/* - Invoice management

3. Provisioning System

4. Billing & Rating

OCS/CGRateS Integration

  • Real-time charging and rating
  • Account management
  • Balance tracking (monetary, data, voice, SMS)
  • Action plans for recurring charges
  • Threshold-based notifications

Billing Workflow:

5. Data Model

OmniCRM uses a relational database with the following core models. For visual entity relationship diagrams, see Customers, Contacts, Sites & Services.

Customer - Central entity representing a company or individual

FieldTypeDescription
customer_idInteger (PK)Unique identifier
customer_nameStringCompany or individual name
customer_account_typeEnum'Individual' or 'Business'
customer_statusEnum'Open', 'Closed', 'Suspended', 'Archived'
customer_payment_typeString'prepaid' or 'postpaid'
customer_enabledBooleanIs account active
tax_identifierStringVAT/GST number
contract_start_dateDateTimeContract start
contract_end_dateDateTimeContract end

Contact - People associated with a customer

FieldTypeDescription
contact_idInteger (PK)Unique identifier
customer_idInteger (FK)Parent customer
contact_firstnameStringFirst name
contact_lastnameStringLast name
contact_emailStringEmail address
contact_phoneStringPhone number
contact_typesString'Primary', 'Billing', 'Technical'

Site - Physical service delivery locations

FieldTypeDescription
site_idInteger (PK)Unique identifier
customer_idInteger (FK)Parent customer
site_nameStringLocation name
address_line_1StringStreet address
city, state, zip_codeStringLocation details
latitude, longitudeFloatGPS coordinates
google_maps_place_idStringGoogle Maps reference
plus_codeStringOpen Location Code

Service & Product Models

Service - Active service instances

FieldTypeDescription
service_idInteger (PK)Unique identifier
customer_idInteger (FK)Parent customer
product_idInteger (FK)Product template
site_idInteger (FK)Service location
service_nameStringDisplay name
service_uuidStringBilling system identifier
service_statusEnumCurrent status
service_billedBooleanGenerate transactions
wholesale_costFloatProvider cost
retail_costFloatCustomer price
bundled_parentInteger (FK)Parent service for bundles

Product - Service offering templates

FieldTypeDescription
product_idInteger (PK)Unique identifier
product_nameStringDisplay name
product_slugStringURL-friendly name
categoryEnum'standalone', 'bundle', 'addon', 'promo'
provisioning_playStringAnsible playbook name
provisioning_json_varsJSONPlaybook variables
inventory_items_listStringRequired inventory
retail_costFloatMonthly price
retail_setup_costFloatOne-time fee
enabledBooleanAvailable for sale

Billing Models

Transaction - Individual charges/credits

FieldTypeDescription
transaction_idInteger (PK)Unique identifier
customer_idInteger (FK)Parent customer
invoice_idInteger (FK)Parent invoice (optional)
service_idInteger (FK)Related service
titleStringTransaction description
retail_costFloatAmount
tax_percentageFloatTax rate
tax_amountFloatCalculated tax
voidBooleanCancelled transaction

Invoice - Grouped transactions for billing

FieldTypeDescription
invoice_idInteger (PK)Unique identifier
customer_idInteger (FK)Parent customer
paidBooleanPayment received
voidBooleanCancelled invoice
payment_referenceStringStripe transaction ID
start_date, end_dateDateBilling period
due_dateDatePayment deadline
retail_costFloatTotal amount

Inventory Models

Inventory - Physical and virtual assets

FieldTypeDescription
inventory_idInteger (PK)Unique identifier
customer_idInteger (FK)Assigned customer
service_idInteger (FK)Linked service
inventory_template_idInteger (FK)Item type template
itemStringItem type (SIM Card, Router, etc.)
item_stateEnum'New', 'Assigned', 'Used', etc.
itemtext1-20StringFlexible fields
management_urlStringEquipment admin URL
config_contentTextConfiguration file

Inventory_Template - Defines inventory item structure

FieldTypeDescription
inventory_template_idInteger (PK)Unique identifier
itemStringTemplate name
itemtext1_labelStringLabel for itemtext1 field
itemtext2_labelStringLabel for itemtext2 field

Provisioning Models

Provision - Provisioning job tracking

FieldTypeDescription
provision_idInteger (PK)Unique identifier
product_idInteger (FK)Product being provisioned
customer_idInteger (FK)Target customer
service_idInteger (FK)Created/modified service
provisioning_playStringAnsible playbook name
provisioning_statusInteger0=Success, 1=Running, 2=Failed

Provision_Event - Individual provisioning steps

FieldTypeDescription
provision_event_idInteger (PK)Unique identifier
provision_idInteger (FK)Parent provision job
event_nameStringTask name
event_numberIntegerSequence number
provisioning_statusInteger0=Success, 1=Running, 2=Failed
provisioning_result_jsonJSONFull task output

User & Security Models

User - User accounts

FieldTypeDescription
idInteger (PK)Unique identifier
usernameStringLogin username
emailStringEmail address
email_verifiedBooleanEmail confirmed
is_2fa_enabledBooleanTwo-factor auth enabled
totp_secretStringTOTP secret key

Role - User roles

FieldTypeDescription
idInteger (PK)Unique identifier
nameStringRole name
descriptionStringRole description

Permission - Granular permissions

FieldTypeDescription
idInteger (PK)Unique identifier
nameStringPermission name (resource.action)
descriptionStringPermission description

Relationships:

  • Users have many Roles (many-to-many)
  • Roles have many Permissions (many-to-many)
  • Users can link to one Contact (for customer portal access)

Integration Points

Stripe Payment Gateway

  • Tokenized payment methods
  • PCI-compliant card storage
  • Automated invoice payment
  • Refund processing
  • Expiring card notifications

Mailjet Email Service

  • Transactional emails (invoices, welcome, notifications)
  • Contact synchronization
  • Template management
  • Delivery tracking

Google Maps

  • Address autocomplete
  • Geocoding and reverse geocoding
  • Plus Code generation
  • Site location mapping

OCS/CGRateS

  • Account provisioning
  • Real-time rating
  • Balance management
  • CDR processing
  • Action plans and schedules

Security Architecture

Security Features:

  • JWT-based authentication
  • Two-factor authentication (TOTP)
  • Role-based access control (RBAC)
  • Permission-based resource access
  • Session management with Redis
  • Password hashing (bcrypt)
  • Email verification
  • Audit logging via Activity Log

Deployment Architecture

Recommended Production Setup:

Technology Stack

Backend:

  • Python 3.x
  • Flask web framework
  • SQLAlchemy ORM
  • Alembic migrations
  • Ansible for automation

Frontend:

  • React
  • State management
  • React Router
  • Axios for API calls

Database:

  • Relational database (primary data store)
  • Redis (caching & sessions)

External Services:

  • CGRateS (billing/rating)
  • Stripe (payments)
  • Mailjet (email)
  • Google Maps (geocoding)

Scalability Considerations

Horizontal Scaling:

  • Stateless API design allows multiple instances
  • Load balancer distributes requests
  • Redis for shared session state

Database Scaling:

  • Read replicas for reporting queries
  • Connection pooling
  • Query optimization and indexing

Provisioning at Scale:

  • Background job processing
  • Multiple Ansible workers
  • Job queue management
  • Retry logic for failed provisions

Monitoring & Observability

Key Metrics:

  • API response times
  • Provisioning success/failure rates
  • Database connection pool usage
  • Cache hit rates
  • Active sessions

Logging:

  • Application logs (Flask)
  • Provisioning logs (Ansible output)
  • Activity log (audit trail)
  • Error tracking and alerts