- A google cloud provider account:
- Google storage bucket.
- Sendgrid account and the sendgrid_api_key
- Clone the repository:
git clone https://github.com/hackmcgill/hackerAPI.git
- Make sure you have the following tools:
git
: https://git-scm.com/downloadsmongodb
: https://docs.mongodb.com/manual/installation/- Make sure you also have the
/data/db
directory. - To test the installation, run
mongod
.
- Make sure you also have the
node
: https://nodejs.org/en/download/ (Validated Node version is specified in.nvmrc
)npm
: https://www.npmjs.com/get-npm.Postman
: https://www.getpostman.com/downloads/. We use this for testing the API locally.
- Create a
.env
file in the root directory, and populate the fields as per.env.example
. - run
npm install
- Determine which environment the database you want to seed belongs to (
deployment
,development
, ortest
). - Navigate to
package.json
, and confirm that at theseed
script,NODE_ENV
is set to the proper environment. - Run
npm run seed
.
In order to test that you have set up the API properly, run npm run test
.
-
Import Postman Collection from
postman.json
-
Create a new Environment in Postman with Variables for
base_url
. Typical values for these might look like this. You may or may not have the same credentials in your Dev Environment as the Production Database.Local Dev Environment Production Environment base_url http://localhost:3000/api https://api.mchacks.ca/api
API parameters are not currently automatically imported by the Postman generation script. A change to a different API Doc generation tool in future could make this a more supported use case by Postman.