Giter Site home page Giter Site logo

ctxfloods's Introduction

CTXfloods-frontend

Central Texas Floods Frontend

Set Up Development Environment

๐Ÿ’พ Install yarn

๐Ÿ‘ฏ Clone the repo

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

โŒจ๏ธ Start the local server

yarn start-local

๐Ÿ’พ Clone and install CTXFloods-backend

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

Run Tests

yarn test

If any storybook snapshots need updating, run yarn test -u

Run Storybook

yarn storybook

Deployment Process

Branch promotion works like this:
feature -> dev -> master

Create your feature branch as a branch off "dev". That feature branch will be merged into "dev", which will then be merged into "master."

CTXFloods uses TravisCI for continuous integration. Whenever you push to github, a TravisCI build will be triggered. By default this will only run the tests. If you want to deploy your feature branch on a git push, add the name of your feature branch to deployment/devDeployConfig with the option deploy: true. This will build a new S3 Bucket for your feature branch frontend. Subsequent pushes from the same branch will update this same bucket. If you want to connect it to a specific backend deployment, add the name of the backend branch under the backend option. Ex:

"195-camera": {
  deploy: true,
  backend: "195-camera"
}

If deploy: true is set without a specified backend, your frontend will point to the "dev" branch backend.

Environment variables are sourced from deployment/vars depending on your branch. (All feature branches share the same environment variables as dev.sh. Any feature branch specific configs should be handled in deployment/devDeployConfig.js.) Any environment variable prefixed with TRAVIS_ is a secret environment variable that is stored in TravisCI. It will get loaded in during the build phase of a TravisCI/github deployment.

It would be possible to deploy ctxfloods without continuous integration by running deployment/deploy.sh. However, you would have to provide your own substitutes for the TRAVIS_ environment variables.

Update settings in CloudFront if you want to use a custom DNS name.

Development Tips

  • ๐Ÿ”‘ Some pages require a login:

    ๐Ÿ“ง In case of such a page, you can log in as the default super admin user:

    This password is set as PG_SUPER_ADMIN_PW in /deployment/vars/local in ctxfloods-backend.

  • Every route that is prefixed by /dashboard is a route that requires authentication. To get to the login page, manually enter the URL address localhost:3000/dashboard/map. After authentication succeeds, you will be redirected to the authenticated /dashboard/map page. To log off (i.e. remove you jwt_user_token from local storage), click "Sign out" in the upper right hand corner of the header and manually enter localhost:3000/map.

  • If you added a new postgres migration file to the backend, regenerate the frontend's graphql schema file by running yarn get-schema

  • Environment variables prefixed by TRAVIS_ are secret variables stored in TravisCI. They get loaded in during the build phase of a TravisCI/github deployment.

ctxfloods's People

Contributors

luqmaan avatar niicck avatar rentrop avatar ifsimicoded avatar benguhin avatar sknep avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.