This project demonstrates basic user authentication using the MERN stack (MongoDB, Express.js, React.js, Node.js).
The project repository is organized into two main folders:
backend
: Contains the backend server code developed using Node.js and Express.js.frontend
: Contains the frontend client code developed using React.js.
To set up this project on your local machine, follow these steps:
Before you begin, make sure you have the following installed on your machine:
- Node.js: You can download and install Node.js from nodejs.org.
- MongoDB: You can download and install MongoDB from mongodb.com.
-
Clone the repository:
git clone https://github.com/yasirupanduka99/MERN_Auth_Yasiru.git
-
Navigate to the project directory:
cd MERN_Auth_Yasiru
-
Backend Setup:
cd backend
-
Create a
.env
file in thebackend
directory and add the following variables:PORT=5000 MONGO_URL=<your_mongo_db_connection_string> SECRET_TOKEN=<your_secret_token>
-
Install dependencies:
npm install
-
Start the backend server:
npm start
-
-
Frontend Setup:
cd ../frontend
-
Install dependencies:
npm install
-
Start the frontend development server:
npm start
-
-
Access the application:
Once the backend and frontend servers are running, you can access the application in your web browser at http://localhost:3000.
This project is licensed under the MIT License. See the LICENSE file for details.