GithubHelp home page GithubHelp logo

restaurant-reservations's Introduction

Restaurant Reservation System CircleCI

Overview

This is a simple restaurant reservation system written for eductional purposes - practicing building web services using Java's Spring/Sprint Boot and Hibernate. Most endpoints are simple CRUD operations.
The application exposes a REST API to be used by someone who manages reservations for multiple restaurants. The application allows adding/removing restaurants, editing the tables for each restaurant, and creating and manipulating reservations in restaurants.

The API is documented using swagger-ui.

Technologies used:

  • Spring 4 with Spring Boot
  • Hibernate
  • H2 in-memory database
  • Swagger and Swagger UI
  • Tomcat
  • JUnit
  • Mockito
  • Project Lombok

Running the Project

To compile the project, issue the following command:

mvn clean install

To run all tests, issue the following command:

mvn test

After compiling the project you may run it using:

java -jar ./target/restaurant-reservations-0.0.1-SNAPSHOT.jar

The application should now be available on localhost:8080. You can now browse the documentaion at localhost:8080/swagger-ui.html.

Example Scenario

Let's start by looking at the available restaurants:

GET  localhost:8080/api/restaurants/

{
    "restaurants": [
        {
            "id": 1,
            "name": "Zozobra",
            "address": "Shenkar St.",
            "tableDtos": [
                {
                    "id": 1,
                    "name": "Round Table",
                    "capacity": 6
                }
            ]
        },
        {
            "id": 2,
            "name": "Moses",
            "address": "Aba Even St.",
            "tableDtos": [
                {
                    "id": 2,
                    "name": "Table Table",
                    "capacity": 4
                }
            ]
        }
    ]
}

Let's see which tables are available at Zozobra:

GET localhost:8080/api/restaurants/1/tables

{
    "tables": [
        {
            "id": 1,
            "name": "Round Table",
            "capacity": 6
        }
    ]
}

Let's make a reservation for the Round Table at Zozobra:

POST localhost:8080/api/restaurants/1/reservations
Request body:
{
	"name": "Rubin",
	"startTime": "2007-12-03T19:00:00",
	"endTime": "2007-12-03T21:00:00",
	"tableName": "Round Table",
	"nPeople": 3
}

Similarly, you can try adding/removing/listing some tables, restaurats or reservations.

restaurant-reservations's People

Contributors

matanrubin avatar

Watchers

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