Find the nearest restaurants using the user's IP.
- Node/NPM
- MongoDB
- Typescript - TS Download
- ESLint (Optional) - Docs
- PORT 3000 needs to be empty, or you can change the port in backend/server.ts
- In order to use this application, you need to setup the environment variables for a .env file
On the project's root directory create a .env file with the following structure:
YELP_API_KEY=
GOOGLE_API_KEY=
GEO_API_KEY=
HEROKU_PROXY_SERVER=
DB_URI=
JWT_SECRET=
Acquire your API keys, MongoDB URI, and Client URL and place your values after the equals signs.
- If you want to create separate .env files for separate environments add your file path to
.config()
in:
- backend/server.ts: Line 7
- webpack.config.js: Line 7
i.e. dotenv.config('./example.env
)`
- Generate API Keys for the following services:
- YELP - https://www.yelp.com/developers/documentation/v3/authentication
- GOOGLE APIS - https://developers.google.com/maps/documentation/javascript/overview
- IPIFY - https://www.ipify.org/
- Generate a CORS Proxy Server:
git clone https://github.com/Rob--W/cors-anywhere.git
cd cors-anywhere/
npm install
heroku create
git push heroku master
- Use the url for the HEROKU_PROXY_SERVER environment variable
- It may vary depending on what system your running on, for running this app on your local machine
- MongoDB URI Docs - https://docs.mongodb.com/manual/reference/connection-string/
- Example for URI: 'mongodb://localhost:27017/restaurantFinder'
- A secret password for accessing your JWT token
- This can be any password; but this would be a unique password to this application
- Install dependencies:
npm install
- Create environment variables on .env file
- Compile frontend and backend builds:
npm run build
- Make sure MongoDB is running on your local machine
- Start the project:
npm start