Installation
Get feature101 set up and add your first feature in under 30 seconds.
Prerequisites
feature101 works inside any existing Next.js project. Make sure you have:
Initialize Your Project
Optional, but recommended before your first feature. This scaffolds the shared Prisma client, auth stub, and shadcn/ui setup every primitive depends on:
npx feature101@latest initSets up shadcn/ui (Base UI + the Vega preset), your Prisma client, and .env.example in one step. Skipping this is fine too — addbootstraps the same shared layer automatically the first time it's needed.
Add a Feature
Run the CLI with the feature slug you want to install:
npx feature101@latest add followWhat happens when you run this
Copies feature files
All source files are written into features/follow/ in your project. You own every file immediately.
Installs npm dependencies
Runtime deps (@prisma/client, zustand, etc.) and dev deps (prisma, @types/pg) are installed automatically.
Installs shadcn/ui components
If shadcn/ui isn't set up yet, the CLI bootstraps it with Base UI + the Vega preset first. Then it runs npx shadcn@latest add [component] for whatever the feature needs.
Merges Prisma model
The feature's model block is appended to your existing prisma/schema.prisma. Your existing models are untouched.
Generates client and syncs the database
Runs prisma generate, then prisma migrate dev if DATABASE_URL is set in .env. Skipped silently if the env var is missing.
Generated File Structure
Running npx feature101@latest add follow creates this complete file structure in your project:
Database Connection
Set your database connection string in .env:
DATABASE_URL=postgresql://user:password@localhost:5432/mydbPostgreSQL by default, any DB supported
@prisma/adapter-pgpre-configured for PostgreSQL. Since it's Prisma under the hood, you can adapt prisma.config.ts to MySQL, SQLite, MongoDB, Neon, Supabase, PlanetScale, or any other Prisma-supported database.DATABASE_URL must exist before the CLI runs
prisma migrate dev if DATABASE_URL is present in .env at install time. If you add it after, run manually — or your app will throw table does not exist at runtime:npx prisma migrate devSchema Merging
If you already have a prisma/schema.prisma, the CLI appends the new model block — it does not overwrite your file. Your existing models, datasource, and generator config are preserved.
If no schema exists yet, a new one is created with the default PostgreSQL datasource config.
Installing multiple features is safe — each model is appended independently, and the CLI won't add a model that already exists.
Usage
Import the component from the feature's barrel export and drop it anywhere in your app:
import { FollowButton } from "@/features/follow";
export default function ProfilePage() {
return (
<article>
<h1>Jane Doe</h1>
<p>Profile content...</p>
<FollowButton targetUserId="user_xyz" showCount={true} />
</article>
);
}Manual Installation
Prefer copy-paste? Every feature page has a Code tab with all files and syntax highlighting. To manually wire a feature:
features/[slug]/ in your projectnpm install [deps]npx shadcn@latest add [component]. If shadcn/ui isn't initialized yet, run npx shadcn@latest init -b base -p vega firstprisma/schema.prismanpx prisma generate then npx prisma migrate dev to sync your schemaTroubleshooting
Error: table does not existCause: DATABASE_URL wasn't set when the CLI ran, so prisma migrate dev was skipped.
Fix: Add DATABASE_URL to .env, then run npx prisma migrate dev.
shadcn components look unstyled or use the wrong primitivesCause: shadcn/ui was already initialized in this project before you started using feature101 — with Radix instead of Base UI, or without the Vega preset — so newly added components don't match.
Fix: The CLI only bootstraps shadcn/ui automatically when components.json doesn't exist yet. To switch an existing setup to Base UI + Vega, re-run npx shadcn@latest init -y -b base -p vega manually.
prisma: command not foundCause: The prisma dev dependency wasn't installed correctly.
Fix: Run npm install -D prisma, then npx prisma generate and npx prisma migrate dev.
Cannot find module '@/features/follow'Cause: Your tsconfig.json doesn't have the @/* path alias configured.
Fix: Add "@/*": ["./*"] to the paths section of your tsconfig.json.
Ready to browse features?