Coder Social home page Coder Social logo

bathroom-finder-server's Introduction

All-Gender Bathroom Finder

Summary

This is the server behind the All-Gender Bathroom Finder App.

Functionality of the server includes:

  • GET all bathroom locations.
  • GET bathroom locations based on geography.
  • GET bathroom locations based on query.
  • POST new bathroom locations, with checks for unique locations.
  • DELETE bathroom locations by ID.
  • PUT bathroom locations by ID

Requirements

  1. Install MongoDB locally on your machine. https://zellwk.com/blog/install-mongodb/

  2. Set up the database mongoexport -h ds163053.mlab.com:63053 -d bathroom-finder -c locations -u admin2 -p password1 -o ~/db/data mongoimport --db bathroom-finder --collection locations --drop --file ~/db/data

  3. run mongod

  4. run npm run dev

  5. npm install

API Documentation

Base URL: https://gentle-lake-28954.herokuapp.com/api

GET Locations

/locations

Returns all locations.

/locations/geography?lat=VALUE&lng=VALUE

Returns all locations based on latitude and longitude.

/locations/search?query

Returns locations by query.

/locations/id/:id

Returns locations by ID.

POST Locations

/locations

Posts new location to the server. First searches server based on location name and zipcode to check for unique values.

PUT Location

/locations/:id

Edits & returuns location

DELETE Location

/locations/:id

Deletes location

Location Object

{ "_id": "5c32bc8ccdfffe0017336520", "loc": { "type": "Point", "coordinates": [ -78.9577334, 36.0403879 ] }, "type": [ "restaurant", "point_of_interest", "food", "establishment" ], "googlePlaceId": [ "ChIJ24c6XRHhrIkRA18898mTQ6Y" ], "name": "Picnic", "street": "1647 Cole Mill Road", "city": "Durham", "state": "NC", "zip": "27705", "dist": { "calculated": 0 } }

_id: Generated by server when location is created

loc: Location object for Mongoose. Type is always Point. Coordinates MUST be longitude first, latitude second.

type: Array pulled from Google Places API.

googlePlaceId: ID for Google Places API.

name: Name of location.

street: Street Address.

city: City

state: State.

zip: Zipcode (String)

dist: Returned from /locations/geography endpoint. Distance in meters from queried location.

Technologies Used

This server was created using the following technologies:

  • Node.js
  • Express
  • MongoDB
  • Mongoose
  • Mocha/Chai Testing
  • Travis CI

Author

This project was created by Alex Manzo.

bathroom-finder-server's People

Contributors

alexmanzo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.