eBank is a backend banking application developed with Spring Boot (Java) that simulates the core functionalities of a real-world banking system. The project focuses on secure authentication, role-based access control, and RESTful API design for managing users, accounts, and banking operations.
- Java 17
- Spring Boot 3
- Spring Security
- JWT (JSON Web Token)
- Spring Data JPA / Hibernate
- MySQL 8
- Maven
- Postman (API testing)
The application follows a layered RESTful architecture:
- Controller: Handles HTTP requests and responses
- Service: Contains business logic and validation
- Repository (DAO): Manages database access via JPA
- Security Layer: JWT-based authentication and authorization
- Stateless authentication using JWT
- Role-based authorization (ADMIN, AGENT_GUICHET, CLIENT)
- Secured endpoints with Spring Security
- Password encryption using BCrypt
- Token expiration management (1 hour)
| Role | Permissions |
|---|---|
| ADMIN | System management |
| AGENT_GUICHET | Create clients, create bank accounts, manage operations |
| CLIENT | View dashboard, make transfers, check balance, view transaction history |
- User authentication with JWT
- Secure login and password change functionality
- Creation and management of clients by agents
- Data initialization for agents
- Bank account creation and management
- Account status management (Open, Blocked, Closed)
- Money transfers between accounts
- Balance inquiry
- Transaction history with pagination
- Deposit operations
- Database: MySQL 8
- ORM: Hibernate / JPA
- Schema: Automatic generation
- Relations: Mapping between users, accounts, and transactions
- Java 17+
- Maven
- MySQL 8
- IDE (IntelliJ IDEA recommended)
Update application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/ebank_db
spring.datasource.username=root
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
server.port=8080- Clone the repository
git clone https://github.com/your-username/ebank-backend.git- Navigate to project directory
cd ebank-backend- Build and run
mvn clean install
mvn spring-boot:runThe backend runs by default on: http://localhost:8080
Use Postman to test authentication and secured endpoints:
- Authenticate via
/api/auth/loginto obtain a JWT token - Include the token in headers for protected endpoints:
Authorization: Bearer <token>
Authentication
POST /api/auth/login- User loginPOST /api/auth/change-password- Change password
Agent Operations
POST /api/agent/clients- Create new clientPOST /api/agent/accounts- Create bank account
Client Operations
GET /api/client/dashboard- View dashboardPOST api/client/virements- Transfer money between accounts
src/main/java/ma/ebank/backend
│
├── config # Security & JWT configuration
├── controller # REST controllers
├── service # Business logic
├── repository # Data access layer
├── entity # JPA entities
├── dto # Data Transfer Objects
└── util # Utility classes
✅ Backend completed and fully functional
⏳ Frontend integration planned but not implemented yet
- Complete frontend integration
- Refresh token mechanism
- Enhanced exception handling
- API documentation with Swagger/OpenAPI
- Unit and integration testing
- Docker containerization
Sara Tahiri
🔗 GitHub: github.com/SaraTahiri
💼 LinkedIn: linkedin.com/in/tahiri-sara
Anas Lahmidi
🔗 GitHub: github.com/AnasLahmidi
💼 LinkedIn: linkedin.com/in/anas-lahmidi
For questions, suggestions, or collaboration opportunities:
📧 tahirisara911@gmail.com
📧 anaslahmidi03@gmail.com
This project is developed for educational purposes.