@@ -28,16 +28,18 @@ The application provides a quick and easy to use shopping experience with featur
2828
29291 . Create a new Firebase project in the [ Firebase Console] ( https://console.firebase.google.com ) .
30302 . Enable ** Email/Password Authentication** .
31- 3 . Add Firebase app secrets to ` .env.local ` .
32- 4 . Include Firebase app secrets in ** App Hosting ** .
31+ 3 . Replace the relevant commented-out environment variables in ` apphosting.yaml `
32+ with your firebase config .
3333
3434#### Firebase Data Connect
3535
36361 . Install the ** Firebase Data Connect** extension for VS Code.
37372 . Create a new Data Connect instance and service.
38383 . Set up billing for the Firebase project.
39394 . Switch to the Blaze plan.
40- 5 . Define the required schema, queries, and mutations.
40+ 5 . Modify ` dataconnect/dataconnect.yaml ` to specify ` serviceId ` , ` location ` ,
41+ ` schema.datasource.postgresql.database ` and
42+ ` schema.datasource.postgressql.cloudSql.instanceId `
41436 . Deploy the schema, queries, and mutations to production.
4244
4345#### Firebase Storage
@@ -48,13 +50,18 @@ The application provides a quick and easy to use shopping experience with featur
4850#### Firebase App Hosting
4951
50521 . Connect the Firebase app to your GitHub repository.
51- 2 . Create a new backend for the application.
52- 3 . Deploy secrets to app hosting using the Firebase CLI.
53- 4 . Deploy the application to Firebase Hosting.
53+ 2 . Create a new backend for the application, but do not deploy yet.
54+ We need to set up environment variables first for the app to work.
5455
5556### Stripe Setup
5657
57581 . Create a new Stripe account.
59+ 2 . Follow the instructions in apphosting.yaml to create the
60+ public and private keys for your stripe application.
61+ 3 . Create a webhook that listen to "Events on your account" at
62+ <your domain >/api/stripe/webhook that receives at least
63+ the following events: ` payment_intent.succeeded ` , ` payment_intent.failed ` ,
64+ ` charge.succeeded ` , ` charge.updated ` .
58652 . Add API keys (Publishable and Secret) to ` .env.local ` .
59663 . Set up a webhook endpoint in the Firebase project.
60674 . Add the webhook secret to ` .env.local ` .
@@ -63,12 +70,18 @@ The application provides a quick and easy to use shopping experience with featur
6370
6471## Environment Variables
6572
66- The following environment variables must be configured in ` .env.local ` :
73+ The following environment variables must be configured in ` apphosting.yaml `
74+ (there are comments for where to find these values)
6775
68- - ** Firebase Secrets ** : ` NEXT_PUBLIC_FIREBASE_API_KEY ` , ` NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN ` , ` NEXT_PUBLIC_FIREBASE_PROJECT_ID ` , ` NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET ` , ` NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID ` , ` NEXT_PUBLIC_FIREBASE_APP_ID ` .
69- - ** Stripe Secrets ** : ` NEXT_PUBLIC_STRIPE_PUB_KEY ` , ` STRIPE_SECRET_KEY ` , ` STRIPE_WEBHOOK_SECRET `
76+ - ** Firebase Config ** : ` NEXT_PUBLIC_FIREBASE_API_KEY ` , ` NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN ` , ` NEXT_PUBLIC_FIREBASE_PROJECT_ID ` , ` NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET ` , ` NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID ` , ` NEXT_PUBLIC_FIREBASE_APP_ID ` .
77+ - ** Stripe Config ** : ` NEXT_PUBLIC_STRIPE_PUB_KEY ` , ` STRIPE_SECRET_KEY ` , ` STRIPE_WEBHOOK_SECRET `
7078- ** Google/Gemini API Key** : ` GOOGLE_API_KEY `
7179
80+ ## Deploy
81+ Once you have set up Stripe, Data Connect, and configured your App Hosting environment, it's time to deploy!
82+ If you have automatic rollouts enabled, simply push your changes. Otherwise, after pushing, go to the
83+ Firebase console and click "Create Rollout".
84+
7285## Application Features
7386
7487### Homepage
@@ -148,18 +161,17 @@ To run this project locally, follow these steps:
148161 ```
149162 npm install
150163 ```
151- 4 . Copy the example environment variables:
152- ```
153- cp .env.example .env.local
154- ```
155- • Fill in the required values (Firebase config, Stripe keys, Google API key, etc.).
156- 5 . Start the development server:
164+ 4 . Fill in ` apphosting.yaml ` as guided by the comments.
165+ 5 . Initialize the firebase emulator suite with ` firebase init emulators ` . You may
166+ create an ` apphosting.emulator.yaml ` if you choose to use different configurations
167+ during local development or you can test against your production config.
168+ 5 . Start the emulator
157169 ```
158- npm run dev
170+ firebase emulators:start
159171 ```
1601726 . Open the application in your browser at:
161173 ```
162- http://localhost:3000
174+ http://localhost:5002
163175 ```
164176
165177---
0 commit comments