Skip to content

Commit 72b3939

Browse files
authored
feat: Overhaul Stripe implementation to provide billing support (#833)
1 parent 6776496 commit 72b3939

100 files changed

Lines changed: 3607 additions & 604 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/extract-stripe-to-plugin-payments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
'@baseplate-dev/project-builder-common': patch
88
---
99

10-
Extract Stripe into standalone `@baseplate-dev/plugin-payments` package. Stripe is now managed through the plugin system instead of the `enableStripe` boolean on backend app config. Includes migration to automatically convert existing projects.
10+
Extract Stripe into standalone `@baseplate-dev/plugin-payments` package. Stripe is now managed through the plugin system instead of the `enableStripe` boolean on backend app config. Includes migration to automatically convert existing projects. Overhaul Stripe implementation to provide billing support.

.oxfmtrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"**/tmp/**",
3131
"pnpm-lock.yaml",
3232
"**/route-tree.gen.ts",
33-
"**/examples/**",
33+
"examples/**",
3434
".changeset/**",
3535
".pnpm-store/**",
3636
".turbo/**",

examples/todo-with-better-auth/apps/admin/.paths-metadata.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
"canonicalPath": "@/src/routes/admin/accounts/users/user",
3232
"pathRootName": "routes-root"
3333
},
34+
{
35+
"canonicalPath": "@/src/routes/billing",
36+
"pathRootName": "routes-root"
37+
},
3438
{
3539
"canonicalPath": "@/src/routes/todos",
3640
"pathRootName": "routes-root"

examples/todo-with-better-auth/apps/admin/baseplate/generated/.paths-metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"canonicalPath": "@/src/routes/admin/accounts/users/user",
2323
"pathRootName": "routes-root"
2424
},
25+
{ "canonicalPath": "@/src/routes/billing", "pathRootName": "routes-root" },
2526
{ "canonicalPath": "@/src/routes/todos", "pathRootName": "routes-root" },
2627
{ "canonicalPath": "@/src/routes/storage", "pathRootName": "routes-root" },
2728
{ "canonicalPath": "@/src/routes/accounts", "pathRootName": "routes-root" },

examples/todo-with-better-auth/apps/admin/baseplate/generated/src/hooks/use-session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { authClient } from '../services/auth-client';
44

55
export const AUTH_ROLES = /* TPL_AUTH_ROLES:START */ [
66
'admin',
7+
'pro-user',
78
'public',
89
'system',
910
'user',

examples/todo-with-better-auth/apps/admin/src/hooks/use-session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { authClient } from '../services/auth-client';
44

55
export const AUTH_ROLES = /* TPL_AUTH_ROLES:START */ [
66
'admin',
7+
'pro-user',
78
'public',
89
'system',
910
'user',

examples/todo-with-better-auth/apps/backend/.paths-metadata.json

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
11
[
2-
{ "canonicalPath": "@", "pathRootName": "package-root" },
3-
{ "canonicalPath": "@/src", "pathRootName": "src-root" },
4-
{ "canonicalPath": "@/src/modules", "pathRootName": "module-root" },
5-
{ "canonicalPath": "@/src/modules/graphql", "pathRootName": "module-root" },
6-
{ "canonicalPath": "@/src/modules/todos", "pathRootName": "module-root" },
7-
{ "canonicalPath": "@/src/modules/storage", "pathRootName": "module-root" },
8-
{ "canonicalPath": "@/src/modules/accounts", "pathRootName": "module-root" },
2+
{
3+
"canonicalPath": "@",
4+
"pathRootName": "package-root"
5+
},
6+
{
7+
"canonicalPath": "@/src",
8+
"pathRootName": "src-root"
9+
},
10+
{
11+
"canonicalPath": "@/src/modules",
12+
"pathRootName": "module-root"
13+
},
14+
{
15+
"canonicalPath": "@/src/modules/graphql",
16+
"pathRootName": "module-root"
17+
},
18+
{
19+
"canonicalPath": "@/src/modules/billing",
20+
"pathRootName": "module-root"
21+
},
22+
{
23+
"canonicalPath": "@/src/modules/todos",
24+
"pathRootName": "module-root"
25+
},
26+
{
27+
"canonicalPath": "@/src/modules/storage",
28+
"pathRootName": "module-root"
29+
},
30+
{
31+
"canonicalPath": "@/src/modules/accounts",
32+
"pathRootName": "module-root"
33+
},
934
{
1035
"canonicalPath": "@/src/modules/accounts/users",
1136
"pathRootName": "module-root"

examples/todo-with-better-auth/apps/backend/baseplate/file-id-map.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@baseplate-dev/fastify-generators#core/app-module:module-feature:d2gEAaWMHAeL": "src/modules/storage/index.ts",
2121
"@baseplate-dev/fastify-generators#core/app-module:module-feature:NAlTJq_VdqWk": "src/modules/accounts/auth/index.ts",
2222
"@baseplate-dev/fastify-generators#core/app-module:module-feature:oULnLSaFWNwh": "src/modules/accounts/index.ts",
23+
"@baseplate-dev/fastify-generators#core/app-module:module-feature:QL2I7hoOmjBW": "src/modules/billing/index.ts",
2324
"@baseplate-dev/fastify-generators#core/app-module:module-feature:uLSMKuAlLWix": "src/modules/accounts/users/index.ts",
2425
"@baseplate-dev/fastify-generators#core/app-module:module-graphql": "src/modules/graphql/index.ts",
2526
"@baseplate-dev/fastify-generators#core/app-module:module-root": "src/modules/index.ts",
@@ -54,6 +55,7 @@
5455
"@baseplate-dev/fastify-generators#pothos/pothos-auth:field-authorize-plugin": "src/plugins/graphql/FieldAuthorizePlugin/index.ts",
5556
"@baseplate-dev/fastify-generators#pothos/pothos-auth:field-authorize-types": "src/plugins/graphql/FieldAuthorizePlugin/types.ts",
5657
"@baseplate-dev/fastify-generators#pothos/pothos-enums-file:feature:5yQn3gjSzKEB-enums": "src/modules/todos/schema/enums.ts",
58+
"@baseplate-dev/fastify-generators#pothos/pothos-enums-file:feature:QL2I7hoOmjBW-enums": "src/modules/billing/schema/enums.ts",
5759
"@baseplate-dev/fastify-generators#pothos/pothos-prisma:pothos-prisma-types": "src/generated/prisma/pothos-prisma-types.ts",
5860
"@baseplate-dev/fastify-generators#pothos/pothos-scalar:date": "src/modules/graphql/scalars/date.ts",
5961
"@baseplate-dev/fastify-generators#pothos/pothos-scalar:date-time": "src/modules/graphql/scalars/date-time.ts",
@@ -121,10 +123,11 @@
121123
"@baseplate-dev/plugin-observability#core/fastify-sentry:instrument": "src/instrument.ts",
122124
"@baseplate-dev/plugin-observability#core/fastify-sentry:sentry": "src/services/sentry.ts",
123125
"@baseplate-dev/plugin-observability#pothos/pothos-sentry:use-sentry": "src/plugins/graphql/use-sentry.ts",
124-
"@baseplate-dev/plugin-payments#stripe/fastify-stripe:plugins-webhook": "src/plugins/stripe-webhook.ts",
125-
"@baseplate-dev/plugin-payments#stripe/fastify-stripe:plugins-webhook-test": "src/plugins/stripe-webhook.int.test.ts",
126+
"@baseplate-dev/plugin-payments#stripe/billing-module:billing-config": "src/modules/billing/services/billing-config.ts",
127+
"@baseplate-dev/plugin-payments#stripe/billing-module:billing-service": "src/modules/billing/services/billing.service.ts",
128+
"@baseplate-dev/plugin-payments#stripe/billing-webhook:plugins-webhook": "src/plugins/stripe-webhook.ts",
129+
"@baseplate-dev/plugin-payments#stripe/billing-webhook:service-event-handlers": "src/services/stripe-event-handlers.ts",
126130
"@baseplate-dev/plugin-payments#stripe/fastify-stripe:service": "src/services/stripe.ts",
127-
"@baseplate-dev/plugin-payments#stripe/fastify-stripe:service-events": "src/services/stripe-events.ts",
128131
"@baseplate-dev/plugin-queue#bullmq/core/bullmq:bullmq-plugin": "src/plugins/bullmq.plugin.ts",
129132
"@baseplate-dev/plugin-queue#bullmq/core/bullmq:bullmq-service": "src/services/bullmq.service.ts",
130133
"@baseplate-dev/plugin-queue#bullmq/core/bullmq:run-workers": "src/scripts/run-workers.ts",

examples/todo-with-better-auth/apps/backend/baseplate/generated/.paths-metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{ "canonicalPath": "@/src", "pathRootName": "src-root" },
44
{ "canonicalPath": "@/src/modules", "pathRootName": "module-root" },
55
{ "canonicalPath": "@/src/modules/graphql", "pathRootName": "module-root" },
6+
{ "canonicalPath": "@/src/modules/billing", "pathRootName": "module-root" },
67
{ "canonicalPath": "@/src/modules/todos", "pathRootName": "module-root" },
78
{ "canonicalPath": "@/src/modules/storage", "pathRootName": "module-root" },
89
{ "canonicalPath": "@/src/modules/accounts", "pathRootName": "module-root" },

examples/todo-with-better-auth/apps/backend/baseplate/generated/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"mime-types": "2.1.35",
6868
"nanoid": "5.1.6",
6969
"pino": "9.5.0",
70-
"stripe": "14.5.0",
70+
"stripe": "20.4.1",
7171
"zod": "4.3.6"
7272
},
7373
"devDependencies": {

0 commit comments

Comments
 (0)