Thanks to visit codestin.com
Credit goes to github.com

Skip to content

This project is evolving with my studies in Node.js, Express, and related technologies. My goal is to enhance its security, optimize its performance, and make it a robust and practical solution for anyone needing a login API using these tools

License

Notifications You must be signed in to change notification settings

ThiagoHG1/login-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Login System

This is a basic login system built with Node.js and Express, connected to a MySQL database. It provides functionalities for user registration, login, and account deletion.

Features

  • User Registration: Allows new users to register with a username, password, and email. Only valid email formats are accepted (e.g., Gmail, Yahoo).
  • User Login: Allows users to log in with their username and password.
  • Account Deletion: Allows users to delete their own account by providing their username and password.
  • Token Authentication: Implements token-based authentication to secure user sessions.
  • Password Encryption: Uses Argon2 for password hashing to enhance security.
  • Authorization: Ensures that users can only perform actions on their own accounts.
  • Protected Routes: Certain routes are protected and require a valid token for access.
  • Token Verification: Validates tokens to ensure secure access to protected routes.

Technologies Used

  • Node.js: JavaScript runtime environment for server-side code.
  • Express: Framework for building web applications.
  • MySQL: Relational database management system.
  • Argon2: Password hashing algorithm.
  • JWT (JSON Web Tokens): For authentication and session management.
  • dotenv: For loading environment variables from a .env file.

Installation

  1. Clone the repository:

    git clone https://github.com/ThiagoHG1/login-api.git
    cd login-api
    
  2. Install dependencies:

    npm install
    
  3. Configure environment variables:

    PORT=3000
    HOST=host
    USER=user
    PASSWORD=password
    DATABASE=database
    SECRET_KEY=your-strong-secret-key
    
  4. Start the server:

    npm start
    

Releases

You can find the release history and download the latest versions of this project from the Releases page.

  • Account Deletion: Allows users to delete their account by providing their username and password.

About

This project is evolving with my studies in Node.js, Express, and related technologies. My goal is to enhance its security, optimize its performance, and make it a robust and practical solution for anyone needing a login API using these tools

Resources

License

Stars

Watchers

Forks

Packages

No packages published