Skip to content

Updates for cloud - #3

Open
rileysdev wants to merge 2 commits into
cloudfrom
riley/cloud
Open

Updates for cloud#3
rileysdev wants to merge 2 commits into
cloudfrom
riley/cloud

Conversation

@rileysdev

Copy link
Copy Markdown
Contributor
  • setup firebase hosting
  • Allow frontend to build

@rileysdev
rileysdev requested review from benh and Copilot August 13, 2025 01:55
@rileysdev rileysdev self-assigned this Aug 13, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread web/src/ChatMessage.tsx
return left[0].localeCompare(right[0]);
})
.map(([reaction, { users }]) => (
.map(([reaction, { users }]: any) => (

Copilot AI Aug 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
.map(([reaction, { users }]: any) => (
.map(([reaction, { users }]) => (

Copilot uses AI. Check for mistakes.
const username = localStorage.getItem("username");

if (username === null) {
throw new Error("Username not found in localStorage");

Copilot AI Aug 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
throw new Error("Username not found in localStorage");
// Redirect to login page if username is not found
return <Navigate to="/login" replace />;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants