A web application for creating, managing, and responding to surveys. Admins can create and analyze surveys, while users can answer surveys and view their progress.
- Framework: React.js
- Styling: Material UI
- State Management: React Context
- HTTP Client: Axios
- Runtime: Java (OpenJDK 17)
- Framework: Spring Boot
- Database: PostgreSQL
- Authentication: Cookie-based authentication (HTTP-only)
Before running the application, make sure you have the following installed:
- PostgreSQL
- Java OpenJDK 17
-
Download and Install
- Windows / macOS / Linux installers: https://www.postgresql.org/download/
-
Start PostgreSQL
# Linux sudo service postgresql start # macOS (with Homebrew) brew services start postgresql # Windows: Start "PostgreSQL" service from Services panel
-
Create a database
psql -U postgres CREATE DATABASE surveys_db;
- Open the project in VS Code
- Install the Spring Boot Extension Pack
- Run the Application
- Click the Run button in VS Code
- Verify Backend
- The backend should run on http://localhost:8080
POST /api/register– User registrationPOST /api/login– User login
GET /api/surveys/{id}– Get a single survey by ID (any authenticated user)
POST /api/admin/surveys– Create a new survey (status initialized asNEW)GET /api/admin/surveys– Get all surveys (regardless of status)PUT /api/admin/surveys/{id}/complete– Mark a survey asCOMPLETEGET /api/admin/surveys/{id}/stats– Get survey statistics (average, min, max per field + overall SUS score)GET /api/admin/surveys/{id}/export– Export survey statistics as a CSV file
GET /api/user/surveys– Get all available surveys with statusNEWPOST /api/user/surveys/{id}/answer– Submit answers for a survey (increments times answered and records user)GET /api/user/surveys/{id}/can-answer– Check if the logged-in user can still answer a specific survey
GET /api/role– Get the username and role of the currently logged-in user
- There are four predefined users (john,mike,oliver,nick) with the role USER and one user (admin) with the role ADMIN.