Skip to content

This is a Ruby on Rails backend API application serving a frontend hotel-hub React app

License

Notifications You must be signed in to change notification settings

ProgramKingAbel/hotel-hub-backend

Repository files navigation

Hotel Hub (Final Capstone)

📗 Table of Contents

📖 Hotel Hub (Backend)

Hotel Hub is a website that offers hotel booking and reservation services for travelers, providing a convenient way to find and book accommodations. You can select available rooms for a graphic list on the home page of the website, or you can just click on the reserve menu item and see the full list of available rooms. You can find the repository for the front end of this project here.

Backend is implement as API-only. The front end is implemented utilizing the React framework.

  • The backend Rails app is implemented as API-only. The application starts by fetching the users method on the backend, if the backend is available then the user will login by making a query to users/new_session.

  • The room controller provides an index method to get all the data for rooms, and a show method to get details about a specific room. The destroy method deactivates the room when the user sends a delete query by clicking on delete.

  • The reservation controller also provides index methods. Index is used to get a list of all reservations made.

🛠 Built With

Tech Stack

Ruby on Rails
  • https://rubyonrails.org/

Key Features

  • Ability to see the featured rooms on the homepage
  • The ability to reserve rooms based on selecting the date and room name
  • The ability to add rooms to the database
  • The ability to delete rooms

(back to top)

🚀 Live Demo

Live demo for the website Coming Soon.

(back to top)

🎬 Kanban Board

Link to the Kanban Board

Link to initial state of Kanban Board

All 5 authors have been contributing to this project from start to finish.

💻 Getting Started

To get a local copy up and running, follow these steps.

Prerequisites

In order to run this project, you need to:

  • Install Ruby
  • Install Rails
  • Install Posgresql

(back to top)

Setup

Clone this repository to your desired folder:

  git clone https://github.com/ProgramKingAbel/hotel-hub-backend.git 

Install

Install this project with these commands:

  cd hotel-hub-backend
  bundle install
  rails db:create
  rails db:migrate
  rails db:seed

(back to top)

Database Setup.

Before creating database, you have to configure the master key for your project. This can be done in two ways.

  1. Using our own master key that we have provided cd into the project folder and in your terminal run
rails rake:secret

  • This command will generate a master.key file and inside that file replace the key with the one shown below.

[f387ccf0b4eebd334dc8725a1cb9573]

  • Proceed to creating db.
  1. Generating your own master Key
  • Remove config/master.key and config/credentials.yml.enc if they exist.

  • Run in the terminal: EDITOR=code rails credentials:edit

  • Close the editor that opens.

  • This command will create a new master.key and credentials.yml.enc if they do not exist.

  • After this proceed to creating db with:

  rails db:create
  rails db:migrate
  rails db:seed

(back to top)

Usage

To run the project execute the following command:

 rails s

or

./bin/dev
  • You can use the following emails and passwords from seeded data to login from the frontend.

for admin

user1 = User.create(
  name: 'John Doe',
  email: '[email protected]',
  password: 'password123',
  role: 'admin'
)

for a Normal User

user2 = User.create(
  name: 'Jane Smith',
  email: '[email protected]',
  password: 'password456',
  role: 'user'
)

(back to top)

Tests

To run the tests for models and requests, execute the following command:

rspec ./spec/models
rspec ./spec/requests/api/v1

(back to top)

👥 Authors

👤 Abel Morara

👤 Alex Waweru

👤 Enobong Isong

👤 Peter Dumbar

👤 Sahalu Aminu

(back to top)

🔭 Future Features

  • [Payment Integration into the System]
  • [Add email confirmation]

(back to top)

🤝 Contributing

Contributions, issues, as well as feature requests are welcome!

Feel free to check the issues page.

(back to top)

⭐️ Show your support

If you like this project, kindly leave a comment below and share it with someone who enjoys coding! or still, give us a ⭐️!

(back to top)

🙏 Acknowledgments

  • Thanks to our amazing team members and coding partners for their invaluable contributions and dedication.
  • The Design reference for the website belongs to Murat Korkmaz. You can find the reference here

(back to top)

📝 License

This project is MIT licensed.

(back to top)

About

This is a Ruby on Rails backend API application serving a frontend hotel-hub React app

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published