- 📖 About the Project
- 💻 Getting Started
- 👥 Authors
- 🔭 Future Features
- 🤝 Contributing
- ⭐️ Show your support
- 🙏 Acknowledgements
- 📝 License
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 tousers/new_session
. -
The room controller provides an
index
method to get all the data for rooms, and ashow
method to get details about a specific room. Thedestroy
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.
Ruby on Rails
- https://rubyonrails.org/
- 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
Live demo for the website Coming Soon.
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.
To get a local copy up and running, follow these steps.
In order to run this project, you need to:
- Install Ruby
- Install Rails
- Install Posgresql
Clone this repository to your desired folder:
git clone https://github.com/ProgramKingAbel/hotel-hub-backend.git
Install this project with these commands:
cd hotel-hub-backend
bundle install
rails db:create
rails db:migrate
rails db:seed
Before creating database, you have to configure the master key for your project. This can be done in two ways.
- 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.
- 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
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: 'john@example.com',
password: 'password123',
role: 'admin'
)
for a Normal User
user2 = User.create(
name: 'Jane Smith',
email: 'jane@example.com',
password: 'password456',
role: 'user'
)
To run the tests for models and requests, execute the following command:
rspec ./spec/models
rspec ./spec/requests/api/v1
👤 Abel Morara
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/abel-morara/
👤 Alex Waweru
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/alewaweru/
👤 Enobong Isong
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/enobong-isong/
👤 Peter Dumbar
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/peterdumbari/
👤 Sahalu Aminu
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/sahlminkok/
- [Payment Integration into the System]
- [Add email confirmation]
Contributions, issues, as well as feature requests are welcome!
Feel free to check the issues page.
If you like this project, kindly leave a comment below and share it with someone who enjoys coding! or still, give us a ⭐️!
- 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
This project is MIT licensed.