Skip to main content

Architecture

Presta LMS is built with a multi-tenancy architecture that allows multiple organizations to use the same software while keeping their data separate from each other. This means that every organization that uses the software has its own database that is isolated from other organizations' databases.

At the same time there's a tenants service that stores information about the organizations and the Keycloak authentication realm for each organization.

Every organization that signs up for the software is given a unique identifier (Tenant ID). When an organization logs in, the server retrieves the organization's tenant ID from the login request and uses it to identify the organization's database. All database operations performed by the organization's users are performed on their own database.

Each service evaluates the JWT token exchanged to determine the tenant and therefore the database, and then routes all requests to the appropriate database based on the tenant ID.

Presta Architecture Diagram

Components:

  • Nginx Proxy: Proxy server configured to redirect requests that start with /api to dynamic data (API endpoints) to the API gateway, and all other requests to the corresponding UI applications.

  • Keycloak: Unauthenticated clients will be redirected to Keycloak OAuth server for authentication. Keycloak is also used for token verification by internal systems. Each organization has a dedicated realm on Keycloak.

  • API Gateway: All API calls go through the API Gateway. The gateway will amongst other services, implement security checks, perform Token Exchange (Authentication-Code grant), perform session management for webapps, route traffic to backend services, enforce rate limits and support canary deployments.

  • Internal Services: The Presta LMS is an ecosystem of multiple services deployed on multiple domains supporting Single Sign On (SSO). Key services include the LMS (Loan management & accounting), Payments Integrations services, E-Guarantorship amongst others.

Databases

  • MongoDB: Tenant/ Users/ Payments
  • Postgresql Keycloak / E-Guarantorship/ Zoho Integration/
  • Mysql8 LMS/ Appraisal/ Batch Processor/ Shares/ Billing/ Scheduler