Updates for cloud - #3
Conversation
rileysdev
commented
Aug 13, 2025
- setup firebase hosting
- Allow frontend to build
There was a problem hiding this comment.
Pull Request Overview
This PR sets up Firebase hosting for the frontend and enables the application to build properly by fixing TypeScript compilation issues and adding environment variable support for different deployment environments.
- Configures Firebase hosting with appropriate rewrite rules for SPA routing
- Makes the backend endpoint URL configurable via environment variables with localhost fallback
- Fixes TypeScript compilation errors by adding type annotations and error handling
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/main.tsx | Adds environment variable support for backend endpoint URL |
| web/src/ReactionWindow.tsx | Adds null check for username from localStorage |
| web/src/ChatMessage.tsx | Fixes TypeScript error with explicit any type annotation |
| web/src/App.tsx | Fixes component formatting and adds missing timestamp prop |
| web/firebase.json | Configures Firebase hosting settings and SPA routing |
| web/.firebaserc | Sets default Firebase project |
| web/.firebase/hosting.ZGlzdA.cache | Generated Firebase hosting cache file |
| web/.env.production | Sets production backend endpoint URL |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| return left[0].localeCompare(right[0]); | ||
| }) | ||
| .map(([reaction, { users }]) => ( | ||
| .map(([reaction, { users }]: any) => ( |
There was a problem hiding this comment.
Using 'any' type defeats TypeScript's type safety. Consider defining a proper interface for the reactions object structure, such as 'Record<string, { users: Record<string, any> }>' or a more specific type based on the actual data structure.
| .map(([reaction, { users }]: any) => ( | |
| .map(([reaction, { users }]) => ( |
| const username = localStorage.getItem("username"); | ||
|
|
||
| if (username === null) { | ||
| throw new Error("Username not found in localStorage"); |
There was a problem hiding this comment.
The error message should be more descriptive and user-friendly. Consider providing context about what the user should do, such as 'User session expired. Please log in again.' or redirect to login instead of throwing an error.
| throw new Error("Username not found in localStorage"); | |
| // Redirect to login page if username is not found | |
| return <Navigate to="/login" replace />; |