LocalBiz AI:小型企業市場推廣工作台
LocalBiz AI
LocalBiz AI 是面向小型企業及本地商戶的市場推廣工作台,可把產品資料、促銷內容和日常經營構思轉化為實用文案。它支援產品文案、社交平台帖文及英語/印地語市場推廣翻譯,並透過 Groq 託管推理,使用可配置的開放權重模型 openai/gpt-oss-20b。草稿和商戶偏好只存於瀏覽器,並按已登入用戶分開;推理並非在本機執行。
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
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
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.apphttps://your-domain.vercel.app/auth/callbackhttps://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
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
- Import the repository into Vercel.
- Add
NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY,GROQ_API_KEY, and optionallyGROQ_MODELto the Vercel project environment variables. - Deploy the project.
- Update Supabase Site URL and Redirect URLs to the final production URL.
- 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.
來源:DEV Community · dev.to