- Backend API for managing apartment rental data (apartments, customers, contracts, users) — built while learning Spring Boot (v2).
- Repo Frontend
- Framework: Spring Boot 2.7 (Web, Data JPA, Data REST, Mail, DevTools)
- Security: Spring Security + JWT (
jjwt0.12.5), role-based access (MANAGER,STAFF) - Database: MySQL 8.3 (via Docker), Hibernate/JPA
- API docs: Springdoc OpenAPI / Swagger UI
- Import/Export: Apache Commons CSV, Apache POI (Excel
.xlsx) - Testing: JUnit 5, Spring Security Test, Testcontainers (MySQL), Selenium (UI tests)
- Build: Maven, Java 11
- Other: Lombok, Spring Mail (SMTP), Docker (database only)
- Auth: register, login, logout, refresh token, reset password (JWT-based)
- Users: CRUD, block/unblock, change password, get current user details, statistics, export
- Apartments: CRUD, search, paging, import (CSV), export, statistics
- Customers: CRUD, search, paging, import (CSV), export, statistics
- Contracts: CRUD, search, paging, export, statistics
- Validation: not-null checks, format checks, duplicate checks, custom exceptions (
NotFoundException,DuplicatedException,ForbiddenException, etc.) with a global exception handler - Standardized API responses (
ApiResponse/ErrorResponse) - Selenium UI tests for Login Page and Change Password Page
User(withRole: MANAGER / STAFF)ApartmentCustomerContract
- [2025.03] Bump
poi-ooxmlto 5.4.0 - [2024.10.31] Selenium tests for
Login PageandChange Password Page - [2024.10.29] Init Role & first user in database
- Clone this repository
- Make sure you are using JDK 11 (see
pom.xmljava.version) - Install extension Lombok in IntelliJ IDEA
- Rename
.env.exampleinresourcesfolder to.env.devand change your value to set up mailEMAIL_USERNAME=<Your email address> EMAIL_PASSWORD=<Your email's password> - Install plugin EnvFile and do like
document or setting like that in
Edit configurationof project
- Run 2 command under
docker image pull mysql:8.3.0
docker run --name k1ethoang-mysql-container -d -e MYSQL_ROOT_PASSWORD=123456 -p 6603:3306 mysql:8.3.0
-
Create connection (Do not change):
- Username: root
- Password: 123456
-
Create database in MySQL name:
Learn_BackEndor use scriptcreate database Learn_BackEnd
-
Run your docker first, you can run via Docker Desktop

-
Run command in your project folder
./mvnw spring-boot:run
- Access http://localhost:9090/swagger-ui/index.html to see swagger doc

