Skip to content

Commit 14de60a

Browse files
committed
Update README
1 parent baffb61 commit 14de60a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ npx tsx ./other/stripe/create-stripe-plans.ts
4747
4848
- Run dev server (`npm run dev`) and go to `/account` page.
4949

50+
## Decisions and the reasoning behind application architecture
51+
52+
- This example implements a common SaaS subscription use case with monthly and
53+
yearly #. Each subscription variant can optionally be configured with a
54+
limit on number of units user can consume.
55+
- User subscription state is stored in the application db, so as not to fetch
56+
from Stripe when needed. The state will be kept in sync with Stripe using a
57+
webhook. See this
58+
[article](https://dev.to/stripe/enable-your-saas-users-to-access-paid-features-with-webhooks-4n8f)
59+
for details.
60+
61+
- There are endpoints under `/services/stripe/api` and
62+
`/resources/stripe/create-*` within the application to manage Stripe calls.
63+
Communication with Stripe end point is managed by stacking redirects, if you
64+
need clean browser history, these endpoints can be converted to stacked
65+
asynchronous calls but in that case youy need to handle edge cases like when
66+
user cancels the page load while waiting for stacked async calls.
67+
5068
## Further docs
5169

5270
- [Stripe-stack](https://github.com/dev-xo/stripe-stack)

0 commit comments

Comments
 (0)