This is a brief guide to get you started with running the application locally.
Before you begin, ensure you have the following installed on your machine:
- docker
-
Clone the repository to your local machine:
git clone git@github.com:Natisk/stripe_subscriptions.git
-
cd stripe_subscriptions -
Run
docker compose build -
Create stripe account on stripe.com.
-
Go to dashboard -> Developers -> API keys
-
In the application root folder create
.envfile according to.env.example -
Add API key to
.envfile -
Run
docker compose run --rm stripe
-
Stripe CLI will provide you a link for authentication.
-
Follow the link and confirm authentication on stripe web site.
-
Run again
docker compose run --rm stripe
-
Now Stripe CLI will give you webhook secret, paste it to
.env -
Stop that container and Run
docker compose up
-
Now you can create Subscriptions on Stripe web interface or open new terminal tab and run
docker compose run --rm stripe trigger customer.subscription.created
or
docker compose run --rm stripe trigger customer.subscription.deleted
-
Visit localhost:3000 to see newly created subscription