How lakhan-nad/splitwise works
Project type and purpose
• This is a backend service (a Go-based library or microservice) implementing the core “Splitwise” debt‐splitting logic at low‐level design (LLD) for group expense management.
• The README calls it “splitwise LLD” and mentions TODOs around “debt simplification” and “minimum transactions” algorithms, confirming its focus on business logic rather than a full UI.
File structure
• Top-level modules:
• core/ → core algorithms and models (balance mapping, heap‐based minimization, payable simplification)
• splits/ → split‐calculation strategies and strategy interface
• splitwise/ → high-level “manager” or façade to orchestrate splits and contributions
• transaction/ → domain for Transaction, TransactionHistory, Account, plus their repository interfaces
• user/ → User entity and UserRepository
• Supporting files:
• go.mod → module dependencies
• README.md → project description and TODOs
• Patterns:
• Layered design—separation of domain models, repositories, business algorithms, and orchestration.
• Strategy pattern in splits/strategies.go
• Repository pattern for persistence interfaces.
README for additional insights
• Core focus is on two algorithmic features: “debt simplification like actual splitwise” and “subset‐sum minimum transactions.”
• No existing API layer or database choice is specified; those would be external integrations.
Elements
• Blue: API/Manager (orchestration)
• Green: Strategy & Core algorithm modules (business logic)
• Yellow: Domain entities (models)
• Gray: Repositories & database (persistence)
• Notes on key interfaces: splits.Strategy, UserRepo, TransactionRepo