Flaredown makes it easy for people to track symptoms over time, and learn how to control them. Our goal is to analyze the aggregate data from users of this tool to understand the probable effects of treatments and environmental stressors on chronic illness.
Help would be appreciated! Please join us in slack #flaredown, raise a GitHub issue, or email contact@flaredown.
- PostgreSQL 12.8
- MongoDB 4.4.9
- Redis 6.2.3
- Ruby 3.2.3
- Node 22 (the frontend supports Node 18 and newer;
frontend/.nvmrcpins the version CI builds against)
You can run the application and its dependencies using docker compose, or run the app natively using the setup instructions below.
Alternatively, you can run the app using the make commands available: make help
If you want to run the application on your own machine see the next sections on dependency installations.
Populate the necessary environment parameters:
cp backend/env-example backend/.env
cp frontend/env-example frontend/.envIn frontend/.env, PORT is the backend API port used by the Ember app and FRONTEND_PORT is the local frontend port.
Set FACEBOOK_APP_ID in frontend/.env if you want to use Facebook login locally.
Set up the database:
docker compose --profile tools run --rm app-setupThis command is interactive and resets the local Docker development and test databases. Type yes when prompted to continue.
Start the application:
docker compose --profile dev upVisit your app at http://localhost:4300.
Frontend dependency changes are handled automatically by Docker. For a full reset of all local Docker data, including databases and dependency volumes, run docker compose down -v, then run the database setup command again afterward.
If you are running on an M1 mac, run the following command before you start the installation process:
$env /usr/bin/arch -arm64 /bin/zsh ---loginRemove all gems before you proceed
gem uninstall -aIxYou can install the dependencies via asdf-vm declared in the .tool-versions file, or:
On macOS, you can install libpq by running brew install libpq && brew link --force libpq && bundle config --local build.pg "--with-ldflags=-L$(brew --prefix libpq)/lib --with-pg-include=$(brew --prefix libpq)/include", which is required for bundle install to succeed.
cd backend
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
bundle config set --local without 'production'
bundle config set --local jobs 5
bundle config set --local retry 10
bundle install
cp env-example .env # You may adjust it however you like
# RVM is going to autoload this on every 'cd' to the directory
bundle exec rake app:setup
gem install foremanThe Ember app needs Node 18 or newer. frontend/.nvmrc and frontend/.tool-versions pin the
version CI builds against, so if you use nvm or
asdf-vm you can let them pick it for you.
cd frontend
nvm install # or: asdf install — optional, any Node >= 18 works
cp env-example .env # FACEBOOK_APP_ID is only needed for Facebook login
npm install
npm run devVisit http://localhost:4300. npm run dev serves the app on its own; API
calls are proxied to the backend on port 3000, so start the backend too if you need data.
npm install also applies our patches and installs the remaining Bower packages via the
postinstall script — no extra commands, and no sudo/--unsafe-perm, including in containers
that run as root.
If npm install stops with EBADENGINE ... Required: {"node":">=18"}, you are on an older Node.
That check is deliberate (engine-strict=true in frontend/.npmrc) — switch versions rather than
bypassing it, since the build does not work on Node 16 or older.
cd native
npm install- Populate the necessary environment parameters with
cp backend/env-example backend/.env && cp frontend/env-example frontend/.env- The two files are read independently: the Rails app reads
backend/.env, and the Ember build readsfrontend/.env.
- The two files are read independently: the Rails app reads
- Create a Facebook dev app and paste your own ID into
frontend/.envfile'sFACEBOOK_APP_IDparameter.- Only needed for Facebook login; the rest of the app runs without it.
- Reset, migrate, load fixtures, and seed your database using
make seedorbundle exec rails app:setup
If you are running the application natively, run the following to start your server. If you're using docker, this should be up and running already.
rake runVisit your app at http://localhost:4300 for the current ember application, or http://localhost:19006 for the React Native version.
- Run
make buildordocker compose build backendto ensure the latest backend is built and being run - To run all tests run
make specsorscript/backend rspec spec spec, or you can run a specific test suite such asscript/backend rspec spec spec/services/weather_retriever_spec.rb - Debugging tip: in Ruby code you can add a line that says
debuggerand rspec will automatically break on that line and give you an interactive Ruby shell
Several checks are configured to run on all commits using GitHub 操作, including lint, build and test steps. Definitions can be found in ./.github/workflows. Those checks which always run are required to be successful for pull requests to be merged.
部署 target Heroku. The traditional deployment is manually configured and is composed of two distinct applications (frontend and api) in two environments (staging and production), with automatic deployments to staging of commits to master:
- flaredown-staging-api
- flaredown-staging-webapp (https://app.flaredown.com)
- flaredown-api
- flaredown-webapp (https://staging.flaredown.com) (Temporarily https://flaredown-staging-webapp.herokuapp.com/login due to #506)
Addons are used for Heroku Postgres, Heroku Redis, Heroku Scheduler + Papertrail. MongoDB is provided by mongodb.com.
- If you still hit a blank screen on first load, check that
frontend/.envexists (cp frontend/env-example frontend/.env).
Copyright 2015-2024 Logan Merriam and contributors.
Flaredown is open source software made available under the GPLv3 License. For details see the LICENSE file.