A Spring Boot web application for COMP47910 – Secure Software Engineering, Assignment 1.
PromptVault is a prompt management system where users create, store, organise, and submit prompts to a simulated AI assistant. Admins manage users, prompt categories, policy keywords, and review flagged prompts.
Note: This is the Phase 1 ("Build it") version. Security hardening is intentionally minimal and is addressed in later assignments.
- Java 21 (compiles and runs on JDK 17+/21+/25)
- Spring Boot 3.5.16 (Spring Web, Spring Data JPA, Thymeleaf, Spring Security, Validation)
- MySQL 8 (run via Docker)
- Maven (via the included Maven Wrapper – no global Maven install needed)
- A JDK (17 or newer; developed on JDK 25)
- Docker Desktop (to run MySQL), or a local MySQL 8 server
Using Docker (recommended):
docker run --name promptvault-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=promptvault -p 3306:3306 -d mysql:8This creates a database named promptvault with user root / password root,
matching src/main/resources/application.properties.
If you use a local MySQL instead, create a database called promptvault and update
the username/password in application.properties if needed.
From the PromptVault folder:
# Windows
./mvnw.cmd spring-boot:run
# macOS / Linux
./mvnw spring-boot:runThen open: http://localhost:8080
On first run the schema is created automatically by Hibernate, and sample data is seeded (see below).
Seeded automatically on first startup (only if the database is empty):
| Role | Username | Password |
|---|---|---|
| Admin | admin |
admin123 |
| User | alice |
alice123 |
| User | bob |
bob123 |
Also seeded: 3 categories (Coding, Research, Cybersecurity), 5 policy keywords (password, API key, secret, credit card, confidential), and 5 prompts (a mix of private and shared, two pre-flagged).
Admin
- Login / logout
- Manage users (view list, enable / disable accounts)
- Manage prompt categories (add / edit / delete)
- Manage policy keywords (add / edit / delete)
- View flagged prompts (title, owner, category, keyword, date)
User
- Register, login / logout
- Create / edit / delete own prompts (title, text, category, visibility private or shared)
- View own prompts; browse other users' shared prompts only
- Submit a prompt to the simulated AI assistant
- Receive a warning and have the prompt flagged when it contains a policy keyword
- View own submission history
The schema is generated by Hibernate from the JPA entities, and sample data is
inserted by DataSeeder. A standalone SQL script is also provided in
db/promptvault.sql for reference / manual setup.
docker rm -f promptvault-mysql
# then re-run step 1 and step 2