New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

scaffism

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scaffism

Production-ready Next.js backend scaffolder

latest
Source
npmnpm
Version
1.0.0-alpha.1
Version published
Maintainers
1
Created
Source

Scaffism

Production-ready Next.js backend scaffolder that generates complete, type-safe backend code in seconds.

Features

  • Multiple Auth Providers: Auth.js (NextAuth), Clerk, Supabase Auth
  • Database Support: PostgreSQL, MySQL, SQLite
  • ORM Integration: Prisma, Drizzle
  • Authorization: None, Simple (owner-based), RBAC (role-based)
  • Optional Features:
    • Rate Limiting (LRU Cache / Redis)
    • Structured Logging (Pino)
    • Error Handling
    • Redis Caching
    • Background Jobs (BullMQ)
    • File Uploads (S3)
    • Payments (Stripe)
    • Email (Resend)

Quick Start

# Install globally
npm install -g scaffism

# Create a new project
scaffism my-app

# Or with specific options
scaffism my-app --auth authjs --db postgresql --orm prisma

# Or use defaults
scaffism my-app -y

CLI Commands

scaffism [name] / scaffism init [name]

Create a new project with interactive prompts.

# Interactive mode
scaffism my-app

# With flags
scaffism my-app --auth clerk --db postgresql --orm prisma

# Skip prompts with defaults
scaffism my-app -y

# Dry run (show what would be generated)
scaffism my-app --dry-run

scaffism add [features...]

Add features to an existing project.

scaffism add rate-limiting logging
scaffism add payments email

scaffism generate <type> [name]

Generate new entities, routes, or tests.

scaffism generate entity Post --fields "title:string:true,content:string:true"
scaffism g route posts
scaffism g test posts

Configuration

Create a scaffism.config.json for reproducible builds:

{
  "name": "my-app",
  "auth": "authjs",
  "database": "postgresql",
  "orm": "prisma",
  "authorization": "rbac",
  "features": ["rate-limiting", "logging", "error-handling"],
  "entities": [
    {
      "name": "Post",
      "fields": [
        { "name": "title", "type": "string", "required": true },
        { "name": "content", "type": "string", "required": true },
        { "name": "published", "type": "boolean", "default": false }
      ],
      "timestamps": true
    }
  ]
}

Valid Combinations

Not all auth/database/ORM combinations are valid:

AuthDatabaseORM
Auth.jsPostgreSQL, MySQL, SQLitePrisma, Drizzle
ClerkPostgreSQL, MySQL, SQLite, NonePrisma, Drizzle, None
SupabasePostgreSQLPrisma, Drizzle
NonePostgreSQL, MySQL, SQLite, NonePrisma, Drizzle, None

Generated Project Structure

my-app/
├── src/
│   ├── app/                    # Next.js App Router
│   │   ├── api/                # API routes
│   │   │   ├── auth/           # Auth endpoints
│   │   │   ├── v1/             # API v1 routes
│   │   │   └── health/         # Health check
│   │   ├── layout.tsx
│   │   └── page.tsx
│   ├── lib/                    # Shared libraries
│   │   ├── auth/               # Auth configuration
│   │   ├── db/                 # Database client
│   │   ├── dal/                # Data Access Layer
│   │   ├── services/           # Business logic
│   │   ├── validation/         # Zod schemas
│   │   └── utils/              # Utilities
│   ├── config/                 # Configuration
│   └── types/                  # TypeScript types
├── prisma/                     # Prisma schema (if using Prisma)
├── drizzle/                    # Drizzle migrations (if using Drizzle)
├── tests/                      # Test files
├── docker-compose.yml          # Docker services
├── .env.example                # Environment template
└── package.json

Development

# Clone the repository
git clone https://github.com/scaffism/scaffism
cd scaffism

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run CLI in development
pnpm cli my-test-app

# Run tests
pnpm test

# Type check
pnpm typecheck

Architecture

Scaffism uses a modular architecture:

  • Modules: Self-contained generators for each feature
  • Adapters: Database and ORM-specific code generators
  • Pipeline: High-performance generation with parallel processing
  • Registry: Central registration of all modules

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT

Keywords

nextjs

FAQs

Package last updated on 12 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts