lazy-geek
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

Lazy-geek

A library to set up your basic app requirement and make all files and folder required for nodejs development.

As many developers need to set up basic folders/files and some common functions, so to enhance their productivity this library helps to build basic app in few seconds.

Run folowing command to set up the project.

node node_modules/lazy-geek/lib/index.js

After installation, run the app using following command.

node app.js

Folder structure created by lazy-geek:

 
    ├── app.js
    ├── config
    │   ├── config.env
    │   └── database.js
    ├── controllers           
    │   └── user.controller.js  
    ├── models
    │   └── User.js
    ├── routes
    │   └── user.route.js
    ├── middleware
    │   ├── auth.js
    │   └── sendEmail.js
    ├── utils
    └── ...
File content
app.js It is a main file to start server and connect to database and initialize all the middleware and routes.
config/config.env This file contains all the environment variables.
config/database.js This file connects the app with database.
controllers/user.controller.js All the logics of APIs were implemented here like: Register, login, logout, delete profile etc.
models/User.js Contains the user schema and some functions like matchPassword, genrateToken etc.
routes/user.route.js Contains all the end points of APIs.
middleware/auth.js Contains logic for the authentication.
middleware/endEmail.js Contains function to send email using nodemailer.

Set up your environment variables in config/config.env

Installation

npm install lazy-geek

Package Sidebar

Install

npm i lazy-geek

Weekly Downloads

1

Version

2.3.0

License

MIT

Unpacked Size

34.6 kB

Total Files

9

Last publish

Collaborators

  • harshilsharma