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
| Entity | Fields |
|---|---|
| BankAccount | id, date, balance, currency, AccountType, → Customer |
| Customer | owns many BankAccounts |
| AccountType | enum (e.g. CURRENT / SAVINGS) |
Interfaces
- ▸REST
/api/bankAccounts— full CRUD (GET/POST/PUT/DELETE) + Swagger UI - ▸GraphQL —
accountsList,bankAccountById(id),customersListqueries + add/update/delete mutations (GraphiQL) - ▸Spring Data REST — repository auto-exposed as hypermedia endpoints
- ▸DTO + mapper layer keeps entities decoupled from the API surface