Webservice for managing and storing in database simple notes (without the UI part). Application was written in Java with JPA, Hibernate and Spring-boot.
- You need to have JDK 1.8 and MySql Workbench installed
- Log in to MySQL as the root user and execute create_user.sql script (you can find all scripts in SQL_queries directory).
- Log in to MySql using username: webUser and password: password and execute create_database.sql script.
- Download project as zip file and extract this.
- Make sure that you are in RESTful-API-webservice-master directory and type:
mvnw clean install
to build the project. - Make sure that port 8080 is available for you and run application using command:
java -jar target/restservice-0.0.1-SNAPSHOT.jar
.
HTTP METHOD | ENDPOINT | CRUD ACTION |
---|---|---|
POST | /api/notes | Create a new notes |
GET | /api/notes | Get a list of notes |
GET | /api/notes/{noteId} | Read a single note |
PUT | /api/notes | Update an existing note |
DELETE | /api/notes/{noteId} | Delete an existing note |
GET | /api/history/{noteId} | Read history of changes for particular note |
PostMan is a good application to check the functionality. You can use, for example, the post method as shown in the image below.
Or to update particular note you should do this:
And to delete the note with id=1
-
Create integration tests for each functionality using H2 in-memory database and JUnit test framework. - Move versioning management from sql triggers to java code using @PrePersist and @PreUpdate annotations.
- Create basic frontend configuration to manage notes using react.
- Create basic configuration to integration testing using testcontainers/docker.
- Create integration tests for each functionality using mysql testcontainer and Junit test framewrok.
- Piotr Mucha - (https://github.com/piotrmucha)