A beautiful CLI tool to scaffold Rust projects for Vercel with Next.js frontend
Features β’ Installation β’ Usage β’ Project Structure β’ Contributing
- π One-command setup - Create a full-stack Rust + Next.js project instantly
- π¦ Automatic dependency management - Handles both npm and cargo dependencies
- π¨ Beautiful CLI experience - Rich colors, emojis, and progress indicators
- π§ Smart configuration - Automatically updates project names and imports
- π¦ Rust API endpoints - Pre-configured serverless functions for Vercel
- β‘ Next.js frontend - Modern React setup with TypeScript
- π Database ready - Includes SQLx setup and migrations
- π Authentication - JWT-based auth system included
- π― Type-safe - Full TypeScript integration with Rust types
npx create-rust-on-vercel my-awesome-projectnpm install -g create-rust-on-vercel
create-rust-on-vercel my-awesome-projectgit clone https://github.com/peterkyle01/create-rust-on-vercel.git
cd create-rust-on-vercel
npm install
npm linkSee what this CLI creates by visiting our live demo: https://rust-on-vercel-template.vercel.app/
This showcase demonstrates the full-stack Rust + Next.js application that gets generated, complete with authentication, database integration, and API endpoints.
npx create-rust-on-vercelThe CLI will prompt you for a project name if not provided.
npx create-rust-on-vercel my-project-name- π₯ Downloads template from GitHub repository
- π Updates configuration files with your project name
- π Updates Rust imports to match your project structure
- π¦ Installs Node.js dependencies via npm
- π¦ Builds Rust project via cargo
- π Ready to go!
my-awesome-project/
βββ π¦ api/ # Rust serverless functions
β βββ auth/ # Authentication endpoints
β β βββ signin.rs # User login
β β βββ signup.rs # User registration
β β βββ me.rs # Get current user
β βββ routes/ # API routes
β βββ products.rs # Example CRUD operations
βββ βοΈ app/ # Next.js App Router
β βββ (auth)/ # Auth pages
β βββ dashboard/ # Protected dashboard
β βββ layout.tsx # Root layout
βββ π¨ components/ # Reusable React components
βββ π lib/ # Shared utilities
β βββ rust/ # Rust utilities
β βββ utils.ts # TypeScript utilities
βββ ποΈ migrations/ # Database migrations
βββ π§ types/ # TypeScript type definitions
βββ βοΈ Cargo.toml # Rust dependencies
βββ π¦ package.json # Node.js dependencies
βββ π vercel.json # Vercel configuration
After creating your project:
cd my-awesome-project
# Start development server
vercel dev
# Build for production
npm run build
# Database operations
npm run db:setup # Setup database and generate types
npm run db:migrate # Run migrations
npm run generate:types # Generate TypeScript types from Rust
# Rust operations
npm run rust:build # Build Rust functions
npm run rust:check # Check Rust code
npm run rust:check-offline # Check code without database connectionCopy .env.example to .env.local and configure:
DATABASE_URL="postgresql://user:password@localhost/dbname"
JWT_SECRET="your-super-secret-jwt-key"
NEXTAUTH_SECRET="your-nextauth-secret"The project includes a vercel.json configuration for seamless deployment:
vercel deployContributions are welcome! Here's how you can help:
- π΄ Fork the repository
- π Create a feature branch:
git checkout -b feature/amazing-feature - π« Commit your changes:
git commit -m 'Add amazing feature' - π€ Push to the branch:
git push origin feature/amazing-feature - π Open a Pull Request
git clone https://github.com/peterkyle01/create-rust-on-vercel.git
cd create-rust-on-vercel
npm install
# Make your changes to index.js
# Test locally
npx ./index.js test-projectThis project is licensed under the MIT License.
Peter Mwangi
- π§ Email: kylepeterkoine4@gmail.com
- π GitHub: @peterkyle01
- π¦ Rust - Systems programming language
- β‘ Vercel - Deployment platform
- βοΈ Next.js - React framework
- π¨ Tailwind CSS - Utility-first CSS framework
Made with β€οΈ and π¦ by Peter Mwangi
β Star this repo β’ π Report Bug β’ π‘ Request Feature