Skip to content

MMIM-Turing/mmim_be

Repository files navigation

Meet In the Middle Back End Repo

ruby rails rspec contributors

Table of Contents

App

Meet Me in the Middle app can be found on heroku.

Background

The Meet Me in the Middle back end repository supports the front end repository by accessing Google Maps and sending that information to the front end to be displayed to the user. The back end also keeps track of the database that the app uses in order to track users and meetings.

Schema

schema

Endpoints

  • Save users.
POST /api/v1/users
  "data": {
    "type": "user",
    "id": "1",
    "attributes": {
      "name": "Some person",
      "email": "sample@email.com",
      "address": null
    }
  }
  • Update users.
PUT /api/v1/users/{{user.id}}, body: {"address": "updated_address"}
"data": {
    "type": "user",
    "id": "1",
    "attributes": {
      "name": "Some person",
      "email": "sample@email.com",
      "address": “updated_address”
    }
  }
  • Search users by email.
GET http://localhost:3000/api/v1/users/find_by?email={{email}}
"data": {
    "type": "user",
    "id": "1",
    "attributes": {
      "name": "Some person",
      "email": "sample@email.com",
      "address": “updated_address”
    }
  }
  • Search for nearby locations to the midpoint between two locations.
GET /api/v1/search
"data": [
        {
            "id": "1",
            "type": "location",
            "attributes": {
                "id": 1,
                "name": "Craft Fine Street Food",
                "place_id": "ChIJFWYEjYB5bIcRmxn8I3pwIyI",
                "address": "2300 Steele Street, Denver",
                "lat": 39.7501721,
                "lng": -104.9507145,
                "rating": 5.0,
                "image_url": "Aap_uEA2DeYoTfsa2YAAKTBLjbr5uUMN3iaeYtNpz9ehr1lV8YVBESiDv
                -xupQ2STTcWLYf8zhiXFptVPgoyUIhlahQLYxzw5kvFuZq68OvJb9U54gh8ZJEprez
                ozU-IgXZZV9L9kOBMyPnpWrOI7RKTSw7yWk_ycMU9ltvXqaKidbtOtQSI",
                "price_level": null
            }
        },
      ]     
  • Returns meetings with other users.
GET /api/v1/user_meetings
"data": [
        {
            "id": "1",
            "type": "meeting",
            "attributes": {
                "host_name": "john",
                "guest_name": "max",
                "location_name": "A great place",
                "location_address": "123 test way"
            }
        },
        {
            "id": "2",
            "type": "meeting",
            "attributes": {
                "host_name": "john",
                "guest_name": "max",
                "location_name": "A bad place",
                "location_address": "234 test blvd"
            }
        },
      ]

Requirements

Note: You must also install and run mmie_fe for full functionality.

API

Go to Google and follow instructions for Google Developer setup and to create an API key.

Setup

  1. Clone this repository: On your local machine, open a terminal session and enter the following commands for SSH or HTTPS to clone the repo.
  • using SSH key
$ git clone git@github.com:MMIM-Turing/mmim_be.git
  • using HTTPS
$ git clone https://github.com/MMIM-Turing/mmim_be.git
  • Once cloned, you'll have a new local copy in the directory you ran the clone command in.
  1. Change to the project directory: In terminal, use $cd to navigate to the project directory.
$ cd mmim_be
  1. Install required Gems utilizing Bundler:
  • In terminal, use Bundler to install any missing Gems. If Bundler is not installed, first run the following command.
$ gem install bundler
  • If Bundler is already installed or after it has been installed, run the following command.
$ bundle install
  1. Database Migration
  • Before using the web application you will need to setup your databases locally by running the following command
$ rails db:{drop,create,migrate,seed}
  1. Run Figaro
$ bundle exec figaro install
  • That will create an config/application.yml file.

  • Add your Google api to new this new file.

#config/application.yml
google_maps_api_key: 'your google key here'
  1. Startup and Access
  • Finally, in order to use the web app you will have to start the server locally and access the app through a web browser.

  • Start server

$ rails s
  • Note: You must run mmie_fe server simultaneously.

  • Open web browser and visit link http://localhost:5000

Contributors

Joseph Downs GitHub | LinkedIn
Kim Guo GitHub | LinkedIn
John Hennerich GitHub | LinkedIn
Will Medders GitHub | LinkedIn
Oscar Santos GitHub | LinkedIn
Max Wagner GitHub | LinkedIn

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published