A Rails API end-point application for reservation of trips.
- lists trips info
- required params: none
- creates reservation
- required params: (i)reservor_id, (ii)reserved_trip_date_id
- requires Authorization provided in header (details in 5th method)
- lists user info and his/her reservations made
- required params: none
- requires Authorization provided in header (details in 5th method)
- creates user
- required params: (i)username, (ii)password, (iii)password_confirmation
- sends back (i) token for Authorization, (ii)username, (iii)user_id
- required params: (i)username, (ii)password
- Ruby v2.6.5
- Ruby on Rails v6.0.4
- PostgreSQL
- jbuilder
- AMS
- bcrypt
- Rubocop
- RSpec, database_cleaner, faker, shoulda-matchers
- **Terminal(Mac & Linux) or Command Prompt(Windows)**: This is where you will run all commands.
- **Clone**: clone this repository to your local machine.
- **Ruby Enviroment**: if you do not have ruby installed visit this [link](https://www.ruby-lang.org/en/documentation/installation/) to install.
- **PostgresSQL**: if you do not have postgreSql installed visit this [link](https://www.postgresql.org/) to install.
- **Rails**: install rails gem by running command *$ gem install rails* -v 6.0.4 in your terminal.
- **bundle**: run $ bundle install. This installs all gems declared in the Gemfile
- **Database Creation**: run *$ rails db:create* in the terminal to create database on your local machine
- **Database Migration**: run *$ rails db:migrate* in terminal to run database migrations on your local machine
- **Environment varaibles**: run *$ export TRIPS_SECRET=$SECRET* in terminal to create env var for secret for token decoding and encoding
Start server with:
rails server -p 3001
Open http://localhost:3001/
in your browser.
bundle exec rspec
To deploy heroku
- Create a heroku account here
- In your root folder run the following commands
$ heroku login: Log into heroku CLI in your browser
$ heroku create $APP_NAME
$ git push heroku master
$ heroku run rails db:migrate
$ heroku run rails c: Trip.create($PARAMS) or TripDate.create($PARAMS)
example for Trip:
Trip.create(title: "ALAMEDIN GORGE", description: "The Alamedin Gorge is one of the four most visited and popular gorges of the Kirghiz Range.", imageUrl: "image_src", tourDetailsText: "Requires basic skills of being in the mountains.", altitudeDifference: "350 m", season: "year around", distanceByCar: "90 km", trekkingDistance: "12 km", cost: "500 KGS")
example for TripDate:
TripDate.create(trip_id: 1, date: "30.11.2021")
👤 Azamat Nuriddinov
- Github: @bettercallazamat
- Twitter: @azamat_nuriddin
- Linkedin: Azamat Nuriddinov
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.