Coder Social home page Coder Social logo

user-authentication-system's Introduction

User Authentication System Setup Guide

This guide will walk you through the installation process for setting up a user authentication system. The system uses React for the frontend and Node.js with Express for the backend. Additionally, it utilizes MongoDB as the database. Make sure you have Node.js and Git as well as mongoDB installed on your machine before proceeding.

Tools Used

Frontend:

  • React
  • react-router-dom
  • Axios

Backend:

  • Node.js
  • Express
  • nodemon
  • cors
  • email-validator
  • bcrypt
  • cookie-parser
  • dotenv
  • mongoose

Database:

  • MongoDB

Installation Process:

  1. Clone the repository: Open your terminal or command prompt and run the following command to clone the repository:

    git clone [email protected]:omkeshborse/user-authentication-system.git
    cd user-authentication-system
  2. Install backend dependencies: Change to the backend directory and install the required Node.js dependencies:

    cd backend
    npm install
  3. Install frontend dependencies: Now, navigate to the client directory and install the frontend dependencies:

    cd ../client
    npm install
  4. Create environment files: After installing the dependencies in both frontend and backend, you need to create environment files to store configuration settings.

    In the backend folder, create a .env file and add the following contents:

    PORT=8081
    MONGODB_URL=mongoDB_connection_string (without quotes) / mongodb_atlas_connection_string
    SECRET=SECRET
    CLIENT_URL=http://localhost:3000
    

    Replace mongoDB_connection_string with your MongoDB connection string. This will be used to connect the backend to the MongoDB database. Also, set a secret key for the JWT token generation by replacing SECRET with your desired secret key.

    In the frontend folder, create another .env file and add the following:

    REACT_APP_URL=http://localhost:8081
    
  5. Start the application: Now that everything is set up and configured, you can run the user authentication system. Open two terminal or command prompt windows, one for the backend and the other for the frontend.

    In the backend terminal, run the following command:

    cd ../backend
    npm start

    This will start the backend server using nodemon, which will automatically restart the server whenever you make changes to the backend code.

    In the frontend terminal, run the following command:

    cd ../client
    npm start

    This will start the development server for the React frontend.

  6. Access the application: The user authentication system should now be up and running. You can access it by navigating to http://localhost:3000 in your web browser.

That's it! You have successfully installed and set up the user authentication system using React for the frontend and Node.js with Express for the backend. Enjoy building secure user authentication features for your application!

user-authentication-system's People

Contributors

omkeshborse 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.