Skip to content
EzzElDin Salah — home
← Work
Backend

Money Transfer API

Spring Boot money transfer service built during my Aman Holding internship: atomic transfers under optimistic locking, JWT sessions whose invalidation actually sticks, and 87 integration tests over all 15 endpoints.

  • Java
  • PostgreSQL
  • REST API
  • Spring Boot
  • Spring Security
  • Testing

Systems implemented

  • Atomic transfers. The debit, the credit and the ledger entry commit together in one @Transactional unit, with @Version optimistic locking on the account row. If two transfers try to spend the same balance at once, one of them gets a 409 instead of the account going negative. Transfers between my own accounts, to another user, and to an external bank all go through this one path.
  • A ledger that keeps history accurate. Each transaction stores a copy of the recipient's account number and name, not just a foreign key, so old history stays correct after an account is renamed or closed. It also means an external recipient doesn't need an account row, which is what made external transfers possible.
  • Checks before money moves. One call confirms the recipient exists, shows their name masked to initials so the sender can recognise it without learning a stranger's full name, and says whether the sender can cover the amount. The source account has to belong to the caller, so the check can't be used to read someone else's balance.
  • Identity comes from the token, never the request. No endpoint takes a user id. The caller is whoever the JWT says they are, so there's no id to tamper with.
  • Session timeouts that actually stick. The 30-minute inactivity rule rejected one request and then accepted the same request on retry, because timing out a token deleted the only record that it had timed out. Invalidated tokens are now stored with a reason and can't come back. They're keyed by a SHA-256 hash instead of the raw token, and cleaned up once the token's own expiry passes.
  • Paginated, date-filtered history without N+1 queries. A page of twenty rows was running forty extra selects to look up the names on each side. Fetch-joining the accounts and their users removed them, and because every relation is many-to-one, the database still applies LIMIT and OFFSET itself.
  • Tests at two levels. 87 JUnit tests go through the real security filter chain with MockMvc, including rollback on insufficient funds and isolation between users. A 72-request Postman/Newman suite ends by re-reading every balance to confirm the rejected transfers rolled back completely.

Fifteen endpoints covering registration and login, profiles, accounts and sub-accounts, transfers, history and saved recipients, plus a small React client to try them. Java 25, Spring Boot 4, Spring Security 6, Spring Data JPA and PostgreSQL 18, documented with Swagger/OpenAPI.

Built in summer 2026 during my backend internship on the Bill Payment team at Aman Holding, from the company's written spec for a money transfer service. It's a training project, not a production system, and the repository is private, so there's no link to it here.