Skip to content

ideathreject/Java-Dev-Module-18-Spring-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

📒 Note App – Spring Boot MVC + JPA + Flyway (CRUD)

A minimal Java app that demonstrates CRUD for a single entity Note using Spring Boot MVC, Thymeleaf, Spring Data JPA, H2, and Flyway.


Implemented Features

✅What’s New (Security)

Added dependency: spring-boot-starter-security.

On startup, Spring Boot shows a generated password in logs:

Using generated security password: 6a4b3e7f-...

Default username: user. Enter these credentials at the login page to access the app.

Optional (dev only): to avoid generated passwords each run, you may set fixed creds in application.properties:

spring.security.user.name=admin spring.security.user.password=admin

(Not required by the assignment.)

✅ Entity

Note

  • id (Long, auto-generated)
  • title (String, required)
  • content (String, up to 2000 chars)

✅ Persistence (JPA + Flyway)

  • @Entity-annotated Note mapped to table note
  • NoteRepository extends JpaRepository<Note, Long>
  • Schema managed by Flyway migrations (V1 creates table note)

✅ Service Layer

CRUD operations:

  • Create (add)
  • Read (getById, getAll)
  • Update (update(Note note))
  • Delete (deleteById)

✅ Web Layer (Spring MVC) — Routing per mentor spec

NoteController routes:

  • GET /note/list — list notes
  • GET /note/create — show create form
  • POST /note/create — create note
  • GET /note/edit?id=123 — show edit form (id in query)
  • POST /note/edit — update note (id + fields in body)
  • POST /note/delete — delete note (id in body)

✅ UI (Pure HTML + Thymeleaf)

  • templates/note/list.html
  • templates/note/create.html
  • templates/note/edit.html

Java-Dev-Module-17-Spring-Boot-Security

Java-Dev-Module-18-Spring-REST-API

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published