Git Product home page Git Product logo

restful-api-webservice's Introduction

RESTful API webservice

Webservice for managing and storing in database simple notes (without the UI part). Application was written in Java with JPA, Hibernate and Spring-boot.

What is required for running the project:

  • You need to have JDK 1.8 and MySql Workbench installed

Steps how to run scripts that will setup database for the project:

  1. Log in to MySQL as the root user and execute create_user.sql script (you can find all scripts in SQL_queries directory).
  2. Log in to MySql using username: webUser and password: password and execute create_database.sql script.

Steps how to build and run the project:

  1. Download project as zip file and extract this.
  2. Make sure that you are in RESTful-API-webservice-master directory and type: mvnw clean install to build the project.
  3. Make sure that port 8080 is available for you and run application using command: java -jar target/restservice-0.0.1-SNAPSHOT.jar .

Example usages

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.

Alt text

Or to update particular note you should do this:

Alt text

And to delete the note with id=1

Alt text

To-do-list

  • 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.

Author

restful-api-webservice's People

Contributors

piotrmucha avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.