Skip to content

Guest Preview Generation Flow with One-Time Free Access & Improved Onboarding UX#225

Open
PranshuPujara wants to merge 1 commit into
SATYAM-PRATIBHAN:mainfrom
PranshuPujara:issue#148
Open

Guest Preview Generation Flow with One-Time Free Access & Improved Onboarding UX#225
PranshuPujara wants to merge 1 commit into
SATYAM-PRATIBHAN:mainfrom
PranshuPujara:issue#148

Conversation

@PranshuPujara
Copy link
Copy Markdown
Contributor

Description

Closes #148

Implemented a Guest Preview Generation flow that allows anonymous users to try the platform once before signing in, creating a smoother onboarding experience while keeping the existing authenticated workflow unchanged.

The implementation mainly focuses on frontend UX improvements with lightweight guest tracking and minimal backend adjustments.


What Changed

Frontend — Guest UI

app/(protected)/generate/components/GeneratePage.tsx

  • Added guest generation gating logic
  • Added local guest usage tracking using localStorage/cookies
  • Added isGuestLocked state handling
  • Integrated GuestSignupPrompt modal flow
  • Updated handleGenerate flow to:
    • Parse backend output
    • Update generated data
    • Increment and persist guest usage
  • Added locked-state UI and guest CTAs after free usage
  • Disabled Generate button once guest limit is reached
  • Improved loading/streaming UX for a cleaner experience

app/(protected)/generate/components/GuestSignupPrompt.tsx (New)

  • Added reusable signup/login modal for guest users
  • Highlights benefits like:
    • Save to History
    • Access previous generations
    • Continue generating

app/(protected)/generate/components/index.ts

  • Exported the new GuestSignupPrompt component

Frontend — Hooks & Layout Updates

app/(protected)/generate/hooks/useGenerateSystem.ts

  • Removed strict client-side auth requirement for generation
  • Guests can now access the generation API
  • History refetch only runs for authenticated users

app/(protected)/generate/layout.tsx

app/(protected)/layout.tsx

  • Updated protected layouts to allow guest access specifically for:
/generate
  • Other protected routes still require authentication

Backend — API Updates

app/api/generate/route.ts

Added guest-aware generation support:

  • Detects guest/authenticated users from server session

  • Guests:

    • Skip DB writes
    • Skip user metrics updates
    • Skip authenticated rate-limit logic
  • Authenticated users retain existing behavior

  • Preserved:

    • AI streaming
    • SSE streaming
    • JSON + Mermaid parsing
  • Added support for:

userApiKeys.geminiApiKey || undefined

so guest requests can still use the system key when available.


Sanity Checks Performed

  1. Confirmed there is no mock/test-only guest flow implementation
  2. Confirmed no hardcoded dummy API keys were introduced
  3. Verified authenticated workflow still behaves normally
  4. Verified guest users can generate successfully without login
  5. Verified locked-state UI appears correctly after guest limit usage

Notes

  • No existing authenticated workflow was broken
  • Guest flow remains lightweight and maintainable
  • No unnecessary backend complexity introduced
  • Implementation is modular and easy to extend later

Demo

Trying to make second generation

Screenshot 2026-05-25 at 1 35 32 PM

Pop up by clicking "View benefits"

Screenshot 2026-05-25 at 1 35 47 PM

By clicking "Create New Account"

Screenshot 2026-05-25 at 1 37 12 PM

Thank you!
Pranshu Pujara🕵️‍♂️

- Add guest UI: one free generation limit, GuestSignupPrompt modal, and lock UI.
- Allow guest access to top-level /generate while protecting deeper routes.
- Update client hook to permit guest generation calls and avoid refetching history for anonymous users.
- Update server `/api/generate` to accept guest requests, guard DB writes, and only apply user-specific rate-limits/metrics to authenticated users.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

👷 Deploy request for arcmind-ai pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 824adaf

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.

[UI] Implement 'Try as Guest' Mode

1 participant