Skip to content

Latest commit

 

History

History
141 lines (101 loc) · 5.92 KB

README.md

File metadata and controls

141 lines (101 loc) · 5.92 KB

Hitch Backend

This is the backend engine fueling Hitch, a web application that connects users to similar routes and can help get vehicles off the road. The application is built with service oriented architecture and this app does most of the heavy lifting (see Project Architecture). The backend communicates with the frontend using 5 API JSON endpoints. It stores all our information in our databases.

The API endpoints allow other apps to store Users, Ridedays, Rides, Vehciles, and Friends. There is functionality on the backend to find matching routes requests all the zipcodes near your specific destination/origin and grabs users with matching routes in those specific areas.

Related Repos

To explore the full web application, please visit the built out front end application that hooks into this engine and its endpoints.

To get zipcodes within a specified radius, please visit the radius microservice.

To check driveable routes we used mapquest api.

Created by:

Built With

This project was tested with:

  • RSpec version 3.10
  • Postman Explore and test the API endpoints using Postman, and use Postman’s CLI to execute collections directly from the command-line.

Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. Endpoints can be added. If you plan to use this engine with the frontend web application, if the endpoints are changed subsequent updates will be necessary on the Frontend repository code.

Prerequisites

  • Ruby

    • The project is built with rubyonrails using ruby version 2.5.3p105, you must install ruby on your local machine first. Please visit the ruby home page to get set up. Please ensure you install the version of ruby noted above.
  • Rails

    gem install rails --version 5.2.5
  • Postgres database

    • Visit the postgresapp homepage and follow their instructions to download the latest version of Postgres app.

Frontend dependancies

Installing

  1. Clone the repo
$ git clone https://github.com/hitch-2011/hitch_backend
  1. Bundle Install
$ bundle install
  1. Create, migrate and seed rails database
$ rails db:{create,migrate,seed}
  1. Set up Environment Variables:
  • run bundle exec figaro install
  • add the below variable to the config/application.yml if you wish to use the existing email microservice. Otherwise you replace it the value with service if desired.
  EMAIL_MICROSERVICE: 'https://peaceful-bastion-57477.herokuapp.com'

If you do not wish to use the sample data provided to seed your database, replace the commands in db/seeds.rb.

Endpoints

HTTP verbs Paths Used for
Post /api/v1/users Create users and associated vehicle with user.
GET /api/v1/users/:id Get the profile information of a specific user.
POST /api/v1/users/:id/rides Create an associated route with a user.
GET /api/v1/users/:id/rides Get all the matched routes with a specific users ride.

Postman

  • To run postman endpoints, start the Yardsourcing engine in locally rails s -p 3001
  • Utilize this link to download the postman suite

Database Schema

Hitch

Testing

Running Tests
  • To run the full test suite run the below in your terminal:
$ bundle exec rspec
  • To run an individual test file run the below in tour terminal:
$ bundle exec rspec <file path>

for example: bundle exec rspec spec/requests/api/vi/get_profile

How to Contribute

In the spirit of collaboration, things done together are better than done on our own. If you have any amazing ideas or contributions on how we can improve this API they are greatly appreciated. To contribute:

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Roadmap

See the open issues for a list of proposed features (and known issues). Please open an issue ticket if you see an existing error or bug.