Firebase
Create a file src/firebase.ts to initialize your connection:
;
;
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT.firebaseapp.com",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_PROJECT.appspot.com",
messagingSenderId: "...",
appId: "..."
};
;
;In src/App.tsx, we will fetch the list of pets from Firestore and display them.
;
;
;
;
;
;
petList;
};
;
},);
return
))}
</ul>
</div>
);
}
;Run the development server:
Better UI
-
config tailwind
@src/App.tsxand add functionality to add new pets@src/App.tsxadd loading indicator when fetching pets
Configure Cloudflare Worker (SPA Mode)
Create your wrangler.toml in the project root.
We use the not_found_handling setting to ensure the React Router (if you add one later) or hard refreshes don’t break.
= "firebase"
= "2026-03-16"
[]
= "dist"
= "single-page-application"Build your React app:
Deploy to Cloudflare:
Auth
add auth
sign in with google doesn’t work
add firebase mcp