Skip to content

Restaurant-passport-2/BE

Repository files navigation

Restaurant Passport

Restaurant Passport is an app for people that want to log what restaurants they have been to, as well as find new places in their area that they might be interested in but haven't heard of before. This repository serves as the backend for the project. See the Product Canvas for more information.

API documentation generated with ApiDoc

Technologies used:

General:

Security

  • CORS for Cross-Origin configuration.
  • helmet for basic security adjustments to the server.
  • bcrypt for encrypting/hashing sensitive user data.

Testing:

Database:

  • knex as the query builder and interface to postgres
  • pg PostgreSQL

Installation

$ npm install

Required environment variables

These are required to get the server working after install:

  • NODE_ENV - production / development
  • PORT - For heroku deployment
  • DATABASE_ENV - testing / developing / production
  • DATABASE_URL - Production database connection string (used by heroku)
  • DATABASE_URL_DEV - development database connection string
  • DATABASE_URL_TEST - testing database connection string
  • JWT_SECRET - Key for encrypting JWTs
  • HASH_SALT_ROUNDS - Salt rounds for bcrypt hashes
  • YELP_API_KEY - Used by the /restaurants/search route
  • YELP_API_SEARCH - URL for the yelp business search endpoint

Running the server

# production mode
$ npm run start

# development mode
$ npm run start:dev

Developing

# migrate database to latest
$ npm run db:latest

# rollback database migrations
$ npm run db:rollback

# seed the database
$ npm run db:seed

Testing

# run endpoint tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

License

This project is MIT licensed

About

Backend for Restaurant Passport

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •