DEV Community

Aditya Pathak
Aditya Pathak

Posted on

LocalBiz AI

LocalBiz AI

LocalBiz AI is a focused marketing workspace for small businesses, local shops, cafés, makers, and online sellers. It turns product details, promotions, and everyday business ideas into useful marketing content without adding a heavy content-management system.

Features

  • Public landing page with Product Writer, Social Studio, and Language Assistant previews
  • Supabase email/password authentication with SSR session cookies
  • Protected dashboard and server-authenticated /api/generate
  • Groq chat completions using the configurable open-weight model openai/gpt-oss-20b
  • Product copy, social posts, and English/Hindi marketing translation
  • Browser-only drafts and business preferences, namespaced per authenticated user
  • Copy, regenerate, save, reopen, and delete draft actions
  • Responsive dashboard, auth screens, loading states, validation, and error messages

Local development

npm install
cp .env.example .env.local
npm run dev
Enter fullscreen mode Exit fullscreen mode

Open https://www.localblizai.dev/.

Configure Supabase Auth

Create a Supabase project, enable Authentication → Providers → Email, and copy the project URL and publishable/anon key into .env.local:

NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_publishable_or_anon_key
Enter fullscreen mode Exit fullscreen mode

The app uses @supabase/ssr with createBrowserClient, createServerClient, and middleware cookie refresh. It does not store passwords, session tokens, or user IDs in localStorage. If Supabase variables are missing, the public homepage still renders but auth and the private dashboard show a clear configuration message; the Groq route returns a configuration error rather than bypassing authentication.

In Supabase Authentication → URL Configuration, set:

  • Site URL (local): http://localhost:3000
  • Redirect URL (local): http://localhost:3000/auth/callback
  • Redirect URL for password reset: http://localhost:3000/auth/callback?next=/reset-password

For production, replace these with your deployed Vercel URL, for example:

  • https://your-domain.vercel.app
  • https://your-domain.vercel.app/auth/callback
  • https://your-domain.vercel.app/auth/callback?next=/reset-password

Configure Groq

Add the server-only Groq credentials:

GROQ_API_KEY=your_key_here
GROQ_MODEL=openai/gpt-oss-20b
Enter fullscreen mode Exit fullscreen mode

GROQ_API_KEY must not use the NEXT_PUBLIC_ prefix. The key is only read in the server route after the authenticated user is verified. Requests are validated and limited to 2,000 characters per field. Missing keys, rate limits, upstream failures, and malformed model responses return useful errors. Inference is hosted by Groq; it is not local inference.

Vercel deployment

  1. Import the repository into Vercel.
  2. Add NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, GROQ_API_KEY, and optionally GROQ_MODEL to the Vercel project environment variables.
  3. Deploy the project.
  4. Update Supabase Site URL and Redirect URLs to the final production URL.
  5. Test signup confirmation, sign-in, sign-out, password reset, dashboard generation, and a second user’s draft isolation.

Why open-weight AI

Open-weight models give LocalBiz AI a more portable generation layer than a provider-locked workflow. Today the app uses fast hosted Groq inference; later, a compatible open-weight deployment can be introduced without changing the product’s core prompts and UI. This is useful for small businesses that need practical content creation while keeping options open around cost, hosting, and model choice.

Top comments (0)