next-genkit

1.1.9 • Public • Published

Next-GenKit 🚀

A powerful CLI tool for generating Next.js app router pages and API routes with ease.

npm version License: MIT Downloads


🌟 Features

  • 📄 Generate Next.js pages with modern layouts
  • 🔌 Create API routes with pre-configured handlers
  • 🎯 TypeScript and JavaScript support
  • 🎨 Tailwind CSS integration
  • 💻 Interactive CLI experience
  • ⚡ Lightning fast setup
  • 🎭 Clean and consistent code generation

🚀 Installation & Usage

Using npx (Recommended - No Installation Required)

npx next-genkit generate

You'll be prompted to:

  1. Choose your preferred language (TypeScript/JavaScript)
  2. Select what to generate (Page/API Route)
  3. Enter the route path
  4. Configure Tailwind CSS (for pages)

📝 Examples

Creating a New Page

$ next-genkit generate
? Which language are you using? TypeScript
? What would you like to generate? Page
? Enter the route path: blog/[slug]
? Are you using Tailwind CSS? Yes

✨ Created page at: app/blog/[slug]/page.tsx

Creating an API Route

$ next-genkit generate
? Which language are you using? TypeScript
? What would you like to generate? API Route
? Enter the route path: api/users

✨ Created API route at: app/api/users/route.ts

📦 Generated Files

Page Template

export default function Page() {
  return (
    <div className="min-h-screen bg-gray-100 py-12 px-4 sm:px-6 lg:px-8">
      <div className="max-w-7xl mx-auto">
        <div className="text-center">
          <h1 className="text-4xl font-bold tracking-tight text-gray-900">
            New Page
          </h1>
          <p className="mt-4 text-lg text-gray-500">
            Edit this page in app/page.tsx
          </p>
        </div>
      </div>
    </div>
  );
}

API Route Template

import { NextResponse } from "next/server";

export async function GET() {
  return NextResponse.json({ message: "Hello from the API" });
}

export async function POST(request: Request) {
  const data = await request.json();
  return NextResponse.json({ message: "Success", data });
}

⚙️ Requirements

  • Node.js 14.0.0 or newer
  • Next.js 13.0.0 or newer (using App Router)
  • npm or yarn package manager

📝 License

This project is licensed under the MIT License.

🙋‍♂️ Author

Hayden Wadsworth

🔄 Changelog

1.1.9

  • Initial release
  • Basic page and API route generation
  • TypeScript and JavaScript support
  • Tailwind CSS integration

Made with ❤️ by Hayden Wadsworth

Package Sidebar

Install

npm i next-genkit

Weekly Downloads

11

Version

1.1.9

License

MIT

Unpacked Size

9.01 kB

Total Files

3

Last publish

Collaborators

  • haydenwadsworth