Skip to content

amolc/openbank

Repository files navigation

OpenBank API

A comprehensive Express.js application simulating banking APIs for educational purposes, covering API Banking Services syllabus.

Features

  • REST API: Full CRUD operations for accounts
  • SOAP API: WSDL-based service for account retrieval
  • GraphQL API: Query accounts and transactions
  • WebSocket: Real-time balance updates
  • Authentication: JWT token-based auth
  • Security: Rate limiting, CORS, Helmet
  • Documentation: Swagger/OpenAPI docs
  • Monitoring: Logging with Morgan

Setup

  1. Clone the repository
  2. Run npm install
  3. Run npm start
  4. Access API at http://localhost:8000
  5. Docs at http://localhost:8000/api-docs
  6. GraphQL at http://localhost:8000/graphql

API Endpoints

Authentication

  • POST /api/v1/auth/login - User login to get JWT token
  • POST /api/v1/auth/token - OAuth 2.0 Client Credentials for TPPs
  • POST /api/v1/auth/consent-token - Generate consent token

Accounts (REST)

  • GET /api/v1/accounts - List accounts (with ETag caching)
  • GET /api/v1/accounts/:id - Get account by ID
  • POST /api/v1/accounts - Create account (auth required)
  • PUT /api/v1/accounts/:id - Update account (auth required)
  • DELETE /api/v1/accounts/:id - Delete account (auth required)

Customers

  • GET /api/v1/customers - List customers (auth required)
  • GET /api/v1/customers/:id - Get customer by ID (auth required)
  • POST /api/v1/customers - Onboard new customer (KYC-lite)
  • PUT /api/v1/customers/:id - Update customer KYC status (auth required)

Payments

  • POST /api/v1/payments - Initiate fund transfer (auth required)

Consents

  • GET /api/v1/consents - List consents (auth required)
  • POST /api/v1/consents - Grant consent (auth required)
  • PUT /api/v1/consents/:id - Revoke consent (auth required)

Transactions

  • GET /api/v1/transactions - List transactions with pagination/filtering (consent required)

Webhooks

  • POST /api/v1/webhooks - Register webhook subscription

SOAP

  • POST /soap/account - Get account via SOAP

GraphQL

  • POST /graphql - Query accounts

WebSocket

  • Connect to ws://localhost:8000 for real-time updates

Labs

Day 1: API Banking Fundamentals

  • Explore REST endpoints with Postman
  • Test SOAP call
  • Visualize GraphQL queries
  • Test OAuth 2.0 flows
  • Onboard customers and create accounts

Day 2: API Integration & Testing

  • Use Swagger docs
  • Mock APIs with Postman
  • Run tests with Newman
  • Test consent flows
  • Implement webhooks

Day 3: Advanced Design

  • Test pagination and filtering on transactions
  • Test ETag caching on accounts
  • Test WebSocket real-time updates
  • Monitor logs and metrics
  • Simulate Open Banking use cases

Technologies

  • Node.js, Express
  • GraphQL, SOAP
  • WebSocket
  • JWT, Swagger
  • Morgan, Helmet

License

ISC

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors