Skip to content

Ruby on Rails RESTful API, using a postgres database protected by bespoke written validations to ensure posted data meets the applications requirements, and to filter malicious data.

Notifications You must be signed in to change notification settings

Shilcof/backend-track-builder

Repository files navigation

backend-track-builder

Backend code for track-builder, a javascript single page web application (git repo here https://github.com/Shilcof/frontend-track-builder) where users can build and submit tracks to a database handled in the backend by Ruby on Rails.

When viewing tracks, a 'car' is generated for each user that can be driven around the track. Using websockets, the location of the car is braodcast to any other user that is also viewing that track so that they can race each other on it.

Installation

track-builder was developed using Javascript and Ruby on Rails.

To run track-builder on your machine, you must first download the files from this repository and the backend. On the backend you must change into the main directory in your terminal.

Then you must use bundler to install the required gems.

bundle install

To set up the database for the application and seed it with dummy data, you must run:

rails db:migrate

Usage

To run the application on your computer you can host it with:

rails s

and then in the front end repository open the index.html page in your browser.

To stop hosting the aplication, simply enter control + 'C' into the terminal where it is running.

Also in the trackAPI.js file you must amend the port and websocket address to the localhosting that you use. Then open the index.html file in your browser.

From here you can create your own tracks, and if you use separate private browser windows, will be able to see cars moving in each page.

Contributing

Pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The application is available as open source under the terms of the MIT License.

About

Ruby on Rails RESTful API, using a postgres database protected by bespoke written validations to ensure posted data meets the applications requirements, and to filter malicious data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published