Sign inSign up

texastribune/donations

By texastribune

Updated over 3 years ago

Image
0

7.8K

texastribune/donations repository overview

Donations

Software to collect donations for nonprofits. It integrates with Saleforce, Stripe, Amazon Pay, Slack and Sentry.

  • Python running Flask
  • supports single and recurring donations
  • easily deployed on Heroku

Getting Started

The recommended method for running this repo locally is to use Docker. If you don't already have Docker set up, you'll want to install Docker for Mac to get a Docker environment set up on your computer.

You'll also need to have an env file set up with the environment variables for Stripe and Salesforce so that Docker can find them. By default the Makefile will look for env-docker but this can be overridden with the DOCKER_ENV_FILE environment variable.

You should also install pre-commit, which we use for managing Git hooks (including JS formatting via Prettier). Once downloaded, run pre-commit install at the root of this repo. You'll also need Node version 12.

Requirements

Python 3.6+ See requirements.txt and dev-requirements.txt for specific Python packages and versions.

Environment

VariableExample
FLASK_SECRET_KEYb'f;\xeb\x9bT2\xcd\xdb\xe1#z\xfb\xab\xf8(\x03'
PUBLISHABLE_KEYpk_test_12345
SECRET_KEYsk_test_12335
LOG_LEVELDEBUG
AUTH0_PORTAL_M2M_CLIENT_IDstring
AUTH0_PORTAL_M2M_CLIENT_SECRETstring
AUTH0_DOMAINdomain.com
AUTH0_PORTAL_AUDIENCEfoobarbaz
AUTH0_PORTAL_CLIENT_IDstringstringstring
ENABLE_PORTALTrue
PORTAL_API_DOMAINhttps://foo.bar/api
PORTAL_CAMPAIGN_IDstringstringstring
SALESFORCE_HOSTtest.salesforce.com
SALESFORCE_CLIENT_ID
SALESFORCE_CLIENT_SECRET
SALESFORCE_USERNAME
SALESFORCE_PASSWORD
SALESFORCE_TOKEN
SALESFORCE_API_VERSIONv43.0
CELERY_BROKER_URLamqp://guest:guest@rabbitmq:5672/
CELERY_RESULT_BACKENDredis://redis:6379/0
CELERY_ALWAYS_EAGERFalse
CELERY_TASK_SERIALIZERjson
ENABLE_SENTRYTrue
ENABLE_SENTRY_RELEASETrue
SENTRY_ENVIRONMENTtest
SENTRY_DSNhttps://user:pass@sentry/7?timeout=10
SENTRY_AUTH_TOKEN
SENTRY_ORGyour-org
SENTRY_PROJECTdonations
ENABLE_SLACKFalse
SLACK_API_KEY
SLACK_CHANNEL#donations
DEFAULT_MAIL_SENDER[email protected]
MAIL_SERVERmail.server.com
MAIL_USERNAME
MAIL_PASSWORD
MAIL_PORT25
MAIL_USE_TLSTrue
ACCOUNTING_MAIL_RECIPIENT[email protected]
BUSINESS_MEMBER_RECIPIENT[email protected]
CIRCLE_FAILURE_RECIPIENT[email protected]
REDIS_URLredis://redis:6379
REPORT_URIhttps://foo.bar
RECAPTCHA_SECRET_KEYstringstringstring
RECAPTCHA_SITE_KEYstringstringstring
BAD_ACTOR_API_URLhttps://foo.bar.api
BAD_ACTOR_NOTIFICATION_URLhttps://foo.bar.api

Running the Project

Run make backing. This will start RabbitMQ and Redis. Run make. This will drop you into the Flask app. Run make restart. You can interact with the app at localhost:80. This command will also build CSS and JS in watch mode and allow you to make test transactions.

C_FORCE_ROOT=True celery -A app.celery worker --loglevel=INFO &
celery beat --app app.celery &
# gunicorn app:app --log-file=- --bind=0.0.0.0:5000 --access-logfile=-

NOTE: If you are a Tribune engineer, you may need to use local.texastribune.org/donate in order to sign in to your account or otherwise interact with the account page.

Running tests

To run the project tests, run make test

Security

If you find vulnerabilities in this repo please report them to [email protected].

Tag summary

Content type

Image

Digest

sha256:fbcc866dc

Size

614.7 MB

Last updated

over 3 years ago

docker pull texastribune/donations