Think. Sketch. Design.
Linea is an AI-powered design tool that transforms hand-drawn sketches and wireframes into polished, production-ready designs. It features an infinite canvas for sketching, AI-driven style guide generation from moodboard images, and automatic workflow page creation β all within a seamless SaaS experience.
- Infinite Canvas β Draw shapes (rectangles, ellipses, arrows, lines, freehand), add text, pan/zoom, multi-select, group with frames, and auto-save in real time.
- Wireframe-to-Design β Upload or sketch a wireframe, and Linea generates a complete HTML/CSS design using your style guide, with WCAG AA accessibility baked in.
- Style Guide Generation β Upload moodboard images and Linea extracts a full design system: color palette (primary, secondary, UI, utility, status), typography hierarchy, and spacing guidelines.
- Workflow Pages β Automatically generate complementary pages (dashboards, settings, profiles, data tables) that match your primary design's visual language.
- Inspiration Sidebar β Attach reference images that inform the AI during design generation.
- Project Management β Create, rename, delete, and organize projects with auto-save, thumbnails, and public/private sharing.
- Subscription Billing β $10/month plan with 50 AI credits per billing period, powered by Polar.
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router, Turbopack) |
| Frontend | React 19, TypeScript 5 |
| Styling | Tailwind CSS 4, shadcn/ui (Radix UI) |
| State Management | Redux Toolkit, RTK Query |
| 3D / Landing | Three.js, React Three Fiber, Drei |
| Database | Convex (real-time serverless database) |
| Authentication | Convex Auth (email/password + Google OAuth) |
| AI | Google Gemini 2.5 Flash via Vercel AI SDK |
| Payments | Polar ($10/mo subscription + credits) |
| Background Jobs | Inngest (autosave, webhook processing) |
| Analytics | Vercel Analytics |
| Deployment | Vercel |
linea/
βββ src/
β βββ app/ # Next.js App Router
β β βββ page.tsx # Landing page (3D gallery)
β β βββ auth/ # Sign in / Sign up pages
β β βββ (protected)/ # Auth-guarded routes
β β β βββ dashboard/ # Projects list
β β β β βββ [session]/ # Workspace
β β β β βββ canvas/ # Infinite canvas editor
β β β β βββ style-guide/ # Style guide editor
β β β βββ billing/ # Subscription management
β β βββ api/
β β βββ generate/ # AI generation endpoints
β β β βββ route.ts # Wireframe β design
β β β βββ style/ # Moodboard β style guide
β β β βββ workflow/ # Complementary page generation
β β βββ billing/ # Checkout & webhook handlers
β β βββ inngest/ # Background job serve endpoint
β βββ components/ # UI components
β β βββ canvas/ # Canvas rendering
β β βββ shapes/ # Shape components
β β βββ toolbar/ # Canvas toolbar
β β βββ moodboard/ # Moodboard uploads
β β βββ ui/ # shadcn/ui primitives
β βββ hooks/ # Custom React hooks
β β βββ use-canvas.ts # Canvas state & interactions
β β βββ use-project.ts # Project CRUD
β β βββ use-styles.ts # Style guide management
β β βββ use-subscription.ts # Entitlement checks
β βββ redux/ # Redux store, slices, API
β βββ inngest/ # Background job definitions
β βββ prompts/ # AI system prompts
β βββ middleware.ts # Auth & route protection
βββ convex/ # Convex backend
β βββ schema.ts # Database schema
β βββ auth.ts # Auth configuration
β βββ user.ts # User queries
β βββ projects.ts # Project mutations/queries
β βββ subscription.ts # Credits & subscription logic
β βββ moodboard.ts # Moodboard image storage
β βββ inspiration.ts # Inspiration image storage
βββ public/ # Static assets
- Node.js 18+
- npm (ships with Node)
- A Convex account β convex.dev
- A Google Cloud project with OAuth 2.0 credentials
- A Google AI (Gemini) API key β ai.google.dev
- A Polar account for payments β polar.sh
- An Inngest account for background jobs β inngest.com
git clone https://github.com/vagxrth/linea.git
cd lineanpm installnpx convex devThis will prompt you to create a Convex project (or link to an existing one) and start syncing your convex/ backend functions.
Create a .env.local file in the project root:
# Convex
CONVEX_DEPLOYMENT=<your-convex-deployment>
NEXT_PUBLIC_CONVEX_URL=<your-convex-url>
CONVEX_SITE_URL=http://localhost:3000
# Google OAuth
GOOGLE_CLIENT_ID=<your-google-oauth-client-id>
GOOGLE_CLIENT_SECRET=<your-google-oauth-client-secret>
# Google Gemini AI
GOOGLE_GENERATIVE_AI_API_KEY=<your-gemini-api-key>
# Polar (Payments)
POLAR_ACCESS_TOKEN=<your-polar-access-token>
POLAR_WEBHOOK_SECRET=<your-polar-webhook-secret>
POLAR_PLAN=<your-polar-plan-id>
POLAR_ENV=sandbox
# Inngest (Background Jobs)
INNGEST_SIGNING_KEY=<your-inngest-signing-key>
INNGEST_EVENT_KEY=<your-inngest-event-key>
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000npm run devOpen http://localhost:3000 to see the app.
In a separate terminal:
npx inngest-cli@latest devThis starts the Inngest dev server which connects to your local app at /api/inngest.
| Command | Description |
|---|---|
npm run dev |
Start dev server with Turbopack |
npm run build |
Build for production |
npm start |
Start production server |
npm run lint |
Run ESLint |
npx convex dev |
Start Convex dev sync |
Linea uses Convex with the following core tables:
- users β Managed by Convex Auth (email, name, image, OAuth accounts)
- projects β Canvas data, style guides, generated designs, moodboard/inspiration images, thumbnails
- subscriptions β Polar subscription state, credit balance, grant/rollover limits
- credits_ledger β Immutable log of credit grants and consumption with idempotency keys
Linea supports two auth methods via Convex Auth:
- Email/Password β Standard sign-up and sign-in forms
- Google OAuth β One-click sign-in with Google
Routes are protected by Next.js middleware:
/and/auth/*β Public (redirects to dashboard if already signed in)/dashboard/*and/billing/*β Protected (redirects to sign-in if not authenticated)/api/auth/*,/api/inngest/*,/api/polar/webhookβ Bypassed (no auth required)
| Detail | Value |
|---|---|
| Price | $10/month |
| Credits per period | 50 |
| Cost per AI operation | 1 credit |
| Rollover limit | 50 credits |
| Payment provider | Polar |
Credits are granted on subscription creation and renewal via Inngest webhook processing. Each AI operation (style guide generation, wireframe-to-design, workflow page) consumes 1 credit.
Linea is designed to deploy on Vercel:
- Push your repo to GitHub.
- Import the project in Vercel.
- Add all environment variables from
.env.localto the Vercel project settings. - Set up a production Convex deployment and update
CONVEX_DEPLOYMENTandNEXT_PUBLIC_CONVEX_URL. - Switch
POLAR_ENVfromsandboxtoproductionand update Polar credentials. - Configure your custom domain and update
CONVEX_SITE_URLandNEXT_PUBLIC_APP_URL. - Set up Polar webhook URL pointing to
https://yourdomain.com/api/billing/webhook. - Ensure Google OAuth redirect URIs include your production domain.