A secure, scalable ledger management REST API with JWT authentication, account management & atomic transactions.
https://backend-ledger-8to4.onrender.com
Secure token-based auth with bcrypt password hashing & token blacklisting on logout.
Double-entry bookkeeping with immutable ledger entries. Balances derived from credit/debit aggregation.
MongoDB sessions ensure ACID compliance. Idempotency keys prevent duplicate processing.
Automated emails via Gmail OAuth2 for registration confirmations and transaction alerts.
{
"name": "John Doe",
"email": "john@example.com",
"password": "securepassword123"
}
{
"user": { "_id": "...", "email": "...", "name": "..." },
"token": "jwt_token_here"
}
{
"email": "john@example.com",
"password": "securepassword123"
}
{
"user": { "_id": "...", "email": "...", "name": "..." },
"token": "jwt_token_here"
}
Authorization: Bearer <token>
{ "message": "User logged out successfully" }
Authorization: Bearer <token>
{
"account": {
"_id": "...", "user": "...",
"status": "ACTIVE", "currency": "INR"
}
}
Authorization: Bearer <token>
{ "accounts": [ { "_id": "...", "status": "ACTIVE", ... } ] }
Authorization: Bearer <token>
{ "accountId": "...", "balance": 1000 }
{
"fromAccount": "account_id_1",
"toAccount": "account_id_2",
"amount": 500,
"idempotencyKey": "unique_key_123"
}
{
"message": "Transaction completed successfully",
"transaction": { "_id": "...", "status": "COMPLETED", ... }
}
Authorization: Bearer <system_token>
{
"toAccount": "account_id",
"amount": 10000,
"idempotencyKey": "unique_key_456"
}
{
"message": "Initial funds transaction completed successfully",
"transaction": { ... }
}