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

generator-lazy-backend

v1.1.0

Published

A simple generator to create a backend using NodeJS, Express.js and Mongoose

Downloads

1

Readme

generator-lazy-backend

A simple generator to create a backend using NodeJS, Express.js and Mongoose

This generator is highly inspired by JHipster

There is an entity generator available as well

Video exemple

Fail to load the video

About the project

Database

The project is using MongoDB as its database

HTTP Request Handling

The project is using ExpressJS as its Request Handling

Where the project can be used

The focus is to use for small objectives

Prerequisites

Yeoman

  • You need to have yeoman installed. If you don't have it, type the following command:
npm i -g yo

Database

  • You need to have MongoDB running to be able to start the project after creation, but IT'S NOT REQUIRED WHEN CREATING THE PROJECT
  • If you have Docker installed you can download a mongo image, just type the following command
docker run --name mongodb -p 27017:2017 -d -t mongo

Installation

You can install the package from npm

npm i -g generator-lazy-backend

Usage

run the generator

yo lazy-backend

After the project creation

Just type the following command

npm start

Remember to have MongoDB started

The MongoDB port by default is 27017, if you use a diferent port you can change it on .env file

Entity Generator

This generator creates only the base project. There is an entity generator available for you.

You can install the package from npm

npm i -g generator-lazy-backend-entity

You can access it's GitHub to learn how to use it

Project struct

[+] indicates that it is a folder

|-- Project-Name[+]
  |-- src[+]
    |-- app[+]
      |-- controllers[+]
      |-- middlewares[+]
      |-- models[+]
      |-- validators[+]
    |-- config[+]
    |-- index.js
    |-- routes.js
    |-- server.js
  |-- package.json
  |-- package-lock.json
  |-- .editorconfig
  |-- .env
  |-- .eslintrc.json
  |-- .gitignore

If you want to check how the genereted project is, you can check this github

Project Dependencies

  1. bcrypt
    • Responsible for encrypting the user's password
    • Only added if you add JWT validations
    • npm
  2. jsonwebtoken
    • Makes possible to create a JWT Token
    • Only added if you add JWT validations
    • npm
  3. dotenv
    • Permit the posibilite to use environment variables
    • npm
  4. express
    • Handles HTTP requests
    • npm
  5. express-async-handler
    • As described by the developers:

    Simple middleware for handling exceptions inside of async express routes and passing them to your express error handlers

  6. express-validation
    • Use the joi validations, if the validation fails a response with error is returned
    • npm
  7. joi
    • Responsible to validate the fields
    • npm
  8. mongoose
    • MongoDB ODM for NodeJS
    • npm
  9. mongoose-paginate
    • Do the pagination
    • npm
  10. require-dir
    • Reduce the amount of require() you will make
    • npm
  11. youch
    • Makes NodeJS' error more readable
    • npm

Dev-Dependencies

  1. eslint
    • Lint the code
    • Use the standard configuration
    • npm
  2. nodemon
    • Restarts the application when a file change occurs
    • npm

Author

Mateus Gomems da Silva Cardoso | [email protected]