This is a basic user authentication system built using Node.js, Express, and MongoDB. It includes user registration and login functionalities.
- User registration with unique username and email
- User login with password validation
- Initial user creation for testing purposes
- Node.js
- Express.js
- MongoDB
- Mongoose
Make sure you have the following installed on your machine:
-
Clone the repository:
git clone https://github.com/Hiccupfish/UserAuthentication.git
2, Navigate to the project directory: cd UserAuthentication 3. Install the dependencies: npm install
Here's an example of a README.md file for your User Authentication System project:
markdown Copy code
This is a basic user authentication system built using Node.js, Express, and MongoDB. It includes user registration and login functionalities.
- User registration with unique username and email
- User login with password validation
- Initial user creation for testing purposes
- Node.js
- Express.js
- MongoDB
- Mongoose
Make sure you have the following installed on your machine:
-
Clone the repository:
git clone https://github.com/Hiccupfish/UserAuthentication.git
-
Navigate to the project directory:
cd UserAuthentication Install the dependencies:
npm install
- Configuration Make sure MongoDB is running on your machine. The default connection string in the project is:
mongodb://127.0.0.1:27017/UsersDatabase You can change this URI in the code if your MongoDB instance is running on a different address or port.
Running the Project
- Start the server: npm start The server will start on port 5000 by default. You can change the port by setting the PORT environment variable.
API Endpoints Register a new user: POST /register
Request body: { "username": "your_username", "email": "your_email", "password": "your_password" }