Giter Site home page Giter Site logo

abhishekpaturkar / authentication-jsonwebtoken Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 27 KB

User authentication using Jsonwebtoken library in expressjs

JavaScript 67.64% EJS 32.36%
authentication authentication-backend ejs expressjs jsonwebtoken login-signup-page mongoose nodejs

authentication-jsonwebtoken's Introduction

User authentication using Jsonwebtoken

User Authentication with ExpressJS, Mongoose, JSON Web Token, and MongoDB

Description

This project provides a simple user authentication system with a login and sign-up page. It utilizes ExpressJS as the backend framework, Mongoose as the ODM (Object Data Modeling) library for MongoDB, the JSON Web Token (jsonwebtoken) library for secure user authentication, EJS (Embedded JavaScript) for rendering dynamic views on the frontend, and MongoDB as the database for storing user information.

Features

  • User Registration: Allows users to sign up with a unique username and password.
  • User Authentication: Validates user credentials during login using JSON Web Tokens.
  • Secure Password Storage: Safely stores user passwords using encryption techniques provided by Mongoose.
  • MongoDB Integration: Utilizes MongoDB as the database for storing user information.

Installation

  1. Clone the repository:

    git clone https://github.com/abhishekpaturkar/authentication-jsonwebtoken.git
  2. Navigate to the project directory:

    cd Auth
  3. Install dependencies:

    npm install
  4. Set up MongoDB:

    • Create a MongoDB database.
    • Update the MongoDB connection string in the db/db.js file.
  exports.connectMongoose = () => {
  mongoose
    .connect("MongoDBURL")
    .then((e) => console.log(`Conneccted to mongoDB: ${e.connection.host}`))
    .catch((e) => console.log(e));
};
  1. Start the server:

    npm run dev
  2. Open your browser and go to http://localhost:3000 to access the application.

Configuration

  • Add config.js file in main folder and add the KEY for your jsonwebtoken
// config.js

module.exports = {
  // Other configurations...
  KEY: 'YOUR-KEY',
};

Usage

  1. Open the application in your browser.
  2. Register a new user using the sign-up page.
  3. Log in with the registered user credentials.
  4. Explore and integrate the authentication system into your own projects.

Dependencies

  • ExpressJS: Minimalist web framework for Node.js.
  • Mongoose: MongoDB object modeling for Node.js.
  • jsonwebtoken: JSON Web Token implementation.
  • MongoDB: NoSQL database.
  • EJS: Embedded JavaScript templating.

License

This project is licensed under the MIT License.

Contributing

Feel free to contribute to the project by opening issues or submitting pull requests. Your feedback and suggestions are highly appreciated.

Acknowledgments

  • Special thanks to the authors and contributors of the dependencies used in this project.

Contact

For any questions or feedback, please contact [email protected].

Happy coding!

authentication-jsonwebtoken's People

Contributors

abhishekpaturkar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sng1402

authentication-jsonwebtoken's Issues

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.