API Routes
Understanding the API structure and endpoints of the Founderflow Boilerplate. Learn about the different API routes, their purposes, and how to use them.
API Structure (`app/api/`)
Public Routes (`/api/public/`)
Publicly accessible API endpoints that don't require authentication:
check-domain/
GETCheck domain availability for user registration
feedback/
POSTSubmit user feedback and suggestions
lead/
POSTCapture lead information for marketing
registered-user/
POSTTrack user registration events
Platform Routes (`/api/(platform)/`)
Protected API endpoints that require user authentication:
app/
GETMain application data and user information
app/billing/
GETUser billing information and subscription details
app/feedback/
POSTAuthenticated user feedback submission
Payment Routes (`/api/payments/`)
Payment processing and subscription management endpoints:
stripe/create-intent/
POSTCreate Stripe payment intent for checkout
lemonsqueezy/create-checkout/
POSTCreate Lemon Squeezy checkout session
history/
GETRetrieve user payment history
Webhook Routes (`/api/webhook/`)
Webhook handlers for external service integrations:
clerk/
POSTHandle Clerk user sync webhooks
stripe/
POSTHandle Stripe payment webhooks
lemonsqueezy/
POSTHandle Lemon Squeezy payment webhooks
Service Routes
Additional service endpoints for specific functionality:
resend/send/
POSTSend emails via Resend service
stripe/checkout/
POSTCreate Stripe checkout sessions
API Patterns
Type Safety
Full TypeScript support with proper type definitions for all API routes
Error Handling
Consistent error responses with proper HTTP status codes
Validation
Input validation using schema validation libraries
Rate Limiting
Built-in protection against abuse and spam
Webhook Security
Signature verification for webhook authenticity
Authentication
JWT and session-based authentication support
Example API Usage
Creating a Payment Intent
Submitting Feedback
Next Steps
Now that you understand the API structure, explore these related areas: