npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pavan-c247/frontend-theme

v1.0.0

Published

CLI to generate a Next.js boilerplate with optional feature modules

Downloads

561

Readme

Frontend Theme CLI

A CLI tool to generate a Next.js boilerplate project with only the modules you need.

This tool helps teams avoid bloated boilerplates by letting you select features at project creation time, ensuring unused code is completely removed.


✨ What This CLI Does

  • Generates a new Next.js project from a production-ready boilerplate
  • Lets you select optional modules (CMS, Documents, FAQ, Bulk Import, etc.)
  • Physically removes unselected modules (no dead code)
  • Automatically adjusts runtime config (like sidebar navigation)
  • Provides a one-command developer experience

🚀 Quick Start

You do not need to install anything globally.

The CLI can be executed in two ways:


✅ Option 1: Run via npm (Recommended)

This is the recommended and production-ready approach.

npx @pavan-c247/frontend-theme

Why use this?

  • Stable, versioned releases
  • Faster installs (npm CDN)
  • Industry-standard distribution
  • Best for teams and long-term usage

⚠️ Option 2: Run directly from GitHub

This is useful for internal testing or experimentation.

npx https://github.com/pavan-c247/boilerplate-cli.git

Important notes:

  • The GitHub repository is temporarily downloaded and installed
  • No version pinning (always runs latest commit)
  • Slower than npm-based execution
  • Not recommended for production teams

GitHub-based execution behaves similarly to npm-based npx,

but lacks release and version guarantees.


🧭 Interactive Flow

When you run the command, the CLI will prompt you for:

  1. Project name
  2. Modules to include (multi-select)

Example:

✔Project name:my-app
✔Select modules:
◯CMS
◉Documents
◯FAQ
◯BulkImport

📁 What Gets Created

After completion, you’ll have:

my-app/
├── src/
├── public/
├──package.json
├──next.config.ts
└── ...

Only the modules you selected will be present.

Unused routes, components, hooks, services, and locale files are fully removed.


▶️ Running the Generated Project

After the CLI finishes:

cd my-app
npm install

or if you use Yarn:

yarn install

Environment Setup

Create a .env file (or copy from example):

cp .env.example .env

Update environment variables as required for your project.


Start Development Server

npm run dev

or

yarn dev

The app will be available at:

http://localhost:3000

🧩 How Module Selection Works (High Level)

  1. The CLI copies the entire boilerplate
  2. You select which modules you want
  3. Files belonging to unselected modules are deleted
  4. A runtime config file is generated:
src/config/enabled-modules.json

Example:

{
"modules":["documents","cms"]
}

This file is used by the app to:

  • Hide sidebar items
  • Avoid broken routes
  • Keep runtime behavior consistent

📦 Available Modules

| Module | Description | | --- | --- | | CMS | Content management system | | Documents | Document upload & management | | FAQ | FAQ pages and UI | | Bulk Import | Admin bulk upload flows |

Core features like Dashboard, Users, and Shared Components are always included.


🧠 Architecture Overview (For Advanced Users)

This CLI follows a manifest-driven pruning approach.

Why this matters

  • No guessing what files belong to a module
  • No fragile copy logic
  • Safe, repeatable project generation

Key Configuration Files

templates/meta/modules.json

Controls what users see in the CLI prompt.

{
"modules":{
"cms":{
"label":"CMS",
"description":"Content management system",
"default":false
}
}
}

templates/base/modules.manifest.json

Controls what files belong to each module.

{
"modules":{
"cms":{
"paths":[
"src/app/(view)/cms",
"src/components/cms",
"src/hooks/cms.ts",
"src/services/cms.ts"
]
}
}
}

If a module is not selected, all listed paths are deleted.


➕ Adding a New Module (Maintainers)

  1. Add module code to the boilerplate
  2. Register owned files in modules.manifest.json
  3. Expose the module in modules.json
  4. (Optional) Tag sidebar items with module

No CLI logic changes required.


🛠 Node & Package Manager Support

  • Node.js 18+ recommended
  • Works with:
    • npm
    • yarn
    • pnpm

📌 Common Notes

  • Prefer npm-based npx for production usage
  • GitHub-based execution is best for testing or internal use
  • The CLI does not install dependencies automatically
  • Always cd into the generated folder before running commands

📄 License

MIT License