A lightweight, scalable accounting microservice implementing double-entry bookkeeping principles. Designed as a financial ledger backend for enterprise applications.
- ✅ Double-Entry Bookkeeping — Every transaction balanced with debit/credit
- 🏦 Multi-Account Support — Assets, liabilities, equity, revenue, expenses
- 🔄 Transaction Journaling — Full audit trail for every financial event
- 📊 Balance Reporting — Real-time account balances and statements
- 🔒 ACID Compliant — Guaranteed data consistency and integrity
- ⚡ REST API — Fast, async endpoints via FastAPI
| Layer | Technology |
|---|---|
| API Framework | FastAPI (Python) |
| Database | MariaDB / MySQL |
| ORM | SQLAlchemy |
| Validation | Pydantic v2 |
| Migrations | Alembic |
| Server | Uvicorn |
git clone https://github.com/asad4230/ledger-service.git
cd ledger-service
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtuvicorn main:app --reload --host 0.0.0.0 --port 8000API docs: http://localhost:8000/docs
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/accounts |
List all accounts |
POST |
/api/v1/accounts |
Create a new account |
GET |
/api/v1/accounts/{id}/balance |
Get account balance |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/transactions |
Record a new transaction |
GET |
/api/v1/transactions/{id} |
Get transaction details |
GET |
/api/v1/journal |
View full journal entries |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/reports/trial-balance |
Trial balance report |
GET |
/api/v1/reports/income-statement |
Income/loss summary |
- Internal accounting engines for ERP systems (ERPNext, custom ERP)
- Fintech / leasing application financial backends
- Retail chain financial reporting services
MIT License
Built by [Asad Mushtaq](https://github.com/asad4230) · Solution Architect & Tech Lead