Skip to content

Restful CRUD API for a simple note taking application using Spring Boot, Mysql, JPA and Hibernate.

Notifications You must be signed in to change notification settings

zethra/notes-app-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Notes App REST API

Restful CRUD API for a simple note taking application using Spring Boot, Mysql, JPA and Hibernate.

Setup

  1. Clone the application:
git clone https://github.com/brenddesigns/notes-app-rest-api.git
  1. Create MySQL database:
CREATE DATABASE notes_app;
  1. Change MySQL username and password inside application.properties file:
  • Open src/main/resources/application.properties
  • Change spring.datasource.username and spring.datasource.password as per your installation.
  1. Build and Run the application using Maven:
mvn package
java -jar target/notes-app-rest-api-1.0.0.jar

Alternatively, you can run the app without packaging it using: mvn spring-boot:run

The app will start running at http://localhost:8080.

Exploring the REST API

The following explores the CRUD (Create, Remove, Update AND Delete) operations this application supports. In the screenshots below, I am using Postman to perform the API calls.

  1. Get all notes using GET method:
GET localhost:8080/api/v1/notes

Screen Shot 2022-03-22 at 7 16 21 pm

  1. Get note with a specific ID using GET method:
GET localhost:8080/api/v1/notes/{noteId}

In the screenshot below, we are returning the note with the ID of 1 Screen Shot 2022-03-22 at 7 16 55 pm

  1. Add a note using POST method:
POST localhost:8080/api/v1/notes

In the screenshot below, we are adding a new note Screen Shot 2022-03-22 at 7 14 17 pm

  1. Update an existing note using PUT method:
PUT localhost:8080/api/v1/notes/{noteId}

In the screenshot below, we are updating the note with the ID of 2 Screen Shot 2022-03-22 at 7 18 11 pm

  1. Delete a note using DELETE method:
DELETE localhost:8080/api/v1/notes/{noteId}

In the screenshot below, we are deleting the note with the ID of 2 Screen Shot 2022-03-22 at 7 18 38 pm

About

Restful CRUD API for a simple note taking application using Spring Boot, Mysql, JPA and Hibernate.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages