We built Noori after working on multiple startups, where we had to rewrite the same code each time. We thought there should be an easier solution. After looking around we realized no one was building it..so we build it!
stripe_to_postgres
is packaged as a Docker image you can run directly.
The image needs the following environment variables.
DATABASE_URL
is your Postgres instance's connection string.STRIPE_SECRET_KEY
can be obtained from the Stripe dashboard https://dashboard.stripe.com/apikeys.WEBHOOK_URL
is your https enabled endpoint where this image is deployed.
Example:
- Put the env vars in a .env file then run
docker run --env-file=.env usenoori/stripe_to_postgres
By default, most database tools only look up database objects in the public
schema, you might need to update
the search_path
in your existing tooling to include the stripe
schema we created for you.
stripe_to_postgres
will first create astripe
schema then create all the necessary table structures in your database.- Then it will call Stripe and page through your Stripe data to stores them in your database.
- After the data sync is done a Stripe webhook will be created that keep your database up to date.
These are the Stripe resources that are currently handled by us.
- events
- products
- prices
- customers
- subscriptions
- invoices
- charges
- coupons
- disputes
- plans
At the moment we support Postgres from version 10, as the features evolve this support target could move towards Postgres 12.
- Start local Postgres instance:
docker compose up
- Run
stripe listen --forward-to localhost:3000
and add the output secret asSTRIPE_WEBHOOK_SECRET
env var - Start development server
npm run dev
Questions? Comments? Email us at hello@usenoori.com