@@ -103,6 +103,36 @@ Create `functions/src/saasConfig.json`:
103
103
"secret_api_key" : " your_stripe_secret_key" ,
104
104
"end_point_secret" : " your_stripe_webhook_endpoint_secret"
105
105
},
106
+ "plans" : [
107
+ {
108
+ "id" : " free" ,
109
+ "titleKey" : " plans.free.title" ,
110
+ "popular" : false ,
111
+ "priceIds" : [" your-stripe-price-id" ],
112
+ "currency" : " $" ,
113
+ "price" : 0 ,
114
+ "frequency" : " month" ,
115
+ "descriptionKeys" : [
116
+ " plans.free.feature1" ,
117
+ " plans.free.feature2" ,
118
+ " plans.free.feature3"
119
+ ],
120
+ "free" : true ,
121
+ "legacy" : false
122
+ }
123
+ ],
124
+ "permissions" : {
125
+ "access" : {
126
+ "label" : " Access" ,
127
+ "default" : true ,
128
+ "admin" : false
129
+ },
130
+ "admin" : {
131
+ "label" : " Administrator" ,
132
+ "default" : false ,
133
+ "admin" : true
134
+ }
135
+ },
106
136
"emulators" : {
107
137
"enabled" : false ,
108
138
"useTestKeys" : false
@@ -166,6 +196,24 @@ service cloud.firestore {
166
196
}
167
197
```
168
198
199
+ ### 5. Update Tailwind
200
+
201
+ Update your ` tailwind.config.js ` to include the ` @fireact.dev/saas ` package.
202
+ ``` Javascript
203
+ /** @type {import('tailwindcss').Config} */
204
+ export default {
205
+ content: [
206
+ " ./src/**/*.{js,jsx,ts,tsx}" ,
207
+ " ./node_modules/@fireact.dev/core/dist/**/*.{js,mjs}" ,
208
+ " ./node_modules/@fireact.dev/saas/dist/**/*.{js,mjs}"
209
+ ],
210
+ theme: {
211
+ extend: {},
212
+ },
213
+ plugins: [],
214
+ }
215
+ ```
216
+
169
217
## Basic Application Setup
170
218
171
219
Update ` src/App.tsx ` :
@@ -431,6 +479,53 @@ export {
431
479
}
432
480
```
433
481
482
+ Update your ` functions/tsconfig.json ` to load the ` saasConfig.json `
483
+ ``` json
484
+ {
485
+ "compilerOptions" : {
486
+ "module" : " commonjs" ,
487
+ "noImplicitReturns" : true ,
488
+ "noUnusedLocals" : true ,
489
+ "outDir" : " lib" ,
490
+ "sourceMap" : true ,
491
+ "strict" : true ,
492
+ "target" : " es2017" ,
493
+ "resolveJsonModule" : true ,
494
+ "esModuleInterop" : true
495
+ },
496
+ "compileOnSave" : true ,
497
+ "include" : [
498
+ " src"
499
+ ]
500
+ }
501
+ ```
502
+
503
+ ## Deploy Web App
504
+
505
+ 1 . Build your web application
506
+ ``` bash
507
+ npm run build
508
+ ```
509
+
510
+ It is recommended updating your ` vite.config.ts ` to build bigger files to improve the performance.
511
+ ``` Typescript
512
+ import { defineConfig } from ' vite'
513
+ import react from ' @vitejs/plugin-react'
514
+
515
+ // https://vite.dev/config/
516
+ export default defineConfig ({
517
+ plugins: [react ()],
518
+ build: {
519
+ chunkSizeWarningLimit: 1000 , // Increased from default 500kb to 1000kb
520
+ },
521
+ })
522
+ ```
523
+
524
+ 2 . Deploy to Firebase:
525
+ ``` bash
526
+ firebase deploy --only hosting
527
+ ```
528
+
434
529
## Deploy Cloud Functions
435
530
436
531
1 . Build your functions:
0 commit comments