Backend Architecture Overview
The backend of Olara is designed as a modular, service-oriented architecture. Each service is responsible for a specific domain, ensuring scalability, maintainability, and clear separation of concerns. This documentation provides an overview of the backend structure, core services, and integration patterns.
Table of Contents
Architecture Principles
- Microservices: Each domain is encapsulated in its own service.
- API-First: All services expose RESTful APIs for communication.
- Statelessness: Services are stateless where possible, with state managed in dedicated databases.
- Security: Authentication and authorization are enforced at the API gateway and service level.
- Observability: Logging, monitoring, and tracing are implemented across all services.
Core Services
Configs
Handles dynamic configuration management for backend services. Supports runtime updates and versioning.
Document Management
Manages storage, retrieval, and lifecycle of user and system documents. Integrates with secure storage and audit logging.
Fee Service
Calculates and manages transaction fees, commissions, and related business rules. Supports dynamic fee schedules.
Gateway
Acts as the API gateway, routing requests, enforcing security, and aggregating responses from microservices.
Guidelines
Provides business rules, compliance guidelines, and operational policies for backend processes.
KYC (Know Your Customer)
Manages user identity verification, document validation, and compliance with regulatory requirements.
Notification
Handles delivery of notifications via email, SMS, and in-app channels. Supports templating and scheduling.
Order Management
Processes and tracks user orders, including creation, updates, and fulfillment workflows.
Payment
Integrates with payment gateways, manages payment processing, settlements, and reconciliation.
Stock Market Data
Aggregates and provides real-time and historical stock market data for use by other services and the frontend.
User Management
Handles user registration, authentication, authorization, and profile management.
Wallet
Manages user wallets, balances, transactions, and ledger operations. Ensures transactional integrity and security.
Integration & Communication
- API Gateway: All external and internal API calls are routed through the gateway for security and observability.
- Service-to-Service Communication: Uses RESTful APIs and, where needed, message queues for asynchronous processing.
- Database: Each service has its own database schema; sensitive data is encrypted at rest.
Security
- Authentication: OAuth2 and JWT-based authentication for all APIs.
- Authorization: Role-based access control (RBAC) enforced at the service level.
- Data Protection: Encryption in transit (TLS) and at rest. Regular security audits and vulnerability scanning.
Deployment & Operations
- Containerization: All services are containerized (Docker) for consistent deployment.
- Orchestration: Managed via Docker Compose or Kubernetes.
- CI/CD: Automated build, test, and deployment pipelines.
- Monitoring: Centralized logging, metrics, and alerting using tools like Prometheus, Grafana, and ELK stack.