Build Core Authentication System for a Trading Platform using Node.js, Express, and MongoDB
Youβre contributing to the backend development of a proprietary trading evaluation platform. This platform allows traders to register, complete simulated trading challenges, and qualify for funded trading accounts based on performance.
As a backend intern, your first assignment is to build the core user authentication system that will allow users to sign up, log in, reset their passwords, and securely access their accounts using JWT-based authentication.
You are required to implement the core user authentication system using a secure and modular approach. The backend must support user registration, login, password reset, and route protection using JWT tokens.
The goal is to create a clean, scalable, and production-ready authentication flow using industry standards.
- Node.js
- Express.js
- MongoDB + Mongoose
- JWT (JSON Web Tokens)
- dotenv (for environment variables)
- JWT-based login and route protection
- Token generation and verification
- Expiry handling and error responses
fullName
: Stringemail
: String (unique)password
: String (store in plain text for this task only)isEmailVerified
: Boolean
backend/
βββ controllers/
β βββ auth.controller.js
βββ routes/
β βββ auth.routes.js
βββ models/
β βββ user.model.js
βββ middleware/
β βββ auth.middleware.js
βββ utils/
βββ config/
βββ server.js
βββ .env
Endpoint | Method | Auth | Description |
---|---|---|---|
/api/auth/register |
POST | β | Signup with email & password |
/api/auth/login |
POST | β | Login with credentials |
/api/auth/reset-password |
POST | β | Request password reset |
/api/auth/new-password |
POST | β | Set new password |
/api/user/profile |
GET | β | Get authenticated user profile |
- Register β Login β Access Protected Route
- Reset password and login again
- Use Postman or ThunderClient to verify API working
- Password can be stored as plain text for this test (no hashing or email validation needed)
- Keep logic modular and follow separation of concerns
- Use clear naming and clean code
- Create a new branch in this repository.
- Push your code into the
backend/
directory. - Create a Pull Request (PR) to the
main
branch in this same repo with:- Your Full Name
- Your Role (e.g., Backend Intern)
- A short description of what you have implemented
- Optional: A short Loom/video demo of the API testing
Example PR Title:
[Backend Intern] Auth System Setup - John Doe
- β° 3 Days
- Focus on clean implementation, proper structure, and code readability
- Hardcoding config/secrets instead of using
.env
- Not validating input (basic checks required)
- Skipping route protection for private APIs
- Merging everything into one file β keep it modular