Git Product home page Git Product logo

hotel-booking's Introduction

Hotel-booking application

Prerequisites

You will need the following things properly installed on your computer:

Before using app you must create database on MySQL server. To create db use next commands:

$ CREATE DATABASE hotel_booking;
$ use hotel_booking;
$ CREATE TABLE users (
    id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR (255) NOT NULL,
    email VARCHAR (255) NOT NULL
    );
$ CREATE TABLE rooms (
    id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    room_number INT NOT NULL,
    room_price FLOAT NOT NULL,
    category VARCHAR (255) NOT NULL,
    description VARCHAR (255) NOT NULL
    );  
$ CREATE TABLE booking (
      id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
      final_price FLOAT NOT NULL,
      date VARCHAR (255) NOT NULL,
      user_id INT NOT NULL,
      FOREIGN KEY (user_id) REFERENCES users(id) 
      );
$ CREATE TABLE orders (
   id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
   booking_id INT NOT NULL,
   room_id INT NOT NULL,
   FOREIGN KEY (booking_id) REFERENCES booking(id),
   FOREIGN KEY (room_id) REFERENCES rooms(id),
   breakfast boolean not null default 0,
   cleaning boolean not null default 0
   );

To fill db use next commands:

$ INSERT INTO `users` VALUES 
    (5,'Anton','[email protected]'),
    (6,'Oleg','[email protected]'),
    (7,'Artur','[email protected]'),
    (8,'Katya','[email protected]');
$ INSERT INTO `rooms` VALUES 
    (3,101,50,'1 person','1 bad ; TV; SP4;'),
    (4,102,100,'2 persons','1 bad ; TV; SP4;'),
    (5,103,150,'2 persons','2 bad ; TV; SP4;'),
    (6,201,200,'lux','2 bad ; TV; SP4;'),
    (7,202,350,'lux','2 bad ; 2TV; SP4;'),
    (8,204,500,'presedent lux','4 bad; 2 bathrooms; 3 TV;'),
    (9,301,100,'1 person','1 bad ; TV; SP4;'),
    (10,302,250,'presedent lux','2 bad ; TV; SP4;');
$ INSERT INTO `booking` VALUES (1,0,5,'12.12.2012');
$ INSERT INTO `orders` VALUES (1,1,3,1,0);

Before running app you should configure file src/main/resources/application.properties

Run app

To run app use next command:

$ mvn spring-boot:run
              
       
    
          

hotel-booking's People

Contributors

nikitaom avatar

Watchers

 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.