GithubHelp home page GithubHelp logo

isabella232 / stripeboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zapier/stripeboard

0.0 0.0 0.0 350 KB

A simple Django app that collects and displays Stripe data.

Home Page: https://board.zapier.com/

License: MIT License

JavaScript 93.48% Python 6.52%

stripeboard's Introduction

A simple Stripe Dashboard

Stripe is awesome. Metrics are awesome. So let's do this!

Try it.

Go check out a live, working version with OAuth at http://board.zapier.com/. Your data is in cache and sticks around for 24 hours, then you'll need to refresh it (we do not refresh it for you automatically).

A sample dashboard for illustration.

some made up numbers for example!

Heads up!

Trying to distill this information from Stripe's API is actually a bit tricky since we don't have a history of logged events (and downloading your entire Stripe DB via their API is not cool). So, we do our best to approximate it with a mixture of current customer snapshots, subscription update and deleted events. If you have a clever way to do this better, we want to see it added!

Run it.

Well, first you need a Stripe application. You can read about that at https://stripe.com/docs/apps/oauth.

Heroku

Heroku makes this easy if you follow the docs found at https://devcenter.heroku.com/articles/django. Below are some of the fancier things you'll need to do first to get it running...

You'll need the Redis To Go addon in Heroku:

# free version
heroku addons:add redistogo:nano

Here are some extra commands:

# your s3 config information
heroku config:add AWS_ACCESS_KEY_ID=xxx
heroku config:add AWS_SECRET_ACCESS_KEY=xxx
heroku config:add AWS_STORAGE_BUCKET_NAME=xxx
# a random secret key for django
heroku config:add SECRET_KEY=xxx
# the application's id "ca_*"
heroku config:add STRIPE_CLIENT_ID=xxx
# the account api key "*"
heroku config:add STRIPE_CLIENT_SECRET=xxx

And don't forget to scale out at least one worker:

# will cost you money...
heroku ps:scale celeryd=1

Local

Be sure to pip install -r requirements.txt and have Redis running locally.

Create a settings_local.py file like so:

DEBUG = True
TEMPLATE_DEBUG = DEBUG

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'stripeboard.sqlite',
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

BROKER_URL = 'redis://localhost:6379/0'

CACHES = {
    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': 'localhost:6379',
        'OPTIONS': {
            'DB': 0,
            'PARSER_CLASS': 'redis.connection.HiredisParser'
        },
    }
}

SECRET_KEY = 'FILLMEIN!'

MEDIA_URL = '/media/'
STATIC_URL = '/static/'

STRIPE_TEST_API_KEY = 'ONLYFORTESTS...'

STRIPE_CLIENT_ID = 'ASTRING' # the application's id "ca_*"
STRIPE_CLIENT_SECRET = 'ASTRING' # the account api key "*"

And run foreman start after doing all the standard python manage.py syncdb stuff.

stripeboard's People

Contributors

bryanhelmig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.