A full-stack digital banking application built with Spring Boot and React. The platform supports secure customer banking operations, administrator account management, JWT-based authentication, role-based access control, and transaction history tracking.
- Overview
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Backend Setup
- Frontend Setup
- Environment Variables
- API Endpoints
- Security
- Build
- Author
Banking System is a full-stack web application that provides a digital banking platform with two roles β Customer and Admin. Customers can register, create accounts, deposit and withdraw money, and view their transaction history. Admins can manage all users and accounts, including blocking and unblocking accounts. All APIs are secured using Spring Security and JWT authentication.
- Register and log in securely
- View personal dashboard with account summary
- Create savings or current bank accounts
- Deposit and withdraw money
- View passbook and full transaction history
- View all registered users
- View all bank accounts
- Block and unblock customer accounts
- Role-based access β admin routes are fully protected
- JWT-based stateless authentication
- BCrypt password encryption
- Role-based access control (CUSTOMER / ADMIN)
- Secure REST APIs with Spring Security
- Swagger UI for API documentation
| Technology | Purpose |
|---|---|
| Java 21 | Core programming language |
| Spring Boot | Backend framework |
| Spring Security | Authentication and authorization |
| Spring Data JPA | Database ORM |
| JWT | Stateless token-based authentication |
| MySQL | Relational database |
| Maven | Build and dependency management |
| Swagger / OpenAPI | API documentation |
| Technology | Purpose |
|---|---|
| React | Frontend UI library |
| Vite | Frontend build tool |
| React Router | Client-side routing |
| Axios | HTTP client for API calls |
| Bootstrap | UI styling and layout |
| React Toastify | Notification alerts |
Banking Application/
βββ BankingSystem/ # Spring Boot backend
β βββ src/
β β βββ main/
β β β βββ java/
β β β β βββ com/Laxman/BankingSystem/
β β β β βββ config/ # Security, CORS, data initialization
β β β β βββ controller/ # REST API controllers
β β β β βββ dto/ # Request and response DTOs
β β β β βββ entity/ # JPA entities
β β β β βββ exception/ # Global exception handling
β β β β βββ repository/ # Spring Data JPA repositories
β β β β βββ security/ # JWT and authentication filters
β β β β βββ service/ # Business logic
β β β β βββ BankingSystemApplication.java
β β β βββ resources/
β β β βββ application.properties # Application configuration
β β βββ test/ # Backend tests
β βββ pom.xml # Maven dependencies
β βββ mvnw # Maven Wrapper for Linux/macOS
β βββ mvnw.cmd # Maven Wrapper for Windows
β
βββ BankingSystem-Frontend/ # Frontend root
βββ package.json # Root npm scripts
βββ banking-frontend/ # React + Vite application
βββ public/ # Static public assets
βββ src/
β βββ api/ # Axios API configuration
β βββ assets/ # Images and static frontend assets
β βββ components/ # Reusable React components
β βββ context/ # Authentication context
β βββ pages/
β β βββ admin/ # Admin dashboard and management pages
β β βββ auth/ # Login and registration pages
β β βββ user/ # Customer banking pages
β βββApp.jsx # Application routes
β βββ main.jsx # React entry point
β βββ index.css # Global styles
βββ .env.example # Example frontend environment variables
βββ package.json # Frontend dependencies and scripts
βββ vite.config.js # Vite configuration
βββ index.html # HTML entry file
Make sure the following are installed on your machine before running the project:
| Tool | Version | Purpose |
|---|---|---|
| Java | 21 | Run Spring Boot backend |
| Node.js + npm | Latest LTS | Run React frontend |
| MySQL | 8.0+ | Database |
| Git | Any | Version control |
Maven is not required separately β the backend includes Maven Wrapper (
mvnw.cmd).
1. Navigate to the backend directory:
cd BankingSystem2. Create the MySQL database:
CREATE DATABASE bankingDB;3. Set environment variables (PowerShell):
$env:DB_URL="jdbc:mysql://localhost:3306/bankingDB"
$env:DB_USERNAME="root"
$env:DB_PASSWORD="your_mysql_password"
$env:JWT_SECRET="your-long-secure-jwt-secret-key"
$env:ADMIN_EMAIL="admin@banking.com"
$env:ADMIN_PASSWORD="your_admin_password"4. Run the backend:
.\mvnw.cmd spring-boot:runThe backend starts on: http://localhost:8085
Swagger API docs available at: http://localhost:8085/swagger-ui.html
1. Navigate to the frontend directory:
cd BankingSystem-Frontend2. Install dependencies:
npm install --prefix banking-frontend3. Create a .env file inside banking-frontend/:
VITE_API_URL=http://localhost:80854. Run the frontend:
npm run devThe frontend starts on: http://localhost:5173
If port 5173 is busy, Vite will automatically use the next available port (e.g. 5174).
| Variable | Description | Example |
|---|---|---|
| DB_URL | MySQL connection URL | jdbc:mysql://localhost:3306/bankingDB |
| DB_USERNAME | Database username | root |
| DB_PASSWORD | Database password | your_password |
| JWT_SECRET | Secret key for JWT signing | your-secret-key |
| JWT_EXPIRATION | Token expiry (milliseconds) | 86400000 |
| ADMIN_EMAIL | Default admin email | admin@banking.com |
| ADMIN_PASSWORD | Default admin password | your_admin_password |
| Variable | Description |
|---|---|
| VITE_API_URL | Backend base URL |
β οΈ Never commit.envfiles to GitHub. They are already excluded in.gitignore.
| Method | Endpoint | Description | Access |
|---|---|---|---|
| POST | /api/auth/register | Register a new user | Public |
| POST | /api/auth/login | Login and get JWT token | Public |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /api/accounts | Get user's accounts | Customer |
| POST | /api/accounts | Create a new account | Customer |
| GET | /api/accounts/{accountNumber} | Get account details | Customer |
| POST | /api/accounts/deposit | Deposit money | Customer |
| POST | /api/accounts/withdraw | Withdraw money | Customer |
| GET | /api/accounts/{accountNumber}/transactions | Get transaction history | Customer |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /api/admin/users | Get all registered users | Admin |
| GET | /api/admin/accounts | Get all bank accounts | Admin |
| PUT | /api/admin/block/account/{accountNumber} | Block an account | Admin |
| PUT | /api/admin/unblock/account/{accountNumber} | Unblock an account | Admin |
- Passwords are encrypted using BCrypt
- Authentication uses JSON Web Tokens (JWT) β stateless and secure
- Every protected API validates the JWT token on each request
- Admin endpoints are restricted using role-based access control
- Sensitive configuration is loaded from environment variables β never hardcoded
.envfiles, build outputs, andnode_modulesare excluded from Git via.gitignore
cd BankingSystem
.\mvnw.cmd clean packageOutput JAR will be in BankingSystem/target/
cd BankingSystem-Frontend
npm run build --prefix banking-frontendOutput will be in BankingSystem-Frontend/banking-frontend/dist/
Laxman Sah
- π MCA Student β C-DAC, Noida (GGSIPU, Delhi)
- πΌ Java Backend Developer | Spring Boot Enthusiast
- π GitHub: Laxman1509
- π§ Email: laxmansah1503@gmail.com
β If you found this project useful, consider giving it a star on GitHub!