Skip to content

Conversation

@Nitesh-kumar27
Copy link

@Nitesh-kumar27 Nitesh-kumar27 commented Jun 27, 2025

πŸš€ Backend Authentication System – Trading Platform

πŸ“Œ Project Title

Core User Authentication System for a Trading Platform

πŸ‘¨β€πŸ’» Developer

Nitesh Kumar
Role: Backend Intern


🧠 Overview

This project is a backend user authentication system built for a proprietary trading evaluation platform. It allows users to register, log in, reset their passwords, and securely access protected routes using JWT authentication.


πŸ› οΈ Tech Stack

  • Node.js
  • Express.js
  • MongoDB + Mongoose
  • JWT (JSON Web Tokens)
  • dotenv

πŸ“ Folder Structure

backend/
β”œβ”€β”€ controllers/          # Handles logic for authentication
β”œβ”€β”€ routes/               # API routes (auth, user)
β”œβ”€β”€ models/               # Mongoose schema for User
β”œβ”€β”€ middleware/           # JWT verification middleware
β”œβ”€β”€ config/               # DB connection setup
β”œβ”€β”€ utils/                # Token utility functions
β”œβ”€β”€ server.js             # Entry point
└── .env                  # Environment configuration

✨ Features Implemented

πŸ” Authentication Endpoints

Endpoint Method Auth Required Description
/auth/register POST ❌ Register a new user
/api/auth/login POST ❌ User login and JWT generation
/auth/reset-password POST ❌ Request password reset
/auth/new-Password POST βœ… Set new password (with token)
/api/user/profile GET βœ… Get authenticated user profile
/ GET ❌ Health check route

βœ… What I Have Done

  • πŸ—οΈ Built a complete authentication system with user registration, login, reset password, and set new password flows.
  • πŸ”’ Implemented JWT-based authentication and route protection.
  • 🧩 Used MongoDB with a User model having fullName, email, password, and isEmailVerified fields.
  • πŸ“‚ Followed a modular project structure for controllers, routes, middleware, and config.
  • πŸ§ͺ Fully tested all endpoints using Postman. A collection file is included for reference.

πŸ§ͺ API Testing

  • Used Postman to test all routes.
  • Included a full test flow:
    • Register β†’ Login β†’ Get Profile (JWT Protected)
    • Reset Password β†’ Set New Password β†’ Login Again
  • βœ… The Postman Collection file is included:
    • backend-task-User-Auth.postman_collection.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant