Skip to content

engseclabs/notes-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notes-api

A small multi-user notes service built on Spring Boot. Each user owns notes; notes are private to their owner.

What it does

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.

Endpoints

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

Layout

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)

Build and run

mvn spring-boot:run
# service listens on http://localhost:8080

CI

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.

About

A small multi-user notes service (Spring Boot)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages