Skip to content

Fix/blank screen on missing config#1

Open
taksh-nahata wants to merge 20 commits into
mainfrom
fix/blank-screen-on-missing-config
Open

Fix/blank screen on missing config#1
taksh-nahata wants to merge 20 commits into
mainfrom
fix/blank-screen-on-missing-config

Conversation

@taksh-nahata
Copy link
Copy Markdown
Owner

No description provided.

google-labs-jules Bot and others added 13 commits May 22, 2025 22:48
The application was showing a blank screen if the Supabase
environment variables (VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY)
were not set.

This commit introduces the following changes:
1. Modifies `src/lib/supabase.ts` to:
    - Log an error to the console if Supabase env vars are missing,
      instead of throwing an error that halts script execution.
    - Export `isSupabaseConfigured` (boolean) to indicate if Supabase
      is properly configured.
    - Export `supabase` as `null` if not configured.

2. Modifies `src/App.tsx` to:
    - Check `isSupabaseConfigured` on startup.
    - Display a user-friendly full-page error message if Supabase is
      not configured, guiding you to check your .env file or
      environment settings.

3. Modifies `src/contexts/AuthContext.tsx` to:
    - Check `isSupabaseConfigured` before attempting to use the
      `supabase` client.
    - Prevent calls to Supabase methods (e.g., `signUp`, `signIn`,
      `signOut`, `onAuthStateChange`) if Supabase is not configured.
    - Log console warnings/errors if auth functions are called without
      a configured Supabase client.

These changes ensure the application remains partially functional (by displaying an error page) and provides clear feedback to you or the developer when critical configuration is missing, rather than failing silently with a blank screen.
This commit encompasses a major refactor including migration from Vite/React to Next.js and a UI/UX overhaul for public and authentication pages.

**Phase 1: Next.js Migration & Initial Setup**

- **Project Initialization:** I set up Next.js with App Router and configured Tailwind CSS.
- **Supabase Integration:**
    - I configured Supabase for Next.js (client, server, middleware).
    - I updated .env.local with new Supabase credentials.
- **Core Component Migration:**
    - I migrated Home, Login, SignUp, Dashboard pages and Navbar component.
    - I replaced react-router-dom with Next.js file-system routing and Link components.
- **Authentication:**
    - I migrated AuthContext to Next.js, using new Supabase client utilities.
    - I ensured basic sign-up, sign-in, and sign-out functionality.
- **Original Issue Fix:** I addressed the blank screen issue from missing Supabase config in the old Vite setup by making error handling more robust (now superseded by Next.js patterns).

**Phase 2: UI/UX Overhaul (Home, Sign Up, Login Pages)**

- **Global Styling System (Tailwind CSS):**
    - I defined a new color palette (primary blue, secondary rose, neutrals).
    - I implemented a system font stack for `font-sans`.
    - I created base styles for `.btn-primary`, `.btn-secondary`, `.btn-accent`, `.card`, `.card-content`, and `.input` in `globals.css` for consistency.
- **Home Page (`app/page.tsx`):**
    - I refactored layout, updated background, improved spacing and typography.
    - I applied new global styles for cards, buttons, and text.
    - I enhanced animations with `framer-motion` (staggered card entry, refined hover effects).
- **Sign Up Page (`app/signup/page.tsx`):**
    - I aligned with global styles for a consistent look and feel.
    - I improved form layout, spacing, and error message styling (including icon).
    - I added micro-interactions: form card entry animation, button loading spinner.
    - I verified responsiveness.
- **Login Page (`app/login/page.tsx`):**
    - I mirrored Sign Up page improvements for consistency.
    - I applied global styles, refined layout, error messages, and added Sign Up link.
    - I added micro-interactions: form card entry animation, button loading spinner.
    - I verified responsiveness.

The application foundation is now on Next.js, and the initial public-facing and authentication pages (Home, Sign Up, Login) have a significantly improved, modern, and consistent UI/UX.
@taksh-nahata taksh-nahata force-pushed the fix/blank-screen-on-missing-config branch from 975f1a3 to efb5fe2 Compare May 26, 2025 19:24
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.

1 participant