GithubHelp home page GithubHelp logo

project_greenprint_backend's Introduction

Project Greenprint backend API

Build Status Planet needs saving


API docs

API hosted at

https://project-greenprint-backend.herokuapp.com/

Can be used with the following frontend app:

https://project-greenprint.herokuapp.com/

Journey

POST /

Post request has to contain query parameters in the body of the request formatted as JSON. It must be in the following format:

{
    "from": "_starting_point_",
    "to": "_destination_"
}

On success, the above will return the data back formatted in JSON:

{
    "from": "_starting_point_",
    "to": "_destination_"
}

API local usage

API runs with the following technologies:

API tested with the following frameworks:

Setup

API runs with version 13.5.0 of Node JS. Check node documentation for installation instructions.

Clone repository. Once inside the root folder run the following command to install dependencies.

npm install

Set up environment. Inside the root folder run the following command, modified to include your own API keys, in order to be able to run locally.

touch .env

and then inside the .env file add:

NODE_ENV=development
PORT=5678

GOOGLE_KEY='YOUR_GOOGLE_API_KEY'
CARBON_KEY='YOUR_TRIP_TO_CARBON_API_KEY'
MONGO_ATLAS_KEY = 'YOUR_MONGOATLAS_USER_PASSWORD'
GOOGLE_KEY_EMBED_MAPS="A_SEPARATE_GOOGLE_API_KEY_FOR_EMBEDDED_MAPS" *
BRIGHTER_PLANET_KEY="YOUR_BRIGHTER_PLANET_API_KEY"

*IMPORTANT: ensure that this key is restricted to only receive referrals from the specific frontend app, as the key is included in the url for embedding maps.

To run server locally, type node server.js.

Application will run on localhost:5678

Installing MongoDB

To run the backend database, you need to install MongoDB. For this, just type on your terminal:

brew install mongodb

Nice! The next step is creating our database.

mongo
> use user

Testing

To run tests, navigate to root folder and run command

npm test

Tests are run using the Mocha testing framework!

Team

project_greenprint_backend's People

Contributors

elfiyang16 avatar sevensecrets avatar fahus avatar sarar0 avatar jonesandy avatar natyeo avatar

Stargazers

 avatar

Watchers

James Cloos 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.