A secure and user-friendly survey web application built with Java Spring Boot, supporting:
- OAuth2 (Google) and username/password authentication
- Administrator-only user management
- Dynamic survey completion
- Viewing and downloading survey responses (PDF/CSV)
- Role-based access control using Spring Security
-
🔐 Authentication
- Google OAuth2 login
- Username/password login (with BCrypt password encoding)
- JWT-based token generation for API access
-
🧾 Surveys
- Users can complete randomly generated surveys
- Results are stored and linked to user accounts
- Each user can complete survey only once, this rule sticks also for administrators
- Survey questions can be different kinds of topics, this instance used for IT Department
-
📊 Survey Results
- Users can view their own survey responses
- Administrators can view all users' responses
- Administrators can download each users' response in PDF or CSV format
-
⚙️ Administrator page
- Home page is rendered with more buttons, also containing ones regular users have access to
- List all users and shows their survey results
- Promote/demote users between roles, administrator can't change role of other administrators, prevent demotion of admins via disabled buttons
- Backend: Java 17, Spring Boot, Spring Security, Spring Data JPA
- Frontend: Thymeleaf, HTML/CSS/JavaScript
- Database: PostgreSQL 17.4 (or other JDBC-compatible DB)
- PDF/CSV Export: iText 8
| Role | Can Complete Survey | View Own Responses | View All Users | Modify Roles | Download Others' Responses |
|---|---|---|---|---|---|
user |
✅ | ✅ | ❌ | ❌ | ❌ |
administrator |
✅ | ✅ | ✅ | ✅ | ✅ |
- Java 17+
- Maven
- PostgreSQL 17.4+ database (or configure another one in
application.properties) - Google OAuth2 Client ID and Secret (if OAuth is enabled)
# Clone the repository
git clone https://github.com/misterdrac/surveys-app.git
cd surveys-app
# Run the app
./mvnw spring-boot:run- or press run button if you are using IntelliJ IDEA Community Edition 2025.1
To run application locally, you need to configure your database and Google OAuth2 credentials.
Create or modify file at
src/main/resources/application.properties
Paste following configuration and update upholders with your credentials
spring.datasource.url=jdbc:postgresql://localhost:5432/surveydb
spring.datasource.username=your_db_user
spring.datasource.password=your_db_pass
spring.security.oauth2.client.registration.google.client-id=your-client-id
spring.security.oauth2.client.registration.google.client-secret=your-client-secret- App entry point: http://localhost:8080/login
- Other endpoints: /complete-registration, /main-page, /create-a-survey, /list-surveys, /results-page, /take-a-survey, /user-management, ...
-
Here's database ER Diagram, created by dbdiagram.io
-
it includes all entities used during development of this project
This project is licensed under the MIT License.
- Dario Golubović
In my own eyes, this project brought me a lot of new knowledge that I'm sure will fuel me in my future advances. Maybe in near future, I would continue to work on it, but for now, I will look forward to new projects. This project helped me grasp more about Spring Boot and it's security features. With also whole workflow from front-end to back-end using JPA and Hibernate. I'm really happy how this turned and I'm open for suggestions for improvements.