We help child care providers and families claim the government funding for which they are already eligible.
Please note we have a code of conduct, please follow it in all your interactions with this project.
We have a vision for equity and justice in the early childhood field. We know that technology is part of the solution - and that today’s products do not meet the needs of most communities. We’re building the market for early childhood technology that educators, families and children deserve.
We need your help!
Pie for Providers helps small child care providers and families claim the government funding for which they are already eligible. Today, 85% of eligible children do not claim this funding. This means families struggle to afford care. This means mothers cannot advance their careers and support their families. This means child care providers - small, women-owned businesses - do not get paid for their work.
Let’s change that. Contribute to Pie for Providers today by picking up any of our open issues.
Learn more at www.pieforproviders.com
- Staging: https://pie-staging.herokuapp.com/
Architecture
-
Backend: Rails
- SUPER IMPORTANT This is configured to use UUIDs for primary keys in the generators: rails/config/initializers/generators.rb
- Rubocop
- Data Migrations: https://github.com/ilyakatz/data-migrate
- RSpec
- SimpleCov
- Shoulda Matchers
- DatabaseCleaner
- FactoryBot
- Faker
- RSwag
- v1 API Routes returning JSON
- Postgres DB
- API Documentation with swagger
-
Frontend: React
- ESLint/Prettier
- Jest/React Testing Library
- Husky for pre-commit hooks
Prerequisites
postgres
v12.3bundler
git
npm
graphviz
- https://graphviz.org/download/XCode Select
tools if you're on Mac
heroku cli
- https://devcenter.heroku.com/articles/heroku-cli#download-and-installforeman
Setup and configuration
- clone the repo:
git clone [email protected]:pieforproviders/pieforproviders.git
- navigate to the app directory:
cd pieforproviders
- install bundler for gems:
gem install bundler
- install gems:
bundle install
- set up an environment file: copy
.env.sample
to.env
- configure Devise: run
rails secret
to generate a secret string, add it to.env
as theDEVISE_JWT_SECRET_KEY
value - create and seed the database:
bundle exec rails db:setup
- install yarn globally if you don't have it yet:
npm install yarn -g
- navigate to the frontend directory:
cd client
- install front-end and end-to-end packages:
yarn install
Running the app locally
You have several convenient options for running the app locally.
rails start
- This spins up both the front end and the back end in the same terminal window
- Run
foreman start
- This spins up both the front end and the back end in the same terminal windo
- Start rails in one terminal:
rails s -p 3001
- Open a second terminal and start react:
cd client && yarn start
Visit localhost:3000
to see the React frontend. 🥳
Visit localhost:3001/api-docs
to see Swagger UI for API endpoints 📑
NOTE: Swagger UI is currently not configured to use authentication, so any authenticated endpoints will not be accessible at this route, you'll get unauthorized errors.
Using the application
You can create a new user account by visiting /signup
(or clicking "Sign Up" on the login page at the root).
When you create a new account, you should see a demo email pop up in a new tab; the link in this URL can't be clicked in local development. Instead, copy the path (starting with localhost
) and paste it into a browser window. This will confirm your user and automatically log you in.
Running tests
bundle exec rspec
orbundle exec guard
to watch- When tests pass and you're ready for a PR, please run
rails rswag
to update the API documentation
yarn test
(auto-watch) oryarn test-once
to run the suite one time only
yarn run cy:ci
from the root directory
yarn start-server
in one terminal (make sure rails is not currently running)yarn run cy:open
in another terminal
Troubleshooting and FAQs
Q: I keep getting redirected to the login screen when after I've created and confirmed my account
A: Make sure you've created a secret for DEVISE_JWT_SECRET_KEY
in .env
using rails secret
Q: I get postgres errors when I try to set up the database
A: Make sure Postgres is running on port 5432. Sometimes Postgres doesn't play nice depending on how you've installed it. If you're having trouble with Postgres, I strongly recommend Postgres.app
- you can install multiple versions and it plays nicer with rails.
Q: I see the following error in my terminal: gyp: No Xcode or CLT version detected!
A: try removing and reinstalling XCode command line tools OR running xcode-select --reset
(see this github issue for more info)