GithubHelp home page GithubHelp logo

dushansachinda / hotel-reservation-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ramith/hotel-reservation-demo

0.0 1.0 0.0 17.32 MB

This is demo application of using ballerina to develop simple hotel reservation application and this will be deployed in choreo

License: Apache License 2.0

JavaScript 0.34% TypeScript 52.32% HTML 2.04% Ballerina 16.17% Java 29.13%

hotel-reservation-demo's Introduction

Hotel Reservation Demo

This application has a front end developed using React.js and an API service implemented using Ballerina to demo a simple hotel reservation use case.

How to Run

  1. Run Ballerina Backend.

    • Install Ballerina version 2201.8.4 if not already done.
    • Navigate to the backend directory: cd service
    • Run bal run
  2. Start Front-end.

    • Install Node.js version 20.x.x.
    • Run
cd webapp
npm install
npm start
  1. Visit the http://localhost:3000/reservations

How to Implement Hotel Reservation API

Prerequisites

  • ballerina
  • npm

Steps

  1. Clone Git Repo https://github.com/ballerina-guides/hotel-reservation-demo

  2. Goto backend directory.

  3. Refer to backend/README.md and generate the Record types for the service.

  4. Add HTTP service component to implement API for the hotel reservation front end. It should provide the following API paths. Please refer to README.md for more on service resources.

    1. Get available room types
    2. Create a reservation
    3. Update the reservation
    4. Get user reservations
    5. Delete the reservation
  5. Improve tests and add a reservation with the following reservation.

{
   checkinDate: "2024-02-19T14:00:00Z", 
   checkoutDate: "2024-02-20T10:00:00Z", 
   rate: 100, 
   user: user, 
   roomType: "Family"
}

TIPS:

  1. Use two tables for Rooms and Reservations.
table<Room> key(number) rooms;

table<Reservation> key(id) roomReservations = table [];

  1. Use utils functions in utils.bal file.

hotel-reservation-demo's People

Contributors

warunalakshitha avatar chathuranga95 avatar ramith avatar keizer619 avatar raveensr avatar maheshika avatar dushansachinda 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.