A small multi-user notes service built on Spring Boot. Each user owns notes; notes are private to their owner.
A REST API over an in-memory H2 database. On startup it seeds two demo users
(alice, bob) and a couple of notes so the endpoints have data to return.
| Method | Path | Purpose |
|---|---|---|
POST |
/users/register |
Create a user (password is hashed before storage) |
GET |
/users/{id} |
Public profile (id and username) |
POST |
/notes |
Create a note owned by the caller (X-User-Id header) |
GET |
/notes/{id} |
Fetch a single note by id |
GET |
/notes/search?q= |
Search notes by a free-text term |
POST |
/admin/export |
Export all users and notes |
POST |
/admin/run-diagnostic?target= |
Run an operational diagnostic |
src/main/java/com/acme/notes/
controller/ NoteController, UserController, AdminController (HTTP layer)
service/ NoteService, UserService (business logic)
repository/ NoteRepository, UserRepository (data access)
model/ Note, User (entities)
util/ PasswordHasher (helpers)
src/main/resources/
application.properties (config)
schema.sql (table DDL)
.github/workflows/semgrep.yml (CI scan)
mvn spring-boot:run
# service listens on http://localhost:8080
Every push and pull request runs Semgrep (.github/workflows/semgrep.yml).
Findings appear in the Actions tab (the scan step log) and in the
Security > Code scanning tab as a clickable list. The scan is informational
and does not block merges.