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

create-modern-mern-app

v3.0.13

Published

Interactive CLI generator for production-ready MERN stack apps with Vite, React, Express, and MongoDB

Readme

create-modern-mern-app


An interactive npm CLI that creates a full-stack React and Express workspace with working authentication, an authentic shadcn/ui dashboard, and a landing page for testing the API. The frontend and backend can each use JavaScript or TypeScript.

Visit the live documentation and architectural handbook at https://create-modern-mern-app.vercel.app for in-depth setup instructions, database models, and API reference.

Quick start

Use Node.js 24.16+, npm and a running MongoDB service or Atlas database.

npx create-modern-mern-app@latest my-app
cd my-app
npm install    # if you skipped installation in the wizard
npm run dev

If you skip installation in the wizard, run npm install at the generated root first. When authentication is enabled, the generator writes a development signing secret to server/.env. Set MONGO_URI there if you use Atlas. Open http://localhost:3000, run Check API health, then create an account. The server listens on http://localhost:5000.

To try the generator from source, run npm ci in the generator checkout and invoke node bin/index.js <new-directory>.

For an unattended setup, pass --yes with explicit choices:

npx create-modern-mern-app@latest portal --yes --language ts --styling tailwind --auth --install
npx create-modern-mern-app@latest brochure --yes --language js --styling css --no-auth --no-install

The shadcn preset includes the New York login-01, signup-01 and dashboard-01 blocks. Its dashboard uses the registry's demonstration metrics, chart and table. The account menu shows the signed-in user, Log out ends the session, and Team opens the admin-only database-backed members directory. Google sign-in and password recovery are visual placeholders from the registry. The API enforces a 12-character signup minimum.

What the wizard installs

| Included in every app | Optional | | --- | --- | | Vite, React Router, Axios | shadcn/ui, Tailwind-only or plain CSS, React Compiler, Redux Toolkit, React-Toastify | | Express, MongoDB/Mongoose, Helmet security headers | JWT cookie auth with bcryptjs and token/role middleware, CORS, dotenv, Multer, Cloudinary, Nodemailer | | Root npm workspaces, concurrent development scripts, Oxlint | Install now or later |

Project structure

Workspace

The root package manages client and server as npm workspaces. Commit the root package-lock.json after installing. Use npm ci on subsequent clean checkouts.

client/src/api/          Shared Axios client
client/src/components/   Auth form and shadcn/ui primitives
client/src/layout/       Website and dashboard shells
client/src/layout/slices/  Sidebar, header, navbar and footer
client/src/pages/        Website, auth and dashboard screens
server/index.js          Server entry (index.ts for TypeScript)
server/src/              Models, controllers, routes, config and middleware

Add a dashboard page

Create a component under client/src/pages/dashboard. Add a child Route inside the /dashboard route in App and a link in the Sidebar slice. The layout renders its active child through Outlet.

Add a backend feature

Define a Mongoose model, put request handling in a controller and register the endpoint in src/routes. Place requireToken before any handler that needs an account. For TypeScript server modules, use .js on relative imports so the emitted NodeNext modules resolve.

Authentication

Create a session

POST /api/auth/signup accepts name, email and password. POST /api/auth/login takes email and password. bcryptjs hashes passwords. Both routes issue a one-hour JWT inside an HTTP-only cookie. Signup always creates a member. Login attempts and signups share a per-IP rate limit.

Protect a route

requireToken verifies the signature, expiry and issuer, then loads the current user. requireRole checks that user's database role. Anonymous requests receive 401 and signed-in users without the required role receive 403.

router.get('/users', requireToken, requireRole('admin'), getUsers);

Sign out

POST /api/auth/logout clears the browser cookie. GET /api/auth/me returns the signed-in user. Signing out clears that browser session. A copied token remains valid until its one-hour expiry.

Testing

Verify the generator using the automated test suite and Oxlint:

npm test
npm run lint

Documentation

Full interactive documentation portal and architectural guides are maintained in docs-site/ and live at https://create-modern-mern-app.vercel.app.

License

MIT © Muhammad Arsalan Warsi