Skip to content

darisadam/madabank-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

105 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MadaBank API

CI Pipeline CD Pipeline codecov Go Report Card

Production-grade banking monolith demonstrating DevOps excellence

🎯 Project Goals

This project demonstrates enterprise-level backend and DevOps practices:

  • βœ… ACID-compliant financial transactions
  • βœ… Security-first architecture (encryption, JWT, secrets management)
  • βœ… Full observability (metrics, logs, traces, alerts)
  • βœ… Automated CI/CD with security scanning
  • βœ… Cost-optimized AWS deployment
  • βœ… Kubernetes-ready architecture
  • βœ… ISO 27001 & CMMI compliance concepts

πŸš€ Quick Start

# Clone repository
git clone https://github.com/darisadam/madabank-server.git
cd madabank-server

# Run with Docker Compose
make docker-up

# Run tests
make test

# View coverage
make test-coverage

πŸ“Š CI/CD Pipeline

Our automated pipeline includes:

  • Linting & Code Quality: golangci-lint, gofmt, go vet
  • Testing: Unit tests with 70%+ coverage
  • Security Scanning: Gosec, Trivy, Nancy
  • Docker Build: Multi-stage optimized builds
  • Automated Deployment: AWS ECS (Dev/Staging) & Private VPS (Production via Jenkins)

Running CI Checks Locally

# Lint code
make lint

# Run all tests
make test

# Security scan
make security-scan

# Build Docker image
make docker-build

πŸ›‘οΈ Security

Security is a top priority:

  • All passwords hashed with bcrypt
  • JWT authentication with RS256
  • Encryption at rest (AES-256-GCM)
  • TLS/HTTPS enforced
  • SQL injection protection
  • Rate limiting
  • Audit logging for all operations

See SECURITY.md for details.

πŸ“š Documentation

πŸ› οΈ Tech Stack

Layer Technology Purpose
Backend Go 1.24+ High performance, type safety
Framework Gin Fast HTTP routing
Database PostgreSQL 16 ACID compliance
Cache Redis 7 Session & rate limiting
Container Docker Portability
Orchestration ECS (Dev) / Docker Compose (Prod) Hybrid Cloud Strategy
IaC Terraform & Ansible Infrastructure automation
CI/CD GitHub Actions & Jenkins Hybrid Pipeline
Monitoring Prometheus + Grafana Observability
Security Gosec, Trivy Vulnerability scanning

πŸ§ͺ Testing

# Unit tests
go test -v ./...

# With coverage
go test -v -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out

# Integration tests
go test -v ./tests/integration/...

# Benchmark tests
go test -bench=. -benchmem ./...

πŸ† Key Engineering Challenges Solved

This project goes beyond basic CRUD, tackling real-world distributed system challenges:

  • Distributed ACID Transactions: Implemented a custom transaction manager ensuring data integrity across complex financial operations (Transfer, Payment, Topup).
  • Zero-Downtime Deployments: Configured AWS ECS with Rolling Updates and Connection Draining to ensure 100% availability during releases.
  • Encryption at Scale: Designed an End-to-End Encryption (E2EE) module using AES-256 + RSA-2048 to protect sensitive card data from the client to the database, ensuring PCI-DSS compliance concepts.
  • Cost vs. Performance Optimization: Architected Terraform modules to support "Single NAT Gateway" for Dev/Staging (saving $150/mo) while maintaining Multi-AZ redundancy for Production.

πŸš€ Deployment & Environments

We utilize a Tuple Deployment Strategy with fully isolated environments managed by Terraform.

Environment Branch URL Infrastructure
Development develop api-dev.madabank.art AWS ECS (Single AZ)
Staging staging api-staging.madabank.art AWS ECS (Single AZ)
Production main api.madabank.art Private VPS (Docker Compose)

πŸ‘‰ Read the Full Deployment Guide

πŸ’° Cloud Cost Management

To demonstrate FinOps practices, this project includes automated scripts to "pause" environments when not in use. πŸ‘‰ See Cost Management Guide

# Example: Stop all non-production environments
./scripts/manage-dev.sh stop

πŸ“ˆ Roadmap

  • User authentication & authorization (JWT + Refresh Tokens)
  • Account management
  • Transaction system with ACID compliance
  • CI/CD pipeline (GitHub Actions -> AWS ECS)
  • AWS Infrastructure (Terraform for Dev/Staging/Prod)
  • Rate limiting & DDoS protection
  • Maintenance Mode
  • Card management encryptions (AES-256 + RSA-2048)
  • Prometheus metrics & Grafana dashboards
  • iOS mobile app integration (API Ready)

🀝 Contributing

Contributions are welcome! Please read our Contributing Guidelines.

πŸ‘€ Author

Daris Adam


Status: βœ… Production Ready

About

Mada Bank server app by Adam

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors