No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
db
deployment
handlers
pgCatalog
populateDB
src
tools
.babelrc
.gitignore
.travis.yml
LICENSE
README.md
jest.config.js
localServer.js
package.json
serverless.yml
yarn.lock

README.md

ctxfloods

Central Texas Floods

Set up your development environment

πŸ’Ύ Install Postgres 🐘

  • If you're using macOS I strongly recommend using Postgres.app

πŸ’Ύ Install yarn

πŸ‘― Clone the repo

git clone https://github.com/cityofaustin/ctxfloods
cd ctxfloods
yarn install

🐘 Make sure postgres is running

  • Make sure psql works in your terminal

⌨️ Run the local server

yarn start

🌱 Seeding Data

yarn init-local-db
yarn drop-local-data
yarn migrate-local
yarn add-setup-data-local
yarn add-communities-local

# The next step needs the server running for GraphQL
yarn start
yarn add-waze-streets-local
yarn add-crossings-local

βœ… Run the tests

yarn test

It might be necessary to install Watchman if you see errors running the yarn test command. See this Github Issue for more details: https://github.com/facebookincubator/create-react-app/issues/871

🍻 Cheers! The backend should now be up and running!

Get the frontend running against the local backend

πŸ’Ύ Install the frontend

cd frontend
yarn install

πŸ–‹ Build the map style

yarn build-map-style

⌨️ Run the frontend against the local backend

yarn start-local

πŸ₯‚ Cheers! The frontend should now be up and running! Have fun clicking around!

πŸ”‘ Some pages require a login:

πŸ“§ In case of such a page, the following email addresses work:

πŸ— By default all passwords are set to "texasfloods"

Get Storybook running

⌨️ Generate the schema file

cd frontend
yarn get-schema

⌨️ Run storybook from the frontend

yarn storybook

Using TravisCI to test and deploy

πŸ”‘ Generate a new AWS Key

  • Go to your user in IAM
  • Go to security credentials and generate an access key

❌ Delete any entries in the env section of .travis.yml

πŸ’Ύ Install serverless

yarn global add serverless

⌨️ Run the set up deploy script

./setUpAWSDeploy.sh

Upon completion of the script, a new AWS CloudFormation should have been initialized for your branch. .travis.yml will also be updated to include branch specific environment variables.

πŸ— Your build should appear on Travis

Test the deployed frontend

//TODO Automate this

  • Go to S3 and find your bucket (it should be ctxfloods-frontend-your branch name)
  • Go to Properties -> Static Website Hosting
    • Select Use this bucket to host a website
      • Set index.html as both the Index and Error document (react-router will be doing our error handling)

🍾 Cheers! You should now have a deployed instance up and running.