REST API backend for a Czech Basic Art School (Základní umělecká škola) website. The system manages school data, personnel, achievements, photo galleries, documents, calendar events, and user accounts.
- Java 21 + Spring Boot 3.4.3
- Spring Data JPA with Hibernate ORM
- MySQL 8.0
- Spring Security with BCrypt encryption
- Google Calendar API & YouTube API
- MapStruct for DTO mapping
- Lombok
- Apache PDFBox for PDF handling
- Docker & Docker Compose
zus-project-server/
├── src/main/java/cz/kavka/
│ ├── configuration/ # Configuration (Security, Google APIs, Web)
│ ├── constant/ # Enums and constants
│ ├── controller/ # REST API endpoints
│ ├── dto/ # Data Transfer Objects + mappers
│ ├── entity/ # JPA entities
│ └── service/ # Business logic
├── src/main/resources/
│ ├── application.yaml # Application configuration
│ └── service_account_json/ # Google API credentials
├── data/ # JSON data and PDF files
├── uploads/ # Uploaded files (photos)
├── nginx/ # Nginx reverse proxy configuration
├── docker-compose.yml
├── Dockerfile
└── pom.xml
| Entity | Description |
|---|---|
UserEntity |
User accounts and authentication |
ArticleEntity |
News and articles |
SchoolYearEntity |
School years |
SchoolAchievementsEntity |
School achievements |
TeachersEntity |
Teachers |
SchoolManagementEntity |
School management members |
AlbumEntity |
Photo albums |
ImageEntity |
Photos in albums |
FileEntity |
PDF documents |
POST /api/user- Register userPOST /api/auth- LoginDELETE /api/auth- LogoutGET /api/auth- Current user
GET /api/articles- List articles (paginated)GET /api/articles/{id}- Article detailsPOST /api/articles/create- Create article (ADMIN)PUT /api/articles/edit/{id}- Update article (ADMIN)DELETE /api/articles/delete/{id}- Delete article (ADMIN)
GET /api/school-management- List management membersPOST /api/school-management/create- Add member (ADMIN)PUT /api/school-management/{id}/edit- Update (ADMIN)DELETE /api/school-management/{id}/delete- Delete (ADMIN)
GET /api/school-achievements/{id}- Achievement detailsGET /api/school-achievements/year/{yearId}- Achievements by yearPOST /api/school-achievements/create- Create (ADMIN)PUT /api/school-achievements/edit/{id}- Update (ADMIN)DELETE /api/school-achievements/delete/{id}- Delete (ADMIN)
GET /api/school-year- List school yearsPOST /api/school-year/create- Create year (ADMIN)DELETE /api/school-year/{id}- Delete year (ADMIN)
GET /api/teachers- List teachersPOST /api/teachers/create- Add teacher (ADMIN)PUT /api/teachers/{id}/edit- Update (ADMIN)DELETE /api/teachers/{id}/delete- Delete (ADMIN)
GET /api/photos/get-albums- List albumsGET /api/photos/get-images/{albumName}- Photos in albumPOST /api/photos/new-album- Create album (ADMIN)POST /api/photos/add-photos- Upload photos (ADMIN)DELETE /api/photos/delete-album/{albumName}- Delete album (ADMIN)DELETE /api/photos/delete-image/{id}- Delete photo (ADMIN)
GET /api/files- List filesGET /api/files/{fileName}- Download filePOST /api/files- Upload file (ADMIN)DELETE /api/files/{id}- Delete file (ADMIN)
GET /api/static/basic-data- School basic informationGET /api/static/required-info- Required public informationGET /api/static/{key}- Page content by keyPUT /api/static/update/{key}- Update content (ADMIN)
GET /api/calendar/events- Google Calendar eventsGET /api/youtube/videos- YouTube channel videos
GET /search?query=...- Redirect to Google site search
- Email/password authentication with BCrypt hashing
- Roles:
ROLE_USER,ROLE_ADMIN - All modification operations require
ROLE_ADMIN - Method-level security using
@Securedannotations
- Java 21
- Maven
- Docker & Docker Compose
- MySQL 8.0 (or use Docker)
# Build the project
mvn clean package
# Run with Docker
docker-compose up
# Or run JAR directly
java -jar target/zusProjectServer-0.0.1-SNAPSHOT.jar| Service | Port | Description |
|---|---|---|
| frontend | 80, 443 | React app (Nginx) |
| backend | 8080 | Spring Boot API |
| db | 3306 | MySQL database |
Main configuration is in src/main/resources/application.yaml:
spring:
datasource:
url: jdbc:mysql://db:3306/zusProjectServer
username: root
password: ${DB_PASSWORD}
youtube:
api-key: ${YOUTUBE_API_KEY}
channel-id: ${YOUTUBE_CHANNEL_ID}
google:
calendar:
calendar-id: ${GOOGLE_CALENDAR_ID}- Fetches events from Google Calendar
- OAuth2 credentials stored in
service_account_json/
- Fetches videos from school's YouTube channel
- Requires API key and channel ID configuration
Database (MySQL):
- Users, articles, teachers, management, school years, achievements, albums, photos, files
JSON Files:
/data/basic-data.json- school basic data/data/required-information.json- required public information/data/entrance-exam.json- entrance exam info/data/title-and-content.json- page content
File System:
/uploads/- uploaded photos (organized by album)/data/pdf_files/- PDF documents
Proprietary software.