A distributed banking system API built with Elixir and Phoenix Framework, designed with a strong focus on reliability and scalability through clustering capabilities.
This project implements a robust banking system that leverages Elixir's distributed computing capabilities. The architecture is built around fault tolerance and horizontal scalability, allowing multiple nodes to work together seamlessly.
- Multi-node clustering using
libcluster - Automatic load balancing across nodes
- Fault-tolerant operations
- Node-aware transaction handling
- Account management (creation, updates, deletion)
- Secure money transfers between accounts
- Deposits and withdrawals with consistency guarantees
- Real-time balance tracking
This project follows Test-Driven Development (TDD) principles strictly, with comprehensive test coverage for:
- Unit tests for all business logic
- Integration tests for API endpoints
- Property-based tests for critical operations
- Clustered operations testing
Current test coverage: +90% (tracked by Coveralls)
- Elixir 1.17.3
- Erlang/OTP 27.1
- PostgreSQL 14
- Install dependencies:
mix deps.get- Setup database:
mix setup- Run tests to ensure everything is working:
mix testTo start multiple nodes in development:
# Terminal 1 - Start first node
PORT=4001 iex --name node1@127.0.0.1 -S mix phx.server
# Terminal 2 - Start second node
PORT=4002 iex --name node2@127.0.0.1 -S mix phx.server
# Terminal 3 - Start third node
PORT=4003 iex --name node3@127.0.0.1 -S mix phx.serverThe nodes will automatically discover each other and form a cluster.
The project emphasizes thorough testing:
# Run all tests
mix test
# Run with coverage report
mix coveralls.html
# Run Credo for code analysis
mix credo --strict
# Run full check (format, credo)
mix checkTo DO:
- API Documentation