A simple tool to order the daily breakfast and lunch at GSG bootcamp. The original requirement:
We always get food late and sometimes have no choice. The super app of Hani didn't really work, let's help him. Build a website where everyday we can oder breakfast and lunch. When visiting it the user should see a form with a time deadline. Each order is saved on a Google Sheet and at a specific time, 10:00am for breakfast and 02:00pm for lunch. The breakfast Orders will be sent to Hani1, and the lunch Orders will be sent to Hani2 on the phone as an SMS.
In order to run the application you will need use Google and Twilio APIs.
To use Twilio just signup, while for Google you need to follow those steps:
- signup on Google
- visit the google console
- on "Dashboard" click "Enable API", look for "Sheets", click on the result and "ENABLE"
- on "API Manager", select "Credentials" and click on "Create a project"
- on the modal enter the project name
Pasto
and submit - click on "Create credentials" and select "Service account key"
- select "New service account", enter
bot
in "Service account name", role "Project > Editor" - select JSON format for the key and click create
- go on google sheets and create one
- name it whatever you like and make sure to share with the
GOOGLE_CLIENT_EMAIL
If all the steps about are correct, you should have downloaded the json keys and create the sheet when the orders will be saved.
For Google SignIn instead:
- visit the official docs
- in the "Specify your app's client ID", click on highlighted section which should redirect to the google developer console
- follow the instructions on https://developers.google.com/identity/sign-in/web/devconsole-project
In order to run the application first create a .env
file like the example. Note,
these are pseudo-random values and not real ones.
TWILIO_ACCOUNT_SID="AC4549x162aac9452131f82725465d734d"
TWILIO_AUTH_TOKEN="3be2fe57fg5ac237090124d8e05f5f20"
TWILIO_PHONE_BREAKFAST="+972698400219"
TWILIO_PHONE_LUNCH="+971511401441"
TWILIO_PHONE_FROM="+13202220044"
GOOGLE_SHEET_ID="17JiGmBjoKvvau12o7PDoONwYAXHC3fwjkEt9f3jhA3w"
GOOGLE_CLIENT_EMAIL="[email protected]"
GOOGLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvg...Wiw70jaC\n-----END PRIVATE KEY-----\n"
GOOGLE_OAUTH_CLIENT_ID="660444165236-uuj139bbuo0dhgooi9skmfvc80o587jh.apps.googleusercontent.com"
Once all the environmental variables are set, clone and run the repo:
$ git clone https://github.com/gazaskygeeks/pasto
$ cd pasto
$ npm install
$ npm test
$ npm run
The application is Heroku
friendly, deploy it there.
Original team: