KasyKasy

Publish to the Web

Production build, Firebase Hosting, Vercel, a custom domain, and PWA.

Implementation

Via MCP: for web Auth with a custom domain, ask "list authorized domains" or "add app.yourbrand.com to the domains" (manage_domain). Favicon: set_favicon. Static build/hosting is still via the terminal (below). See Kasy MCP.

  1. Generate the production build:

    flutter build web --release --dart-define=ENV=prod

    The finished site lands in the build/web folder. It's a static site: any hosting works.

    --dart-define=ENV=prod is required. Without it the build uses the development config.

  2. Choose your hosting:

    Option 1: Firebase Hosting (Firebase backend)

    If your backend is Firebase, the project already comes configured: firebase.json points at build/web, with the right SPA rewrites and cache headers. Publishing is just:

    flutter build web --release --dart-define=ENV=prod
    firebase deploy --only hosting

    At the end, the terminal shows the URL (https://your-project.web.app).

    For a custom domain:

    1. Firebase ConsoleHostingAdd custom domain
    2. Type in the domain (e.g., app.yourbrand.com)
    3. Create the DNS records the console shows you (at your domain provider)
    4. Wait for verification: the HTTPS certificate is automatic

    Option 2: Vercel (any backend)

    Works with Firebase, Supabase, or REST API, since the build is static.

    1. Create an account at vercel.com
    2. Run the production build (command above)
    3. Publish the folder:
    npm i -g vercel
    cd build/web
    vercel --prod

    Custom domain: Vercel dashboard → your project → Settings → Domains.

    Netlify, Cloudflare Pages, or any static host also work: the process is the same, build and upload the build/web folder.

  3. After publishing, unlock login:

    Google Sign-In

    Add the production domain and http://localhost:5555 as authorized origins: Google Cloud Console → Credentials → your OAuth Client → Authorized JavaScript origins.

    Firebase Auth (authorized domains)

    Firebase Console → Authentication → SettingsAuthorized domains → add the production domain. Without this, social login fails with auth/unauthorized-domain.

    Supabase Auth (authorized domains)

    Supabase Dashboard → Authentication → URL Configuration → add the production domain (and http://localhost:5555 while testing locally) under Site URL / Redirect URLs. Without this, social login redirects to the wrong domain or fails silently. Automated deploy only sets localhost:5555 in uri_allow_list.

Information

Development

kasy run --web                              # prints localhost:5555
kasy run --web --open-browser               # opens in your browser (Google account, extensions)
kasy run --web --open-browser --fresh       # same browser, clears dev storage (onboarding)
kasy clear-web                              # clear storage only (app already running)
kasy run --web --open                       # Flutter's isolated Chrome (clean profile, no account)
CommandWhere it opens
--open-browserSystem default browser, in the profile where you're already logged in
--openA separate Flutter Chrome window, no accounts or extensions

Port 5555 is fixed so the Firebase Auth session persists between runs. Details in Run the app.

PWA

The web app is already installable as a PWA. Customize:

  • Icons and colors: web/manifest.json (background_color, theme_color)
  • Favicon: kasy favicon --image your-icon.png (guide)

Last updated on 08/02/2026