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

nano-app

v3.0.1

Published

Set up a modern node.js api service by running one command

Downloads

64

Readme

npm publish size stars npm total downloads

Node App

nano-app is a command-line application, here you can easily create your node.js project structure.

Installation

Install my-project with npm

  npx nano-app my-project
  cd my-project

It will create a directory called my-project inside the current folder. Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-project
├── package.json
├── package-lock.json
├── .prettierrc
├── .prettierignore
├── .gitignore
├── .env.production
├── .env.development
├── .babelrc
├── node_modules
└── src
    ├── config
        ├── cloudinary.js
        ├── database.js
        ├── passport.js
        └── sendEmail.js
    ├── controllers
        └── authController.js
    ├── middlewares
        ├── authorizedUser.js
        └── google.js
    ├── models
        ├── auditLogs.js
        ├── userRoleMaps.js
        ├── users.js
        └── validations.js
    ├── routes
        ├── authRouter.js
        └── router.js
    ├── utils
        ├── errors
            └── globalErrorHandler.js
        ├── responses
            ├── sendData.js
            ├── sendMessage.js
            └── sendResponse.js
        ├── templates
            ├── forgotMail.js
            └── signUpMail.js
        ├── createJWT.js
        └── createMFA.js
    ├── app.js
    └── server.js

Features

  • ES6+ configuration (Babel)
  • Better error handling
  • Clean code structure
  • Google authentication (Passport strategy)
  • Email authentication with OTP verification (Sent mail using Google Gmail)
  • Implement MFA using speakeasy
  • MFA QR code images stored in Cloudinary
  • Forgot Password via mail
  • Modern data validation using Joi
  • Forgot password mail template
  • OTP validation mail template

Environment Variables

To run this project, you will need to add the following environment variables to your .env.development (Development mode) or .env.production (Production mode) file

  • DB_NAME
  • DB_USER
  • DB_PASS
  • HOST
  • SCHEMA

If you want to store MFA QR code at Cloudinary

  • CLOUD_NAME
  • CLOUD_KEY
  • CLOUD_SECRET

If you want to use google login Google console

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • GOOGLE_CALLBACK_URL

If you want to use email verification

  • EMAIL
  • EMAIL_PASS (App password)

API Reference

Google Log In

  Redirect /api/v1/auth/google

For google login you need to set your FrontEnd URL at .env.development or .env.production [FRONT_END]

Sign Up

  POST /api/v1/auth/signup

| Body | Type | Description | | :--------- | :------- | :------------------------------ | | f_name | string | Required. Your first name | | l_name | string | Required. Your last name | | email | string | Required. Your email | | phone | string | Required. Your phone number | | password | string | Required. Your password |

Sign In

  POST /api/v1/auth/signin

| Body | Type | Description | | :--------- | :------- | :-------------------------- | | email | string | Required. Your email | | password | string | Required. Your password |

Resent OTP

  POST /api/v1/auth/resent-otp

| Body | Type | Description | | :------ | :------- | :----------------------- | | email | string | Required. Your email |

Verify OTP

  POST /api/v1/auth/verify-otp

| Body | Type | Description | | :------ | :------- | :----------------------- | | email | string | Required. Your email | | otp | string | Required. Your otp |

Verify MFA

  POST /api/v1/auth/verify-mfa

| Body | Type | Description | | :------ | :------- | :--------------------------- | | id | int | Required. Your user id | | token | string | Required. Your mfa token |

Forgot Password

  POST /api/v1/auth/forgot-password

| Body | Type | Description | | :------ | :------- | :----------------------- | | email | string | Required. Your email |

Reset Password

  POST /api/v1/auth/reset-password

| Body | Type | Description | | :----------- | :------- | :-------------------------- | | reset_link | string | Required. Reset link | | password | string | Required. Your password |

Get Profile

  GET /api/v1/auth/profile

| Parameter | Type | Description | | :-------------- | :------- | :--------------------------- | | Authorization | string | Required. Your JWT token |

Run Locally

Install dependencies

  npm install

Start the server

  npm run dev

Deployment

To deploy this project run

  npm run start

Usage/Examples

npx nano-app api

Part 1

Part 2

Part 3

Demo

Insert gif or link to demo

![Demo Video]

Tech Stack

Server: Node, Express

Authors

Feedback

If you have any feedback, please reach out to us at [email protected]

Support

For support, email [email protected]

License

MIT

If you like, Give a star ⭐