swapp is a web application that helps SWAP (Severe Weather Action Plan) caseworkers perform intake for people experiencing homelessness, so that they can find shelter during periods of inclement weather.
First, install the following:
- Ruby - This project uses version
2.7.4
. You can use rbenv to easily manage your local ruby version:rbenv install 2.7.4
- Ruby on Rails
- Node.JS and npm
- postgres
- Within your terminal, clone this repo to your local machine:
git clone [email protected]:mostlyerror/swapp.git
cd swapp
- Install Ruby gems:
bundle install
- Install some node packages to provide the best CSS compatibility possible. Run
npm install tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
- Install webpacker with
rails webpacker:install
- Run the following:
rails db:create
rails db:migrate
- this runs all of the migrations listed indb/migrate
rails db:seed
- this runs the seed script (db/seeds.rb
), which loads the app's seed data
In order to send vouchers electronically, obtain credentials by creating accounts with Twilio and SendGrid
Once you have those set up:
- Create a
.env
file in the project's root directory (if not already present). - Then open your
.gitignore
file and add.env
. - Open your
.env
file and add the following:
TWILIO_SID=YOUR_TWILIO_SID
TWILIO_TOKEN=YOUR_TWILIO_TOKEN
TWILIO_NUMBER=YOUR_TWILIO_NUMBER
SENDGRID_API_KEY=YOUR_API_KEY
⚠️ ⚠️ Double check that.env
has been added to your .gitignore file to avoid uploading sensitive data. DO NOT UPLOAD YOUR .ENV FILE TO GITHUB⚠️ ⚠️
You can read more about them here.
Essentially, you can run EDITOR=vim rails credentials:edit
to open your encrypted credentials file. Once you save it, a config/master.key
file will be available, which is the file you will need to modify your credentials in the future. Keep track of the contents of this file because you will need to generate a new one if you lose it (and add any secrets).
- Run
rails server
to start the app - In a separate process, run
./bin/webpack-dev-server
- Navigate to
http://localhost:3000
to view.
TODO: Heroku setup, pipeline configuration, etc.