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

@mena-emad/archinit

v1.0.0

Published

Scaffold a production-ready Node.js Express backend in seconds with a clean, modular architecture that keeps your project simple, readable, and easy to scale.

Readme

🚀 CleanInit CLI (archinit)

Scaffold a production-ready Node.js Express backend in seconds with a clean, modular architecture that keeps your project simple, readable, and easy to scale.

License: MIT GitHub Stars Node.js Production Ready

CleanInit is a lightweight CLI that generates a modern Express backend structure from a real template located in the repository. It asks for a project name and an auth preference, then creates a new project folder with a clean root-level layout and a ready-to-run baseline.

This README reflects the actual CLI implementation and generated scaffold in the current repository.


✨ What This CLI Actually Does

When you run the tool, it:

  • prompts for a project name
  • asks whether to include basic auth infrastructure
  • copies the bundled template into a new folder
  • renames the generated package name to your chosen project name
  • creates .env and .env.example files
  • removes auth-specific files when auth is disabled

🛠️ Installation

Install it globally from GitHub:

npm install -g mena-emad/archinit

Run it from anywhere:

archinit

🧪 Interactive Prompts

The CLI currently asks for two inputs:

  • Project Name — the folder name for the new backend scaffold
  • Auth Infrastructure — a yes/no prompt that controls whether auth middleware and token helpers are included

If you answer yes, the scaffold includes:

  • middlewares/auth.js
  • utils/generateTokens.js
  • JWT-related environment variables

If you answer no, those files are removed to keep the generated project lean.


🧱 Generated Project Structure

The generated project uses a root-level architecture with no src folder.

With Auth Enabled

[project-name]/
├── config/
│   └── dbConnection.js
├── data/
│   └── models/
├── middlewares/
│   ├── auth.js
│   ├── gerror.js
│   └── validation.js
├── modules/
│   └── _sample/
│       ├── sample.controller.js
│       ├── sample.routes.js
│       ├── sample.service.js
│       └── sample.validation.js
├── utils/
│   ├── AppError.js
│   ├── catchAsync.js
│   └── generateTokens.js
├── .env
├── .env.example
├── app.js
└── index.js

With Auth Disabled

[project-name]/
├── config/
│   └── dbConnection.js
├── data/
│   └── models/
├── middlewares/
│   ├── gerror.js
│   └── validation.js
├── modules/
│   └── _sample/
├── utils/
│   ├── AppError.js
│   └── catchAsync.js
├── .env
├── .env.example
├── app.js
└── index.js

🔄 Request Flow

The scaffolded app follows a simple modular flow:

graph TD
    A[index.js] --> B[app.js]
    B --> C[modules/_sample/sample.routes.js]
    C --> D[middlewares/auth.js]
    D --> E[sample.controller.js]
    E --> F[sample.service.js]
    F --> G[data/models/]
    E --> H[middlewares/gerror.js]

This gives you a clear path for request handling, business logic, persistence, and error management.


✅ Included Features

The scaffolded template already includes:

  • Express.js backend foundation
  • Mongoose and MongoDB connection setup
  • Joi for request validation
  • Cookie parsing support
  • CORS support
  • JWT auth helpers when enabled
  • Helmet, mongo-sanitize, and dotenv support

⚡ Quick Start

After the CLI generates your project:

cd [project-name]
npm install
npm run dev

That path boots your project quickly and puts you into a production-ready development loop with minimal friction.

Pro tip: Enable auth when you want a faster route to secure, API-first applications with token-based protection.


📦 What You Get Out of the Box

Every generated project is designed to feel deliberate and scalable:

  • Clean root-level organization
  • Modular feature slices for long-term maintainability
  • Ready-to-use API entry points
  • Configured environment files
  • Authentication-ready middleware layer when needed
  • Database connection structure and error handling by default

📄 License

This project is licensed under the MIT License.


🤝 Contributing

Contributions are welcome. If you want to improve the CLI, expand the templates, or refine the scaffolding experience, open an issue or submit a pull request.