A backend authentication system built using the MERN stack, following MVC architecture, with RESTful APIs for user registration and login. The APIs are tested using Postman, and user data is stored in ongoDB.
- User Registration (Sign Up)
- User Login (Sign In)
- RESTful API design
- MVC (Model–View–Controller) architecture
- MongoDB database integration
- API testing using Postman
- Environment variable management using dotenv
Node.js – Backend runtime Express.js – Web framework MongoDB – NoSQL database Mongoose – ODM for MongoDB Postman – API testing Git & GitHub – Version control Nodemon – Development tool
mern-backend-auth/
│
├── index.js
├── package.json
├── README.md n
│
├── config/
│ └── db.js
│
├── models/
│ └── User.js
│
├── controllers/
│ └── authController.js
│
├── routes/
│ └── authRoutes.js
│
└── .env
bash git clone https://github.com/prachi-sonii/mern-backend-auth.git cd mern-backend-auth
bash npm install
env: PORT=5000 MONGO_URI=mongodb://127.0.0.1:27017/mern_auth
bash:
npm run dev
Server will start at:
POST /api/auth/register
Request Body (JSON):
json { "name": "John Doe", "email": "john@gmail.com", "password": "123456" }
POST /api/auth/login
Request Body (JSON):
json { "email": "john@gmail.com", "password": "123456" }
Client (Postman / Frontend) ↓ Routes (Express) ↓ Controllers (Business Logic) ↓ Models (Mongoose) ↓ MongoDB Database ↓ Response to Client
- APIs tested using Postman
- Verified responses and database insertion
- MongoDB data verified using MongoDB Compass
- Understood and implemented MVC architecture
- Built RESTful APIs using Express
- Connected backend to MongoDB using Mongoose
- Debugged real-world backend issues
- Used Git & GitHub for project versioning