Lending Lite is a Salesforce-based lending application designed to demonstrate production-grade software engineering practices within the Salesforce platform. The project is built with a strong emphasis on clean architecture, modular design, and CI/CD automation.
The system follows a layered architecture aligned with Salesforce best practices:
+--------------------------+
| Lightning UI | ← LWC (loanAppWorkbench)
+------------+-------------+
↓
+------------+-------------+
| Apex Controller Layer | ← LoanApplicationController
+------------+-------------+
↓
+------------+-------------+
| Trigger Layer | ← LoanApplicationTrigger
+------------+-------------+
↓
+------------+-------------+
| Handler Layer | ← LoanSubmitHandler
+------------+-------------+
↓
+------------+-------------+
| Service Layer | ← LoanApplicationService, ServiceFactory
+------------+-------------+
↓
+------------+-------------+
| Integration/Async Layer |
| (REST, Platform Events, |
| Queueables, External |
| Credit Bureau API) |
+--------------------------+
- Trigger → Handler → Service: Loan submission events are processed through a decoupled chain promoting reusability and testability.
- REST Layer: Exposes the
CreditScoreRestAPI for external integrations. - Platform Events: Publishes
Credit_Risk_Calculation_Request__efor async communication. - Queueable Jobs: Handles background processing and external service calls.
- Unlocked Package Structure for modular deployment.
- Trigger-Handler-Service Pattern for maintainability.
- Dependency Injection via
ServiceFactoryand@TestVisibleannotations. - Automated Testing & CI/CD via GitHub Actions.
- Pre-commit Hooks (Husky + Prettier) for code quality enforcement.
- Lightning Web Component (LWC) for loan application UI.
Unit tests are implemented for all major classes, leveraging a central TestDataFactory for consistency. The project maintains ≥85% Apex coverage across the namespace.
The repository includes GitHub Actions workflows for:
- Pull Request validation (linting, test execution)
- Automated packaging and deployment
- Version tagging for releases
The solution is designed for easy evolution:
- New features or UI elements can be added without impacting core logic.
- Service interfaces promote scalability and testability.
- Platform Events and Queueables ensure asynchronous extensibility.
-
Clone the repository
-
Authenticate to your Dev Hub:
sf org login web --set-default-dev-hub --alias DevHub
-
Create a scratch org:
sf org create scratch --definition-file config/project-scratch-def.json --alias lending-scratch --set-default
-
Deploy the source:
sf project deploy start
-
Run tests:
sf apex run test --test-level RunLocalTests --code-coverage --result-format human
MIT License