An app for groups to decide on nearby lunch options. Check out a live version, or read the blog post about it!
Add this line to /etc/hosts
:
127.0.0.1 local.lunch.pink
If you will be testing subdomains, you should add an additional line for each subdomain, e.g.:
127.0.0.1 labzero.local.lunch.pink
127.0.0.1 someotherteam.local.lunch.pink
If you want to run integration tests, you will also need to add:
127.0.0.1 integration-test.local.lunch.pink
Make two copies of .env.sample
, named .env
and .env.prod
.
For GOOGLE_*
env variables:
- Create a Google Developer app in the console.
- Enable the Google+ API, Contacts API, Google Maps JavaScript API, Google Places API Web Service, and Google Maps Geocoding API.
- Go to the Credentials section and create an OAuth client ID.
- For local development:
- Enter
http://local.lunch.pink:3000
as an authorized JavaScript origin - Enter
http://local.lunch.pink:3000/login/google/callback
as an authorized redirect URI
- Enter
- Add your deployment target(s) as additional origins/redirect URIs.
- Go back to the Credentials section and create two API keys - one for the client, and one for the server.
- For the client, optionally limit requests to certain referrers.
Set up a PostgreSQL database and enter the credentials into .env
. If you want to use another database dialect, change it in database.js
.
To seed your database with a Superuser, fill out the SUPERUSER_*
env variables accordingly, then run
npx sequelize db:seed:all
After setting up and starting the app, you will be able to log in with this user and create a team. If you did not supply a SUPERUSER_PASSWORD, you will need to log in via OAuth, using the email address you supplied for SUPERUSER_EMAIL.
After setting up your environment:
First, install Yarn. Then:
yarn
npx sequelize db:migrate
npm start
npm run build
node build/server.js
You can modify tools/deploy.js
as needed to work with your deployment strategy.
npm test
To run an individual file:
npm run test-file /path/to/file
npm run coverage
Make sure your .env
file is filled out. Set up a separate test database using the same user as your development environment. Enter the following into .env.test
:
DB_NAME=your_test_db_name
SUPERUSER_NAME=test
SUPERUSER_PASSWORD=test
[email protected]
Then run:
npm run integration
Individual files can be run using:
npm run integration-file /path/to/file
npm run lint
This project was created using React Starter Kit. Many technology choices originate from its repository, but this project adds on Sequelize, RESTful APIs instead of GraphQL, and Redux.