- Install the front end dependencies by running
cd front-end && npm install && cd ..
- Install the backend dependencies by running
pip install -r requirements.txt
- Add the Firebase app config in a file called
firebase_config.json
infront-end/src/
.- Go to Firebase Project Settings site and look for "Web apps" under General. You will see a JavaScript object of the form:
var firebaseConfig = { apiKey: "XXXX", authDomain: "XXXX", databaseURL: "XXXX", projectId: "XXXX", storageBucket: "XXXX", messagingSenderId: "XXXX", appId: "XXXX", measurementId: "XXXX" };
- Take that information and create a JSON file of the form:
{ "config": { "apiKey": "XXXX", "authDomain": "XXXX", "databaseURL": "XXXX", "projectId": "XXXX", "storageBucket": "XXXX", "messagingSenderId": "XXXX", "appId": "XXXX", "measurementId": "XXXX" } }
- Name the JSON file
firebase_config.json
and put it infront-end/src/
- Add the Firebase Service Account information in a file called
firebase_key.json
inback-end/
- Go to Firebase Project Settings site and click on the "Service accounts" tab
- Click "Generate new private key" to download a new service account file
- Rename the file
firebase_key.json
and put it inback-end
- Add the ZipCodeAPI.com API key in a file called
zip_code_api_key
inback-end/
- This is only given the first time the application is registred with ZipCodeAPI.com (someone will have to give this to you)
- Open a terminal session
- Run the backend:
cd back-end && python3 server.py
- Open a new termainl session
- Run the frontend:
cd front-end && npm start
- Open a terminal session
- Build the frontend:
cd front-end && npm run build && cd ..
- Run the backend & frontend together:
gunicorn --chdir back-end -b :8080 wsgi:app
- requirements.txt needs to be at the top level of the repo otherwise Google App Engine doesn't find Flask properly
TODO:
- Integrate with a Material UI component
- Get server port from env var
- Error handling (i.e. what happens if Firebase is unreachable?)
- Restyle