code4sac / wicit

A simple node/express app for finding locations that accept WIC in California, using data from the new California Department of Public Health open data portal.
http://findwic.com/
MIT License
19 stars 20 forks source link

WICit: Where to Shop with WIC

The California deployment of WICit is live!

Check it out at findwic.com!


Development Environment Setup

OS X

  1. Install node.js and NPM (Node Package Manager)
  2. Install grunt command-line on your machine: sudo npm install -g grunt-cli
  3. Fork the repository and setup a local clone
  4. Move into your local wicit directory: cd <yourdirectory>/wicit
  5. Copy the .env.dist file to a file called .env
    1. Navigate to https://www.mapbox.com/studio/
    2. Select Create a Style - leave all of the defaults
    3. Select Create
    4. Click the "< Basic" in the top left of the screen
    5. Click the Menu under the new style (default name is Basic) and select Share, develop, use
    6. Copy the Share URL and update the MAPBOX_INTEGRATION_URL parameter in the .env file
  6. Install server-side dependencies, build the app: npm install. You can build the app without installing dependencies using grunt build
  7. Start the server: node app.js
  8. Try it out

Windows

  1. Install: Git
  2. Install: Node & NPM
  3. Install: Python 2.x.x
    • Version 3 of Python is not supported by nodegyp so make sure to install version 2.x.x.
  4. Install: Visual Studio Community (with Update 4)
    • Visual Studio Express for Windows Desktop should also work, but if you want a full IDE, go with the Community edition
  5. From a command prompt, install the Grunt Command Line Interface: npm install -g grunt-cli
  6. Follow the OS X instructions above from step 4

Development

  1. Setup the app using the relevant instructions above.
  2. From a new command prompt, start the build watcher to automatically build client-side JavaScript and CSS when JS and CSS files change: grunt dev. This task does not watch for server-side changes. For those, you'll need to restart the app server.

Deployment

Digital Ocean

Wicit is ready to be deployed on Digital Ocean using Dokku (wicit doesn't use a database right now, so you don't have to worry about that part). Just be sure to use dokku config:set <appname> VAR=value to add the settings present in your local .env file to your deployment environment.

Connecting (you will need your ssh key on the droplet or find someone who has their ssh key on the droplet):

  1. ssh root@<ip address>

Renew SSL Manually (it should auto-renew via cron, but to troubleshoot)

  1. dokku letsencrypt:auto-renew

License

WICit is free software, and may be redistributed under the MIT-LICENSE.