Skip to content

A powerful CLI tool to accelerate Next.js development by scaffolding features, components, and more with a single command.

License

Notifications You must be signed in to change notification settings

isweerasingha/nextjs-app-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Next.js App Toolkit CLI

A powerful CLI tool to accelerate Next.js development by scaffolding features, components, and more with a single command.

License: GPL v3 NPM Version

Next.js App Toolkit is a command-line interface (CLI) designed to supercharge your Next.js development workflow. Eliminate repetitive boilerplate setup and generate feature-rich modules instantly, allowing you to focus on building core application logic.

Features

  • Rapid Scaffolding: Generate entire feature modules, including hooks, services, state management, types, and configs, with a single command.
  • Best Practices Included: The generated code follows modern Next.js App Router conventions, including templates for Server Actions, revalidateTag for caching, and React Query hooks.
  • Type-Safe by Default: All generated files are TypeScript-based to ensure type safety from the ground up.
  • Developer-Friendly: Provides a simple and intuitive command structure that's easy to remember and use.
  • Extensible Architecture: Designed to be easily expanded with new generators for components, styles, contexts, and more.

Installation

  1. Clone the Repository:

    git clone https://github.com/isweerasingha/nextjs-app-toolkit.git
    cd nextjs-app-toolkit
  2. Install Dependencies:

    npm install
  3. Build the Project: The build command compiles all TypeScript source files to JavaScript in the dist/ folder and copies the necessary template files.

    npm run build
  4. Link for Local Testing: This command makes your local version of the toolkit available as a global command on your system.

    npm link

    After linking, any changes you make to the source code will be active after you run npm run build again.


Usage

Navigate to the root directory of any Next.js project in your terminal and run the toolkit's commands.

Example: Generate a "Payment" Feature

next-toolkit gen:feature payment

This command will instantly create a new, fully structured module inside your project.

Generated Module Structure

The command above creates the following directory and files at app/features/payment/:

app/features/payment/
├── config/
│   └── tags.ts
├── hooks/
│   └── usePaymentList.ts
├── services/
│   └── paymentService.ts
├── state/
│   └── paymentSlice.ts
├── types/
│   └── paymentTypes.ts
└── index.ts

Commands API

Command Alias Description
gen:feature <name> gf Generates a new, fully-featured module in app/features/. The <name> should be singular (e.g., product, user).
gen:component <name> gc (Coming Soon) Generates a React component file.
init:redux (Coming Soon) Sets up Redux Toolkit and a provider for the project.

For Developers (Contributing)

Contributions are welcome! If you'd like to help improve the toolkit, please follow these steps to set up a local development environment.


Author

This project is maintained by Isuru Weerasingha.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for the full license text.

About

A powerful CLI tool to accelerate Next.js development by scaffolding features, components, and more with a single command.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published