services/auth: Authentication webhookservices/data: Hasura GraphQL project with migrationsservices/events: Event triggersservices/actions: Hasura actionssrc: Next.js web application
brew update
brew install dockerbrew install docker-machine
brew cask install virtualboxbrew install docker-composedocker-machine create --driver virtualbox defaultVerify if Docker engine is running
docker-machine lsIf for some reason, its not running, run below command
docker-machine start defaultShow env variables
docker-machine env defaultSet env variables show above
eval $(docker-machine env default)Copy the IP address of the docker engine
docker-machine ip defaultUse Hasura CLI: https://docs.hasura.io/1.0/graphql/manual/hasura-cli/install-hasura-cli.html#install
- Design: go to
services/data, then run below command. Default Secret ishasura, use above ip address for endpoint for example:http://$(docker-machine ip default):8080
hasura console --admin-secret [secret] --endpoint [endpoint]- Migrate: This is already done during build command, so skip this command.
hasura migrate apply --admin-secret [secret] --endpoint [endpoint]-
Copy
dotenvfile to.envand edit configuration if necessary -
Copy
src/dotenvfile tosrc/.envand edit configuration if necessary. Make sure you change theNEXT_PUBLIC_DATA_DOMAINenv var to the docker engine IP address
NEXT_PUBLIC_DATA_DOMAIN=192.168.99.100:8080- Use Docker with docker-compose
# start development dockers
make dev
# because docker caches built images, when changing packages, we need to rebuild containers
make dev-build- If for some reason, you need to start from scratch. Follow the below steps to delete all docker images, containers and volumes
docker stop $(docker ps -a -q)docker rm $(docker ps -a -q)docker system prune -adocker volume prune-
For Test/Production environment, use
docker-compose.test.yamlordocker-compose.prod.yamlconfig file. It requiresgcplogsdriver (read below), or you can remove it if using another logging services
make staging
# or
make prod- Basic knowledge of Twilio platform - TwilioQuest, an interactive, self-paced game where you learn how to Twilio.
- Twilio TaskRouter
- Twilio Client
If you haven't used Twilio before, welcome! You'll need to Sign up for a Twilio account.
We recommend you create a separate project within Twilio and install this app using that project.
Note: It is recommended that you have an upgraded Twilio account to fully experience this demo.
Before you start the install, you’ll need to collect the following variables from the Twilio Account Portal.
TWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKEN
-
For Account SID and Auth Token please click here: https://www.twilio.com/console
-
Buy a phone number or use an existing one (the application will configure the number for you later)
-
Create a new Twilio TaskRouter Workspace and select the custom template.
-
For Twilio API Key SID and Twilio API Key Secret, click here: https://www.twilio.com/console/dev-tools/api-keys
TWILIO_API_KEY_SIDTWILIO_API_KEY_SECRET
- For outbound calls enable AGENT CONFERENCE setting, click here: https://www.twilio.com/console/voice/conferences/settings
ngrok Setup
-
System Wide Install
-
Install with NPM
npm install ngrok -g -
Run ngrok (if PORT is defined in your .env update accordingly)
./ngrok http 3000
npm installCopy src/dotenv to src/.env then edit your environment
Set NEXT_PUBLIC_WEBSITE_URL to the ngrok url for example: http://bc6c3e0506c9.ngrok.io
npm run devnpm run serve
npm run deploynpm run cleanUse Cypress testing framework
Create new test files in cypress/integration folder
Run test command:
npm test
# end to end test
npm run cy:open- The empty
placeholder.htmlfile is so Firebase Hosting does not error on an emptypublic/folder and still hosts at the Firebase project URL. firebase.jsonoutlines the catchall rewrite rule for our Cloud Function.- The Firebase predeploy hooks defined in
firebase.jsonwill handle linting and compiling of the next app and the functions sourceswhenfirebase deployis invoked. The only scripts you should need aredev,cleananddeploy.