next-lovable
A powerful CLI tool to seamlessly migrate React applications to Next.js 13+ with App Router support. Transform your Lovable/Vite projects with just one command.
Key Features
Smart Router Conversion
Automatically converts React Router to Next.js App Router
Vite to Next.js Migration
Seamlessly migrates from Vite to Next.js build system
Dependency Management
Handles package.json dependencies automatically
Component Preservation
Preserves existing components, layouts, and metadata
Next.js Configuration
Adds necessary Next.js configuration files
TypeScript Support
Full support for TypeScript projects
Safe Preview Mode
Includes --dry-run
mode for safe preview
Prerequisites
- • Generated using lovable.dev
- • React Router
- • Vite
- • TypeScript
Installation
Install the CLI tool globally using npm:
Authentication
When you run the CLI tool, you'll be prompted to authenticate with your credentials:
Important: Always test compatibility first!
Run next-lovable ./your-project --dry-run
to check if your project is compatible before purchasing credits.
Usage Guide
Basic Usage
Replace <source-directory>
with your React project path. The target directory is optional - if not specified, a new directory will be created.
Advanced Usage
Command Options
-y, --yes
Skip confirmation prompts
-i, --install
Install dependencies after migration
-d, --dry-run
Preview migration with no file changes
--help
Show help information
Examples
1. Basic migration:
2. Specify target directory:
3. Non-interactive migration with dependency installation:
4. Dry run (preview only, no file changes):
Migration Process
Understanding how next-lovable transforms your React project
Setup and Validation
- • Validates source project structure
- • Creates target directory
- • Checks compatibility requirements
Project Structure
- • Copies project files safely
- • Restructures directories to Next.js format
- • Converts route structure
Code Transformation
- • Adds 'use client' directives
- • Updates import paths
- • Converts router code
- • Creates Next.js page files
Configuration
- • Updates package.json
- • Creates Next.js config files
- • Sets up root layout
Post-Migration Steps
- 1Review generated files in
src/app
- 2Check component imports and paths
- 3Update any remaining router-specific code
- 4Test the application with
npm run dev
Known Limitations
You may need to manually add the "use client"
directive to certain components.
Some complex routing logic or deeply customized setups may require manual review after migration.
Ready to migrate your React app?
Get started with next-lovable today and transform your React application into a modern Next.js project in minutes.