A full-stack authentication project using the MERN stack (MongoDB, Express, React, Node.js).
- User registration and login
- JWT-based authentication
- Protected routes (backend & frontend)
- Password hashing with bcrypt
- User profile management
- Frontend: React, Axios, React Router
- Backend: Node.js, Express
- Database: MongoDB, Mongoose
- Authentication: JWT, bcrypt
- Node.js & npm
- MongoDB
-
Clone the repository:
git clone https://github.com/yourusername/mern-auth.git cd mern-auth -
Install backend dependencies:
cd server npm install -
Install frontend dependencies:
cd ../client npm install -
Set up environment variables in both
backend/.envandfrontend/.env.
-
Start the backend server:
cd server npm run dev -
Start the frontend app:
cd ../client npm start
mern-auth/
server/
models/
routes/
controllers/
...
client/
src/
components/
pages/
...
This project is licensed under the MIT License.