Skip to content

iamshaury/stackzap

Repository files navigation

stackzap

A powerful CLI to scaffold production-ready full-stack projects in seconds.

npm version npm downloads license node

Stop wasting time wiring up boilerplate. stackzap gives you a full-stack project — frontend, backend, database, ORM, styling, and caching — ready to go with a single command.


Table of Contents


Installation

Global install (recommended):

npm install -g stackzap

Or run without installing:

npx stackzap init

Verify installation:

stackzap --version

Quick Start

stackzap init

The interactive CLI will guide you through every choice. That's it — your project is ready to cd into and npm run dev.


Modes

stackzap offers two ways to get started:

Preset Mode

One-click famous stacks. Pick a preset and stackzap handles all the wiring automatically.

> How do you want to start?  Preset
> Project name?               my-app
> Select preset               MERN Stack
> Package manager?            npm

See Presets Reference for the full list.

Custom Mode

Full control. Pick each layer of your stack individually.

> How do you want to start?  Custom
> Project name?               my-app
> Frontend                    Next.js
> Styling                     Tailwind
> Backend                     Fastify
> Database                    PostgreSQL
> ORM / Driver                Prisma
> Add Redis caching?          Yes
> Package manager?            pnpm

Supported Technologies

Frontend Frameworks

Technology Scaffold Method Notes
React Vite Fast dev server, HMR
Next.js create-next-app Pages Router, JavaScript
Vue.js Vite Composition API ready
Nuxt.js nuxi Full-stack Vue framework
SvelteKit sv create Compiler-based, minimal bundle

Backend Frameworks

Technology What Gets Installed Boilerplate
Express express, cors, dotenv server/index.js with health endpoint
Fastify fastify, @fastify/cors, dotenv server/index.js with health endpoint
Hono hono, @hono/node-server, dotenv server/index.js with health endpoint
NestJS @nestjs/cli Full NestJS scaffold in server/

Databases & ORMs

Database ORM / Driver Packages Installed Setup
MongoDB Mongoose mongoose
PostgreSQL Prisma prisma, @prisma/client npx prisma init
PostgreSQL Drizzle drizzle-orm, drizzle-kit, pg Config + starter schema
SQLite Prisma prisma, @prisma/client npx prisma init --datasource-provider sqlite
SQLite better-sqlite3 better-sqlite3

Styling

Technology Packages Installed Notes
Tailwind CSS tailwindcss@3, postcss, autoprefixer Auto-initializes config
CSS Modules — (built-in) Creates example .module.css
Sass / SCSS sass
shadcn/ui Tailwind + tailwind-merge, clsx, class-variance-authority, lucide-react React / Next.js only
Chakra UI @chakra-ui/react, @emotion/react, @emotion/styled, framer-motion React / Next.js only

Optional Add-ons

Technology Packages Installed Generated Files
Redis ioredis src/lib/redis.js connection helper

Presets Reference

Preset Frontend Backend Database + ORM Styling Extras
T3 Stack Next.js PostgreSQL + Prisma Tailwind tRPC, NextAuth
MERN Stack React Express MongoDB + Mongoose Tailwind
PERN Stack React Express PostgreSQL + Prisma Tailwind
MEVN Stack Vue.js Express MongoDB + Mongoose Tailwind

Generated Project Structure

Exact structure depends on your choices, but here's a typical MERN + Tailwind output:

my-app/
├── node_modules/
├── public/
├── server/
│   └── index.js          # Express server with health endpoint
├── src/
│   └── ...               # Frontend source files
├── .env                  # Auto-generated with sensible defaults
├── package.json
├── postcss.config.js
├── tailwind.config.js
└── vite.config.js

CLI Reference

Usage: stackzap [command] [options]

Commands:
  init          Scaffold a new project interactively

Options:
  -V, --version Display version number
  -h, --help    Display help

Example

# Interactive project setup
stackzap init

# Check installed version
stackzap --version

Environment Variables

stackzap auto-generates a .env file based on your stack choices:

Variable When Generated Default
PORT Always 5000
MONGO_URI MongoDB selected mongodb://localhost:27017/my-app
DATABASE_URL PostgreSQL selected postgresql://user:password@localhost:5432/mydb
DATABASE_URL SQLite + Prisma selected file:./dev.db
REDIS_URL Redis enabled redis://localhost:6379
NEXTAUTH_SECRET T3 preset your-secret-here
NEXTAUTH_URL T3 preset http://localhost:3000

Security

stackzap is built with safety in mind:

  • Input validation — Project names are restricted to [A-Za-z0-9_-]. Path traversal patterns (.., /, \) and dot-prefixed names are blocked.
  • Directory overwrite guard — Refuses to scaffold into an existing directory.
  • Node.js version check — Exits cleanly with a message if Node < 14.
  • No eval — All scaffolding runs trusted npm packages via child processes. No remote code execution.
  • Pinned dependency ranges — All installed packages use caret (^) ranges for stability.

Requirements

Requirement Minimum
Node.js >= 14.0.0
Package Manager npm, yarn, or pnpm

Changelog

2.0.0

  • Added preset stacks: T3, MERN, PERN, MEVN
  • Added frontends: Vue.js, Nuxt.js, SvelteKit
  • Added backends: Fastify, Hono, NestJS
  • Added databases: PostgreSQL (Prisma/Drizzle), SQLite
  • Added styling: CSS Modules, Sass, shadcn/ui, Chakra UI
  • Added optional Redis caching layer
  • Two-mode prompt architecture (Preset vs Custom)
  • Context-aware .env generation
  • Boilerplate server files for Express, Fastify, Hono

1.1.0

  • Gradient ASCII banner and visual upgrade
  • Step progress indicators during installation
  • Boxed success summary with stack details

1.0.0

  • Initial release
  • React, Next.js, Express, MongoDB, PostgreSQL, Tailwind CSS

Contributing

Contributions are welcome. Please open an issue first to discuss what you'd like to change.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-framework)
  3. Commit your changes (git commit -m 'Add new framework support')
  4. Push to the branch (git push origin feature/new-framework)
  5. Open a Pull Request

License

MIT — made by shaury

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors