Spring Boot education platform for lab work #1.
- REST API for registration, login, course CRUD (create limited to teachers) and "current user" endpoint
- PostgreSQL + Flyway migrations (users, courses, achievements, course enrollments)
- MapStruct DTO mapping, Bean Validation, centralized error handler
- JWT auth with role based access (STUDENT, TEACHER, ADMIN)
- Optimistic (@Version) and pessimistic (@Lock) locking, explicit transactional propagation/isolation
- Swagger UI (
/swagger-ui.html) + Postman collection (src/main/resources/postman/education-platform.postman_collection.json) - Logging/observability via Spring Actuator (
/actuator/health,/actuator/info,/actuator/metrics) - "First course" achievement is granted on the first enrollment
- Install JDK 17+ and Maven.
- Provision PostgreSQL database
education(or editspring.datasource.url). - Update
spring.datasource.username/passwordplusapp.jwt.secretif needed. - Start the app and run migrations:
mvn spring-boot:run
- Use Swagger UI (http://localhost:8080/swagger-ui.html) or the Postman collection.
POST /api/auth/register— create ADMIN and TEACHER users.POST /api/auth/login— obtain each JWT token.POST /api/courses(teacher token) — create a course.- Register/login a STUDENT and call
POST /api/courses/{id}/enroll. GET /api/users/me— verify the achievement plus role data.GET /api/courses— confirm it is public while other endpoints require Bearer tokens.