twilio -> switchbot service to let you manage access
you need a config.json
in the root directory for switchbot auth. example
config.json
looks like this:
{
"SWITCHBOT_AUTH": "[auth key here]",
"TWILIO_ACCOUNT_SID": "[sid here]",
"TWILIO_AUTH_TOKEN": "[auth token here]"
}
TODO: independent backend and frontend dev
TODO: add environment variables shell script for local vs prod environments
prereqs:
- postgres
start postgres server - depends on how you installed postgres
brew services restart postgresql # if postgres was installed with brew
postgres -D /usr/local/var/postgres # to run postgres without brew
create local postgres db
createdb buzz-me-in
run postgres interactive terminal
psql buzz-me-in
on GCP, the instance is called buzzer-166
. In the cloud console, enter:
gcloud sql connect myinstance --user=postgres
prereqs:
- python3.7+
install venv package globally:
python3 -m pip install venv
set up virtual environment (in root dir):
python3 -m venv .venv # create virtual env
source .venv/bin/activate # activate virtual env
# install dependencies and test dependencies
pip install -r requirements.txt -r requirements-test.txt -r requirements-dev.txt
deactivate # deactivate virtual env
to run server locally (with virtual environment activated):
yarn start-server
to run server in Google's dev server locally to mimic the prod environment:
dev_appserver.py --env_var GOOGLE_APPLICATION_CREDENTIALS=[path to your credentials] .
to run tests:
yarn test-server
NOTE: to run the server, currently you need an authorized google cloud service
account key file on your machine, as well as the
GOOGLE_APPLICATION_CREDENTIALS
env var set to the location of that file. This
is just for logs. TODO: remove google logs dependency or set logs to only use
google when on the server
install dependencies
yarn
start react dev server
yarn start
Currently, this app is deployed and hosted with Google Cloud Platform.
app.yaml
and .gcloudignore
are config files for the gcloud
which is used
to deploy this app to GCP.
prereqs for deployment:
to deploy a new version (from root dir):
yarn build # build the react app
gcloud app deploy # push to prod server
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests
for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best
performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can
eject
at any time. This command will remove the single build dependency from
your project.
Instead, it will copy all the configuration files and the transitive
dependencies (webpack, Babel, ESLint, etc) right into your project so you have
full control over them. All of the commands except eject
will still work, but
they will point to the copied scripts so you can tweak them. At this point
you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for
small and middle deployments, and you shouldn't feel obligated to use this
feature. However we understand that this tool wouldn't be useful if you couldn't
customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify