A full-stack quiz platform covering any topics. Built with Spring Boot (backend) and Angular (frontend), deployed as a single Docker container.
- Backend: Spring Boot 3, Spring Data JPA, Flyway, PostgreSQL
- Frontend: Angular 21
- Deployment: Docker → Render.com
- Java 21
- Node 20+ / npm
- Docker
docker compose up -dcd backend
./mvn spring-boot:runAPI available at http://localhost:8080/api/quizzes
cd frontend
npm install
npm startApp available at http://localhost:4200. All /api requests are proxied to the backend — no CORS setup needed in development.
cd backend
./mvn testcd backend
./mvn verifyReport is generated at backend/target/site/jacoco/index.html.
cd frontend
npm testdocker build -t swe-quizzes .
docker run -p 8080:8080 \
-e SPRING_DATASOURCE_URL=jdbc:postgresql://<host>:5432/swequizzes \
-e SPRING_DATASOURCE_USERNAME=<user> \
-e SPRING_DATASOURCE_PASSWORD=<password> \
swe-quizzesbuild-dist.sh builds the Angular app, copies it into the Spring Boot static/ folder, then packages the executable JAR.
./build-dist.shOutput: backend/target/swe-quizzes-0.0.1-SNAPSHOT.jar.
docker-build-push.sh runs build-dist.sh, builds the linux/amd64 image from Dockerfile.render, and pushes it to Docker Hub as allan8tech/swe-quizzes:v1.
./docker-build-push.shRequires docker login to a Docker Hub account with push access to allan8tech/swe-quizzes.
Flyway runs automatically on startup. Migration files live in backend/src/main/resources/db/migration/:
| File | Description |
|---|---|
V1__create_tables.sql |
Creates quiz, question, answer tables |
V2__seed_data.sql |
Seeds 3 quizzes with questions and answers |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/quizzes |
List all quizzes |
| GET | /api/quizzes/{id} |
Get a quiz with questions and answers |