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 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-express-mvt

v1.0.15

Published

This is a boiler-plate creator for expressJS in an MVT format. Each Router-domain has its own Model,View & Routes.

Downloads

11

Readme

Create-Express-MVT

This is a boiler-plate creator for expressJS in an MVT format. Each Router-domain has its own Model,View & Routes.

Pros:

  • As each Router Domain has its own work-folder, the domains can be re-used in other products by simply picking and droping into new project files.

So Basically if I have a project1 and have 3 app/router-domains in it(as displayed in the image above). I also have another project, Project2 which rquires app1 in it.

It would be very easy, as all the domains work independently and are coded independently, I would simply copy it to project2 and register it in router.JS

Installation

npm install -g create-express-mvt

Then go to the folder you want to create your express app

npx create-express-mvt

Create .env file

Define

DB_HOST=`Your MongoDB cluster link without enverted commas`
PORT=`PORT Number without inverted commas`

Creating new apps/router-domains

Only use it from inside the CEM project-workspace

npx create-express-mvt startapp

Now add the app_name to app_register.json in

{"app_name":"router-domain you want it on"}

How it works

The index.js is the main file. It controls the basic defintions and middlewares,etc. Each router-domain known as an App has its own model,view and routes.

What happens in an App:

  • The model is created in model.js
  • The model is then imported to views.js, where views/functions are coded using the imported data-models. Each function which is to be called upon a route is imported independently using module.exports.FUNCTION_NAME=FUNCTION_NAME
  • Then the views are imported in route.js and are connected to needed routes. The router is then exported.
  • The main.js in the app imports routes which is then exported to Global routes.js. The routes.js routes all the routes registered in its JSON object. See the routes.js for understadning how to import your App.

Tutorial Click Here!

Future/Contribution Issues to be:

  • Admin Panel
  • JWT Auth Default-App