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

exp-mvc

v1.2.0

Published

Generate a new ExpressJS project in MVC architecture using command line interface (CLI) and auto-dependency installation.

Readme

exp-mvc

npm version license stars' npm downloads

Node.js Express project generator that instantly creates a clean, scalable, and production-ready folder structure based on the MVC architecture. Includes powerful CLI commands to generate controllers, models, routes, and complete CRUD scaffolds with auto-dependency installation.

Designed for developers who want to skip boilerplate setup and start building features immediately.

Install

npm install -g exp-mvc

After installing exp-mvc globally , run the following command:

expmvc new myapp

Or

npx exp-mvc new myapp

This will create:

./myapp

with the full project structure.

Navigate to the project folder:

cd myapp

Inside your project folder, install dependencies:

npm install

configure the mongodb connection in the .env file

MONGODB_URI=mongodb://localhost:27017/myapp

Run the server:

npm start

or

npm run dev

Run the watch command to automatically install dependencies on file save:

npm run watch

Open the browser at http://localhost:3000

🔥 CLI Commands Reference

Once inside your generated project, use the expmvc command to generate components:

Generate Complete CRUD Scaffold

Create a full CRUD module with controller, model, service, route, and validation files:

expmvc generate scaffold User name:string email:string password:string age:number

Generate Individual Components

Generate a controller

expmvc generate controller Product

Generate a model with fields

expmvc generate model Category name:string description:string

Generate a route

expmvc generate route Order

Generate a service

expmvc generate service Auth

Generate a validation file

expmvc generate validation User

Generate a view (EJS template)

expmvc generate view home/index

Command Aliases

'g' is alias for 'generate'

'expmvc g scaffold User name:string email:string'

Short forms

expmvc g c User        # controller
expmvc g m User        # model
expmvc g r User        # route
expmvc g s User        # service
expmvc g v User        # validation

Relations Between Models

1. Generate Individual Models with References:

# Generate User model
expmvc generate model User name:string email:string password:string

# Generate Post model with User reference
expmvc generate model Post title:string content:string user:ref:User

# Generate Comment model with User and Post references
expmvc generate model Comment content:string user:ref:User post:ref:Post

2. Create Relationships Between Existing Models:

# Add belongsTo relationship from Post to User
expmvc rel belongsTo Post User --field author

# Add hasMany relationship from User to Post
expmvc rel hasMany User Post --field posts

# Add belongsToMany relationship (for tags, categories, etc.)
expmvc rel belongsToMany Post Tag --field tags[]

3. Complete Relationship Scaffold:

# Scaffold User-Post relationship (One-to-Many)
expmvc sr User Post hasMany

# Scaffold Post-Comment relationship (One-to-Many)
expmvc sr Post Comment hasMany

# Scaffold User-Comment relationship (One-to-Many)
expmvc sr User Comment hasMany

4. Generate Complete CRUD with Relationships:

# Generate User scaffold
expmvc generate scaffold User name:string email:string password:string

# Generate Post scaffold with User reference
expmvc generate scaffold Post title:string content:string user:ref:User

# Then add the reverse relationship
expmvc rel hasMany User Post --field posts

Field Types Supported

# Available field types:
name:string           # String field
age:number            # Number field
isActive:boolean      # Boolean field
createdAt:date        # Date field
tags:array            # Array field
userId:objectid       # ObjectId reference

✨ Why Use This Generator?

  • Saves Hours: Skip repetitive setup and focus on business logic

  • Consistent Architecture: Enforces clean, maintainable structure

  • Production Ready: Includes validation, services, and middleware patterns

  • Scalable: Perfect for growing applications

  • Developer Friendly: Intuitive CLI with helpful commands

Perfect For:

  • Students learning Express.js

  • Backend developers starting new projects

  • Startups needing rapid prototyping

  • API bootstrapping and hackathons

  • Enterprise applications requiring structure

🔧 Advanced Usage

Custom Templates

You can customize the generated templates by modifying the generator files in your global installation.

Integration with Existing Projects

If you have an existing Express project with the same structure, you can still use the generator commands:

cd existing-express-project
expmvc generate scaffold Post title:string content:string

Environment Variables

Created .env file in your project root:

PORT=3000
MONGODB_URI=mongodb://localhost:27017/yourdb

❤️ Contributing

We welcome contributions! Here's how you can help:

1.Report Bugs: Open an issue with detailed description

2.Request Features: Suggest new features or improvements

3.Submit PRs: Fork the repo and submit pull requests

4.Improve Documentation: Help make the docs better

Thanks for using exp-mvc! Don't forget to give a ⭐ on GitHub if you like it!

Built with ❤️ for the Node.js community.