Resort booking is a webpage made with Rails and React, for users to book different resorts. This is the back-end API version. If you want to see the front end please click here
Front End
- React
- Redux
- JAVASCRIPT
- Html
- CSS
Back End
- Ruby
- Rails
- PostgreSQL
Visit our webpage here.
- Create/remove a booking for a resort
- See a list of all possible resorts
- Admins are able to add resorts to the list
Hi there, we are a five-member team, @Thinus01, @raihan2bd , @edubew , @MichealKith , @lawrahkonwea.
We are dividing the project between front-end and back-end We also created two kanban boards together for the projects Front-end: https://github.com/users/Thinus01/projects/11 Back-end: https://github.com/users/Thinus01/projects/10
To get a local copy up and running, follow these steps.
In order to run this project you need:
- First of all to see this project's graphical interface make sure you run the front-end part
- Before running this repo on your local machine make sure you have installed Ruby, Rails, and PostgreSQL
- Clone this repository to your desired folder:
cd your-folder
https://github.com/Thinus01/Resort_Booking_Back-end
- Before running the project please make sure you create a
.env
file to your project root directory and addDATABASE_USER_NAME
,DATABASE_PASSWORD
, andJWT_SECRET_KEY
environment variables to the file. For example:
DATABASE_USER_NAME=place_your_postgres_database_username
DATABASE_PASSWORD=place_your_database_password
JWT_SECRET_KEY=place_your_jwt_secret_key
- After that make sure you change cors. To change the cors open the project with your favorite editor then click config folder then click initializers folder and open cors.rb file and after that change the
origins
to your front-end URL to solve the cross-origins request error. For example:
origins 'http://localhost:3000'
- To generate the
JWT_SECRET_KEY
as a secure and random hash using Ruby'sSecureRandom module
. You can do this in a Ruby script or in your Rails console:
require 'securerandom'
jwt_secret_key = SecureRandom.hex(64)
puts jwt_secret_key
This will generate a random string of 128 characters (64 bytes in hexadecimal representation) and print it to the console. Then you can copy it from the console and paste it into your .env file as a value of JWT_SECRET_KEY
.
Install this project with:
- Install the required gems with:
bundle install
npm install
- Create the databases and run migrations with:
rails db:create
rails db:migrate
rails db:seed
- To run the development server, execute the following command:
rails server
Note:
For more information about this back-end API end-points run the server and visit project_base_url/api-docs
For example: http://localhost:4000/api-docs
.
- To run tests, run the following command:
rspec spec
You can visit the app using Render
π€ Abu Raihan
- GitHub: @raihan2bd
- Twitter: @raihan2bd
- LinkedIn: raihan2bd
- GitHub: @lawrah_on_GitHub
- Twitter: @lawrah_on_Twitter
- LinkedIn: @laura_on_LinkedIn
- GitHub: @Thinus01
- Twitter: @thinus_v_d_v
- LinkedIn: Thinus Van De Venter
π€ Winnie Edube
- GitHub: @edubew
- Twitter: @edube_winne
- LinkedIn: Winfred Edube
π€ Michale Kithinji
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
- Improve user experience
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If you like this project, please leave a βοΈ
We want to give a big thanks to Microverse for giving us the chance to achieve this milestone We also want to thank Murat Korkmaz for his design, that our project is based on.
This project is MIT licensed.