safebank-fe

SafeBank and 12-Factor App Design

At SafeBank, we are committed to building a scalable, maintainable, and portable platform that adheres to modern application design principles. By aligning with the 12-Factor App methodology, we ensure that our infrastructure is well-suited for cloud environments, enabling seamless deployment, scaling, and development.


Below is a detailed breakdown of how the 12-Factor principles are applied to SafeBank:

Factor Description Application in SafeBank
Codebase One codebase tracked in version control, many deployments. GitHub repositories (frontend, backend, infrastructure) with CI/CD pipelines for seamless deployments.
Dependencies Explicitly declare and isolate dependencies. Dependencies managed via npm for frontend for backend, isolated in containers.
Config Store configuration in the environment. Configurations (e.g., API keys, DB credentials) managed securely via Azure Key Vault and injected dynamically.
Backing Services Treat backing services as attached resources. Backing services like PostgreSQL, Key Vault, and ACR are replaceable without code changes.
Build, Release, Run Strictly separate the build, release, and run stages. CI/CD workflows enforce separation, ensuring builds are consistent and configuration-specific.
Processes Execute the app as stateless processes. Stateless backend/frontend processes deployed in Azure App Services with external state storage in PostgreSQL.
Port Binding Export services via port binding. Backend APIs bind to dynamic ports in App Services for Containers, allowing flexible communication.
Concurrency Scale out via the process model. Autoscaling for frontend and backend using Azure’s scaling capabilities to handle increased load.
Disposability Maximize robustness with fast startup and graceful shutdown. Containers are optimized for rapid startup/shutdown, with rolling updates ensuring zero downtime deployments.
Dev/Prod Parity Keep development, staging, and production as similar as possible. Consistent configurations across environments, with differences limited to access permissions.
Logs Treat logs as event streams. Logs aggregated via Azure Monitor, Application Insights, and Log Analytics for actionable insights.
Admin Processes Run admin/management tasks as one-off processes. Database migrations and maintenance tasks executed as isolated CI/CD workflows.

1. Codebase


2. Dependencies


3. Config


4. Backing Services


5. Build, Release, Run


6. Processes


7. Port Binding


8. Concurrency


9. Disposability


10. Dev/Prod Parity


11. Logs


12. Admin Processes


Why 12-Factor Matters for SafeBank

By adhering to the 12-Factor App methodology, SafeBank is designed to be:

  1. Portable across cloud platforms.
  2. Resilient to changes and failures.
  3. Scalable to meet future demands.
  4. Maintainable for seamless feature updates and debugging.

This approach ensures SafeBank not only meets current requirements but is also equipped to adapt and grow with future technological advancements. 🌟