Commit 14de60a 1 parent baffb61 commit 14de60a Copy full SHA for 14de60a
File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,24 @@ npx tsx ./other/stripe/create-stripe-plans.ts
47
47
48
48
- Run dev server (` npm run dev ` ) and go to ` /account ` page.
49
49
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
+
50
68
## Further docs
51
69
52
70
- [ Stripe-stack] ( https://github.com/dev-xo/stripe-stack )
You can’t perform that action at this time.
0 commit comments