A demo application that mimics the Cursor text editor interface to showcase stripe-no-webhooks billing integration capabilities.
-
Three-panel layout mimicking Cursor editor:
- Left: File explorer with e-commerce product catalog files
- Center: Monaco code editor with syntax highlighting
- Right: AI chat assistant for coding help
-
Interactive demos with stripe-no-webhooks billing gates:
- Tab completion (press
TaborCmd/Ctrl + Space) - Gated by feature entitlement - AI chat responses - Gated by usage limits
- Tab completion (press
-
Backend architecture:
- Mock authentication system
- stripe-no-webhooks integration for billing checks
- API routes with proper authorization
- Install dependencies:
npm install- Set up stripe-no-webhooks env vars:
npx stripe-no-webhooks init- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
- Click in the editor
- Press
TaborCmd/Ctrl + Spaceto see a code completion suggestion - The suggestion popup will auto-hide after 3 seconds
Ask the AI assistant coding questions:
- "How do I add search filters?"
- "Show me error handling"
- "How can I optimize performance?"
- "Help me with TypeScript types"
The AI will respond with relevant code examples. Gated by stripe-no-webhooks usage limits.
- Next.js 15 - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Monaco Editor - VS Code editor component
- Lucide React - Icons
- Next.js API Routes - Serverless functions
- stripe-no-webhooks - Billing and usage tracking
- Mock Auth System - Simulates user authentication
- Frontend - User triggers action (tab completion or AI chat)
- Backend API - Receives request from frontend
- Auth Check - Verifies user is logged in (
lib/auth.ts) - stripe-no-webhooks Credits Check -
billing.credits.hasCreditschecks:- Does user's plan include this feature?
- Does user have remaining credits/quota?
- Gate Decision:
- ✅ Allowed - Execute logic → track usage with
billing.credits.consume→ return result - ❌ Blocked - Return 402 error with upgrade message
- ✅ Allowed - Execute logic → track usage with
- Frontend - Displays result or shows upgrade prompt
app/page.tsx- Main layout with three panelscomponents/FileExplorer.tsx- Left sidebar file treecomponents/CodeEditor.tsx- Code editor (calls/api/completion)components/ChatPanel.tsx- AI chat (calls/api/chat)
lib/auth.ts- Mock authentication systemlib/billing.ts- stripe-no-webhooks clientapp/api/completion/route.ts- Tab completion APIapp/api/chat/route.ts- AI chat API