This is the backend engine fueling Yardsourcing, a web application that connects hosts with users looking to rent a yard. 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 14 API JSON endpoints. It stores all but the user information in the database.
The API endpoints allow other apps to store Yards (with full CRUD functionality), search yards by address and status, create, approve, reject, or cancel bookings associated to a yard, as well as view all host or renter upcoming bookings. There is automatic email functionality that ties into our Sinatra Sendgrid API Microservice that confirms bookings and approvals from hosts. To utilize this functionality, please set up the Sendgrid Microservice (see 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 set up automatic email confirmation, please visit the Sendgrid microservice.
- Alexa Morales Smyth | LinkedIn
- Genevieve Nuebel | LinkedIn
- Dominic Padula | LinkedIn
- Jenny Branham | LinkedIn
- Jordan Beck | LinkedIn
- Angel Breaux | LinkedIn
- Doug Welchons | LinkedIn
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.
- Getting Started
- Endpoints
- Project Architecture
- Database Schema
- Application Features
- Testing
- How to Contribute
- Roadmap
- Contributors
- Acknowledgments
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.
-
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.
-
Google Oauth API
- Visit the google developer tools to create an account and follow the instructions to create a project for your server to obtain a client_id and client_secret.
-
Omniauth for Rails Visit the google api omniauth homepage and follow their instructions to get familiar with how to use Omniauth in a rails application.
- Clone the repo
$ git clone https://github.com/Yardsourcing/yardsourcing-frontend
- Bundle Install
$ bundle install
- Create, migrate and seed rails database
$ rails db:{create,migrate,seed}
- Set up Environment Variables:
- run
bundle exec figaro install - add the below variable to the
config/application.ymlif 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.
| HTTP verbs | Paths | Used for |
|---|---|---|
| GET | /api/v1/purposes | Get the available purposes |
| GET | /api/v1/yards/:yard_id | Get a yard's show page |
| POST | /api/v1/yards | Create a new yard |
| DELETE | /api/v1/yards/:yard_id | Delete a yard |
| PUT | /api/v1/yards/:yard_id | Update a yard |
| GET | /api/v1/hosts/host_id/bookings?status=STATUS | Get all bookings for a host that have a particular status |
| GET | /api/v1/renters/renter_id/bookings?status=STATUS | Get all bookings for a renter that have a particular status |
| GET | /api/v1/yards?location=ZIP&purposes=PURPOSE+NAME&OTHER+PURPOSE+NAME | Get yards that match search criteria. |
| GET | /api/v1/hosts/host_id/yards | Get yards that belong to a host |
| GET | /api/v1/yards/:yard_id/bookings | Get bookings that belong to a specific yard |
| POST | /api/v1/bookings | Create a new booking |
| GET | /api/v1/bookings/:booking_id | Get booking show page |
| DELETE | /api/v1/bookings/:booking_id | Delete a new booking |
Please see the API Documentation for detailed information about each endpoint, existing parameters, and expected json data input and output.
- To run postman endpoints, start the Yardsourcing engine in locally
rails s -p 3001 - Utilize this link to download the postman suite
- 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/features/host/dashboard/index_spec.rb
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:
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
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.
-
See also the list of contributors who participated in this project.
- Our fantastically wizard like Project Manager and Instructor at Turing School of Software and Design:
- Ian Douglas

