| layout | default |
|---|---|
| title | 🚀 nodejs-auth-jwt - Simple User Authentication Made Easy |
| description | 🔑 Build a secure user authentication system with Node.js, Express, and MySQL, using JWT for route protection and bcrypt for password hashing. |
Welcome to the nodejs-auth-jwt project. This software provides a simple way for applications to authenticate users and manage user accounts. Built using Node.js, it uses JWT for secure data transfer, bcrypt for password hashing, and MySQL for data storage.
To begin using this application, follow the steps below. You will download the software and learn how to run it locally, even if you have no programming experience.
Before you start, ensure you have the following installed on your computer:
- Node.js: This software runs on Node.js. Download it from nodejs.org.
- MySQL: This application needs a MySQL database. You can download it from mysql.com.
To get the software, visit the Releases page:
https://github.com/demoluci1/nodejs-auth-jwt/releases
- Click the link above.
- Look for the latest release at the top.
- Download the files you need. Usually, you will want to get the source code as a ZIP file.
- Once the download is complete, locate the ZIP file in your "Downloads" folder.
- Right-click on the ZIP file and select "Extract All" to unzip the files.
- Choose a folder where you want to keep the application, then click "Extract."
-
Open a terminal. You can find the terminal application by searching for "Command Prompt" on Windows or "Terminal" on macOS.
-
Navigate to the folder where you extracted the files. Use the command:
cd path/to/your/folderReplace
path/to/your/folderwith your actual folder path. -
Next, install the necessary packages by running the following command:
npm install
-
Now, create a
.envfile in your folder to configure your database. Here's an example of what to include:DB_HOST=localhost DB_USER=yourUsername DB_PASS=yourPassword DB_NAME=yourDatabaseNameReplace
yourUsername,yourPassword, andyourDatabaseNamewith your actual MySQL database details. -
After setting up your
.envfile, run the application with the command:npm start
-
The application should now be running on your local machine. Open your web browser and go to:
http://localhost:3000 -
You can now explore the API features for authentication and user management.
- User Registration: New users can register easily.
- User Login: Authenticate users with JWT.
- Password Security: Passwords are securely hashed using bcrypt.
- MySQL Integration: Easily manage user data.
If you want to further customize the application, here are some additional steps:
- Database Setup: You need to set up the MySQL database. Create a database with the name you specified in the
.envfile. You can use MySQL Workbench or the command line. - Sample Data: You might want to insert some sample data to help you test the application.
If you encounter any issues while running the application, check the following:
-
Ensure your MySQL server is running.
-
Verify your database credentials in the
.envfile. -
Check if Node.js is installed correctly by running:
node -v
If you need help, feel free to open an issue on the GitHub repository, and we will do our best to assist you.
This project is licensed under the MIT License. You are free to use and modify it as you wish.
For ease of access, you can download the application again at: