DEV Community

Deviprasad Rai P
Deviprasad Rai P

Posted on

I Got Tired of Manually Creating Folders for Every New Project - So I Built Scaffinity

Every time I start a new project, it's the same routine:

mkdir src
mkdir src/modules
mkdir src/modules/auth
touch src/modules/auth/auth.controller.ts
touch src/modules/auth/auth.service.ts
# ...repeat 20 more times
Enter fullscreen mode Exit fullscreen mode

I do this constantly - building backend services, AI voice agent projects, side experiments. At some point I realized I was rebuilding the same folder structures over and over, and copy-pasting old projects just to steal their layout.

So I built Scaffinity - a CLI that turns a simple JSON file into a real project structure, instantly.

How It Works

Define your structure once:

{
  "src": {
    "modules": {
      "auth": {
        "auth.controller.ts": "",
        "auth.service.ts": "",
        "auth.routes.ts": ""
      }
    },
    "main.ts": "import express from 'express'\n\nconst app = express()\n"
  },
  ".env.example": "PORT=3000\nNODE_ENV=development"
}
Enter fullscreen mode Exit fullscreen mode

Run one command:

scaffinity generate blueprint.json
Enter fullscreen mode Exit fullscreen mode

And the entire structure - folders, files, even file contents - gets created instantly.

The Feature I'm Most Proud Of

Most scaffolding tools only go one direction: template -> project. Scaffinity also goes the other way.

scaffinity export ./my-existing-project -o blueprint.json
Enter fullscreen mode Exit fullscreen mode

This scans any existing project and converts its structure into a portable JSON blueprint. Now you can:

  • Share your team's standard folder layout with one file
  • Version control your project structure like any other config
  • Recreate a structure on a new machine in seconds

No more "hey can you send me your folder structure" Slack messages.

Interactive Mode

If you don't want to hand-write JSON, there's also:

scaffinity init
Enter fullscreen mode Exit fullscreen mode

Walks you through building a structure interactively, file by file, directory by directory, then saves it as a blueprint you can reuse.

Tech Stack

Built with TypeScript, Commander.js for the CLI parsing, fs-extra for file operations, and ora/chalk for clean terminal output. Kept it intentionally dependency-light.

Try It

npm install -g scaffinity
scaffinity generate blueprint.json --dry --verbose   # preview first
Enter fullscreen mode Exit fullscreen mode

GitHub: Github
npm: Scaffinity

Still early - would genuinely love feedback, bug reports, or blueprint contributions for other stacks (NestJS, FastAPI, Next.js, etc). There's an /examples folder for community blueprints if you want to add yours.

Top comments (0)