Code Monkey home page Code Monkey logo

node-auth's Introduction

node-auth

Welcome to node-auth! This project is designed to provide a foundation for handling user authentication and registration for my own apps using Express.js. It uses JSON Web Tokens (JWT) for secure authentication and provides functionalities for user registration, email verification, login, and protected routes (its a simple project, for educational purposes only, don't use in prod.).

Features

  • User registration with email verification
  • User login with JWT-based authentication
  • Protected routes for authorized users
  • Dynamic route loading for modular route management
  • Basic HTML frontend for user interactions
  • Local SQlite database

Setup

  1. Clone the repository to your local machine:

    git clone https://github.com/pingwiniu/node-auth.git
  2. Install the required dependencies:

    npm install
  3. Run a local SMTP server.

  4. Set up SMTP configuration as specified in the code.

Usage

  1. Run the application:

    node server.js
  2. Access the application in your web browser:

Routes

  • /: Landing page.
  • /login: Login page.
  • /register: Registration page.
  • /panel: User panel page (protected; requires authentication).
  • /api/v1/auth/login: User login route.
  • /api/v1/auth/register: User registration route.
  • /api/v1/auth/verify/:token: Email verification route.
  • /api/v1/user/info: Information about a user.
  • You can add more routes by adding folders, the folder tree defines the url path and the file name defines the path ending.

License

This project is licensed under the GNU General Public License (GPL) Version 3. For more details, see the LICENSE file.

node-auth's People

Contributors

pingwiniu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.