All Projects
Backend

Bank Account Microservice — REST · GraphQL · Data REST

A bank-account microservice exposing the same domain through three interfaces — a hand-written REST API, a GraphQL API, and auto-generated Spring Data REST — with DTO/mapper layering, OpenAPI/Swagger docs and an H2 store.

3
API interfaces
5
CRUD endpoints
H2
Store
Swagger/GraphiQL
Docs
Approach

Layered web→service→repository design exposing one domain via REST, GraphQL and Spring Data REST

Tech Stack
Java 17Spring Boot 3.3Spring Data JPAGraphQLSpring Data RESTH2OpenAPI/SwaggerMaven
Keywords
Spring BootRESTGraphQLSpring Data RESTJPADTOSwaggerH2
Deep Dive

A clean layered microservice for managing bank accounts and customers, exposing the same data three ways so you can compare hand-written vs. auto-generated APIs.

Layered architecture

Web (REST controllers + GraphQL resolvers + Spring Data REST)
   │
Service layer  (business logic, @Transactional)
   │
Repositories (Spring Data JPA)
   │
Entities  (BankAccount ── Customer, AccountType enum)

Domain

EntityFields
BankAccountid, date, balance, currency, AccountType, → Customer
Customerowns many BankAccounts
AccountTypeenum (e.g. CURRENT / SAVINGS)

Interfaces

  • REST /api/bankAccounts — full CRUD (GET/POST/PUT/DELETE) + Swagger UI
  • GraphQLaccountsList, bankAccountById(id), customersList queries + add/update/delete mutations (GraphiQL)
  • Spring Data REST — repository auto-exposed as hypermedia endpoints
  • DTO + mapper layer keeps entities decoupled from the API surface