Node.js Auth API
A secure RESTful API built with Node.js, Express, MongoDB, and JWT for user authentication. This project demonstrates backend fundamentals like user registration, login, protected routes, and token-based access control.
๐ง Tech Stack
Node.js
Express.js
MongoDB & Mongoose
JWT (JSON Web Token)
bcryptjs
dotenv
๐ Features
โ
User registration (
/api/auth/register)โ
User login with hashed passwords
โ
JWT-based token authentication
โ
Protected route (
/api/auth/profile)โ
Modular structure (routes, controllers, models)
โ
MongoDB connection via Mongoose
๐ ๏ธ Installation
.env Configuration
Running the API
Start in development mode
OR
Start in production mode
๐ฎ API Endpoints
Method Route Description Access POST /api/auth/register Register a new user Public POST /api/auth/login Login & get token Public GET /api/auth/profile Get user profile Protected
๐ Example Auth Header
๐ฌ Contact Built with โค๏ธ by Sunil Kumar Rao S
0 likes ยท 6 views ยท Oct 8, 2025
Developed a secure RESTful API for user authentication using Node.js and JWT.