1.1.5 • Published 1 year ago

mernstack-auth-boilerplate v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Auth Boilerplate with Email Verification

npm License npm

Introduction

Auth Boilerplate is a full-stack authentication solution for Node.js applications. It includes user registration, login, and email verification functionalities, providing a robust foundation for handling user authentication in your projects.

Features

  • User Authentication: Register and login users with secure password hashing.
  • JWT Tokens: Generate and verify JSON Web Tokens (JWT) for secure authentication.
  • Email Verification: Send email verification links using Nodemailer.
  • Environment Configuration: Easily manage environment variables with dotenv.
  • Middleware Integration: Protect routes with authentication middleware.

Table of Contents

Installation

To install this package, use npm:

npm install mernstack-auth-boilerplate

Usage

After installation, you can start the server using:

npm start

Or, to start the server in development mode with Nodemon:

npm run dev

Project Structure

├── backend/
│   ├── config/
│   │   └── .env
│   ├── controller/
│   │   └── auth.controller.js
│   ├── database/
│   │   └── connection.js
│   ├── middleware/
│   │   └── isAuthenticated.js
│   ├── models/
│   │   └── user.model.js
│   ├── routes/
│   │   └── auth.route.js
│   └── utils/
│       ├── emails/
│       │   ├── generateEmailTemplate.js
│       │   └── transporter.js
│       ├── generateJwtTokenAndSetCookie.js
│       └── sendEmail.js
└── index.js

Configuration

PORT=5000
MONGO_URI=mongodb+srv://<USERNAME>:<PASSWORD>@<CLUSTER>.mongodb.net/<DATABASE>
JWT_SECRET=<YOUR_JWT_SECRET>
JWT_EXPIRES_IN=7d
NODE_ENV=development
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_EMAIL=<YOUR_SMTP_EMAIL>
SMTP_PASSWORD=<YOUR_SMTP_PASSWORD>
FROM_NAME=<YOUR_NAME_OR_APP_NAME>
FROM_EMAIL=<YOUR_EMAIL>
Client_URI=http://localhost:3000

Contributing

  • Fork the repository
  • Create a new branch: git checkout -b my-feature-branch
  • Commit your changes: git commit -m 'Add new feature'
  • Push to the branch: git push origin my-feature-branch
  • Create a pull request
1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago