Skip to content

Commit dba740d

Browse files
committed
updated get started for the saas package
1 parent 4ee0c14 commit dba740d

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

content/saas/getting-started/_index.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,36 @@ Create `functions/src/saasConfig.json`:
103103
"secret_api_key": "your_stripe_secret_key",
104104
"end_point_secret": "your_stripe_webhook_endpoint_secret"
105105
},
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+
},
106136
"emulators": {
107137
"enabled": false,
108138
"useTestKeys": false
@@ -166,6 +196,24 @@ service cloud.firestore {
166196
}
167197
```
168198

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+
169217
## Basic Application Setup
170218

171219
Update `src/App.tsx`:
@@ -431,6 +479,53 @@ export {
431479
}
432480
```
433481

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+
434529
## Deploy Cloud Functions
435530

436531
1. Build your functions:

0 commit comments

Comments
 (0)