This feature allows users to export AI-generated components to various framework structures and push them directly to GitHub for easy deployment.
- Generate Component: User creates a component using the AI chat interface
- Click Export: User clicks the "Export" button in the code viewer
- Select Framework: Choose from Next.js, React+Vite, or Create React App
- Configure GitHub: Enter project name and GitHub credentials
- Auto-Deploy: System creates repository with proper structure and provides Vercel deployment link
- Full App Router structure
- TypeScript support
- Tailwind CSS pre-configured
- shadcn/ui components included
- Ready for Vercel deployment
- Fast development server
- Modern build tooling
- TypeScript support
- Optimized for SPA deployment
- Traditional React setup
- Wide compatibility
- Easy to understand structure
- Creates proper folder structure for each framework
- Includes all necessary config files (tailwind.config.js, tsconfig.json, etc.)
- Sets up package.json with correct dependencies
- Adds README with deployment instructions
- Creates new repository automatically
- Uploads all project files
- Sets up proper .gitignore
- Provides deployment instructions
- Direct deployment links
- Optimized configurations
- Environment variables setup
- Zero-config deployment
-
Create GitHub Token:
- Go to https://github.com/settings/tokens
- Create new token with 'repo' permissions
- Copy the token (starts with
ghp_)
-
Export Component:
- Generate your component using the AI
- Click the "Export" button in the code viewer
- Fill in the export form:
- Framework: Choose your preferred framework
- Project Name: Use lowercase with hyphens (e.g.,
my-todo-app) - GitHub Username: Your GitHub username
- GitHub Token: Paste your personal access token
-
Deploy to Vercel:
- Click the "Deploy to Vercel" button in the success message
- Or manually connect the repository at https://vercel.com/new
The export system uses these key components:
generateFrameworkStructure()- Creates project file structureExportToGitHubcomponent - User interface for export/api/export-to-github- Server-side GitHub API integration
- GitHub tokens are never stored or logged
- Tokens are only used for the single repository creation
- All repositories are created as public by default
- Users should use tokens with minimal required permissions
app/layout.tsx- Root layout with metadataapp/page.tsx- Main page componentcomponents/- Component directory- Full TypeScript configuration
- Next.js specific optimizations
src/directory structureindex.htmltemplate- Vite configuration
- Fast HMR development server
- Optimized production builds
- Traditional
src/structure public/directory- React Scripts configuration
- Testing setup included
- Wide ecosystem compatibility
After export, users can deploy using:
-
Vercel (Recommended):
- One-click deployment
- Automatic CI/CD
- Custom domains
- Edge functions support
-
Netlify:
- Connect GitHub repository
- Automatic deployments
- Form handling
- CDN distribution
-
GitHub Pages:
- Enable Pages in repository settings
- Build and deploy workflow
- Free hosting for public repos
- Token Permissions: Ensure GitHub token has 'repo' scope
- Repository Name: Use valid GitHub repository names (lowercase, hyphens)
- Rate Limits: GitHub API has rate limits for repository creation
- Dependencies: Some dependencies might need manual installation
- "Missing required fields" - Fill in all form fields
- "Failed to export to GitHub" - Check token permissions and network
- "Repository already exists" - Choose a different project name
Planned features for the export system:
- Support for more frameworks (Astro, SvelteKit, etc.)
- Private repository option
- Custom domain configuration
- Environment variables setup
- Database integration templates
- Multi-component exports
- Automatic dependency optimization