{"id":29607587,"url":"https://github.com/youhad08/e-bank-backend-springboot","last_synced_at":"2026-04-15T10:36:03.154Z","repository":{"id":305541228,"uuid":"1020894482","full_name":"YOUHAD08/e-bank-backend-springboot","owner":"YOUHAD08","description":"Digital banking system backend developed with Spring Boot. Includes customer and account management, operations, and REST APIs.","archived":false,"fork":false,"pushed_at":"2025-07-20T16:45:34.000Z","size":499,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-20T18:25:30.206Z","etag":null,"topics":["api","hibernate","java","java21","lombok","maven","mysql","openapi","rest-api","restful-api","spring-boot","spring-data-jpa","spring-framework","spring-web","swagger"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YOUHAD08.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-16T14:56:04.000Z","updated_at":"2025-07-20T16:45:38.000Z","dependencies_parsed_at":"2025-07-20T18:36:14.836Z","dependency_job_id":null,"html_url":"https://github.com/YOUHAD08/e-bank-backend-springboot","commit_stats":null,"previous_names":["youhad08/e-bank-backend-springboot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/YOUHAD08/e-bank-backend-springboot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOUHAD08%2Fe-bank-backend-springboot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOUHAD08%2Fe-bank-backend-springboot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOUHAD08%2Fe-bank-backend-springboot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOUHAD08%2Fe-bank-backend-springboot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YOUHAD08","download_url":"https://codeload.github.com/YOUHAD08/e-bank-backend-springboot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOUHAD08%2Fe-bank-backend-springboot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266180411,"owners_count":23888742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","hibernate","java","java21","lombok","maven","mysql","openapi","rest-api","restful-api","spring-boot","spring-data-jpa","spring-framework","spring-web","swagger"],"created_at":"2025-07-20T19:00:47.448Z","updated_at":"2026-04-15T10:36:03.144Z","avatar_url":"https://github.com/YOUHAD08.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💳 E-BANK Backend Application\n\nA robust and modular backend banking system built with **Spring Boot**, **Spring Data JPA**, and **MariaDB/MySQL**.\n\nThis backend powers core banking features such as customer management, bank account operations (debit, credit, transfer), and full transaction history. The application is structured with clean architectural separation (DTOs, services, mappers, exception handling) and JWT-based security.\n\n\u003e ⚠️ This repository contains the **backend only**. The **Angular frontend** is implemented in this  [repository](https://github.com/YOUHAD08/e-bank-frontend-angular.git).\n\n---\n\n## 🚀 Features\n\n### ✅ Customer Management\n\n- Create, update, retrieve, and delete customers. \n- Search customers by keyword or exact name.\n\n### ✅ Bank Account Management\n\n- Supports Current Accounts (with overdraft) and Saving Accounts (with interest rate). \n- Create, update, delete, and retrieve bank accounts. \n- Retrieve accounts by customer.\n\n### ✅ Account Operations\n\n- Debit, credit, and transfer between accounts. \n- Track full transaction history with pagination and summaries.\n\n### ✅ Advanced History API\n- Structured account history using `AccountHistoryDTO`.\n- Access latest operation summaries.\n\n### ✅ Security \u0026 Authentication\n\n-JWT-based authentication with role-based access control (USER and ADMIN scopes). \nPassword encryption using BCrypt.\n\n### ✅ Exception Handling\nHandles common banking errors:\n- `CustomerNotFoundException`\n- `BankAccountNotFoundException`\n- `InsufficientBalanceException`\n\n### ✅ API Documentation\n\nInteractive Swagger UI at:\n\n  http://localhost:8085/swagger-ui/index.html\n  \n---\n\n## 📂 Project Structure\n\n![Backend Project Structure](images/project-structure.png)\n\n- **Entities:** `Customer`, `BankAccount`, `CurrentAccount`, `SavingAccount`, `AccountOperation`\n- **DTOs:** Transfer objects for API communication\n- **Repositories:** Spring Data JPA Repositories\n- **Services:** Business logic with interfaces and implementations\n- **Controllers:** REST API endpoints secured by JWT scopes\n- **Mappers:** Entity ↔ DTO transformation\n- **Exceptions:** Custom exceptions for domain errors\n- **Security**: JWT generation and validation, password encoding\n\n---\n\n## 🧩 MySQL Database Structure\n\nThis backend currently uses a **relational MySQL** database to persist customer, account, and transaction data.\n\n![MySQL Database Schema](images/mysql-db.png)\n\n### 🔗 Relationships\n\n- **1️⃣ Customer ⇨ N BankAccounts**\n- **1️⃣ BankAccount ⇨ N AccountOperations**\n\n---\n\n## 🛠️ Technologies Used\n\n| Technology        | Version           |\n|-------------------|-------------------|\n| Java              | 21                |\n| Spring Boot       | 3.5.3             |\n| Spring Data JPA   | Included          |\n| MySQL             | 8+                |\n| Lombok            | 1.18.34           |\n| Swagger / OpenAPI | 2.5.0             |\n| Maven             | Build Tool        |\n| H2 (optional)     | For testing       |\n| JWT (Nimbus JOSE) | included          |\n| BCrypt            | Password Encoding |\n\n\n---\n\n## 💻 Getting Started\n\n### Prerequisites\n\n- Java 21+\n- Maven\n- MySQL running (DB name: `E-BANK`)\n- (Optional) phpMyAdmin or MySQL client\n\n---\n\n### ⚙️ Setup \u0026 Run\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/YOUHAD08/e-bank-backend-springboot.git\n   cd e-bank-backend-springboot\n\n\n2. Configure database in `src/main/resources/application.properties`:\n   ```bash\n   spring.datasource.url=jdbc:mysql://localhost:3306/E-BANK?createDatabaseIfNotExist=true\n   spring.datasource.username=root\n   spring.datasource.password=\n\n3.  Build \u0026 Run\n    ```bash\n     mvn clean install\n     mvn spring-boot:run\n\n4. Access the APIs:\n\n- Swagger UI: http://localhost:8085/swagger-ui/index.html\n- MySQL Database via phpMyAdmin: http://localhost/phpmyadmin/index.php?route=/database/structure\u0026db=e-bank\n\n---\n\n## 📄 API Overview\n\n### Customer API (`/auth`)\n\n- `POST /auth/login` — Login with username and password, returns JWT token. \n- `POST /auth/signup` — Register a new customer (role USER by default). \n- `GET /auth/profile` — Get current authenticated user details.\n\n### Customer API (`/customer, /customers`)\n\n- `GET /customers` — List all customers.\n- `GET /customer/{id}` — Get customer by ID.\n- `GET /customers/search?keyword=` — Search customers by keyword.\n- `GET /customer/search?name=` — Search customer by exact name.\n- `POST /customer` — Create customer (ADMIN only).\n- `PUT /customer/{id}` — Update customer (ADMIN only).\n- `DELETE /customer/{id}` — Delete customer (ADMIN only)\n\n### Bank Account API (`/account`, `/accounts`, `/currentAccount`, `/savingAccount`)\n\n- `GET /account/{accountId}`— Get bank account by ID. \n- `GET /accounts` — List all accounts. \n- `GET /accounts/{customerId}` — List all accounts of a customer. \n- `POST /currentAccount/{customerId}` — Create current account (ADMIN only). \n- `POST /savingAccount/{customerId}` — Create saving account (ADMIN only). \n- `PUT /currentAccount/{accountId}` — Update current account (ADMIN only). \n- `PUT /savingAccount/{accountId}` — Update saving account (ADMIN only). \n- `DELETE /account/{accountId}` — Delete account (ADMIN only).\n\n### Account Operations API (`/account/{accountId}/operations`)\n\n- `GET /account/{accountId}/operations` — List all operations for an account. \n- `GET /account/{accountId}/pageOperations?page=\u0026size=` — Paginated operations list. \n- `POST /account/{accountId}/debit?amount=\u0026description=` — Debit an account. \n- `POST /account/{accountId}/credit?amount=\u0026description=` — Credit an account (ADMIN only). \n- `POST /account/{accountId}/transfer?toAccountId=\u0026amount=` — Transfer money (ADMIN only). \n- `GET /operations` — List all account operations.\n\n---\n\n## 📚 Exception Handling\n\n- `CustomerNotFoundException` - Thrown when a customer is not found. \n- `BankAccountNotFoundException` - Thrown when a bank account is not found. \n- `InsufficientBalanceException` - Thrown when an account has insufficient funds for a debit or transfer.\n\n---\n\n## 🧪 Database Initialization\n\nOn startup, the application seeds the database with:\n\n- 10 customers with realistic names, cities, and emails. \n- 3 to 5 random accounts per customer (mix of current and saving). \n- 10 to 20 random debit and credit operations per account.\n\n---\n\n## 🤝 Contribution\n\nContributions are welcome! Feel free to open issues or pull requests so we grow together.\n\n---\n\n## 🖥️ Next Steps: Agentic AI \u0026 Future Database Migration\n\nThis project currently implements the **backend RESTful API** using **Spring Boot** and a relational **MySQL** database.\n\n### 🔜 Upcoming Plans\n\n#### 🛠️ Frontend (Done):\n\nThe frontend is currently under development using Angular and is structured to provide a clean and interactive UI for:\n\n- Customer and account management \n- Performing debit/credit/transfer operations \n- Viewing paginated account operation history\n- ... and more features to come\n\n\n#### 🤖 Agentic AI Integration (In Progress):\nIn future development, I plan to build an **agentic AI component** to work alongside this backend. While the full scope is yet to be defined, potential features might include:\n\n- Intelligent customer support and chatbot integration\n- Automated transaction analysis and fraud detection\n- Personalized financial advice and account management\n- Dynamic task automation within the banking system\n\nThis agentic AI will aim to enhance user experience, improve operational efficiency, and provide smart automation capabilities.\n\n#### 🔁 Future Migration to MongoDB:\nAlthough this version uses **MySQL**, a future version of this backend will be migrated to **MongoDB** to take advantage of:\n\n- Flexible document-based schema\n- Easier scalability\n- Faster iterations in development\n\nStay tuned for the **agentic AI enhancements**, and the **MongoDB-backed backend**!\n\n---\n\n\u003e Developed by **Youhad**  \n\u003e © 2025\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouhad08%2Fe-bank-backend-springboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyouhad08%2Fe-bank-backend-springboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouhad08%2Fe-bank-backend-springboot/lists"}