🎁 Some of My Projects
Interview Preparation App
API Endpoints

API Endpoint Documentation

1. Authentication (/api/auth)

MethodEndpointDescriptionExample Body/Params
POST/registerRegister a new user.{ "username": "john", "email": "john@mail.com", "password": "pass123" }
POST/loginLogin and receive JWT token.{ "username": "john", "password": "pass123" }
POST/forgot-passwordRequest password reset code via email.{ "emailOrUsername": "john" }
POST/reset-passwordReset password using code.{ "emailOrUsername": "john", "code": "123456", "newPassword": "newpass" }

2. Puzzles (/api/puzzles) (Community Marketplace: doesn't intregrate with frontend yet)

MethodEndpointDescriptionExample Body/Params
GET/marketplaceList approved puzzles (with filters).?category=JS&difficulty=easy&page=1&limit=10
GET/featuredList featured puzzles.
GET/filtersGet available puzzle filters.
GET/:idGet puzzle by ID.
POST/Create a new puzzle (auth required).{ "title": "...", "question": "...", ... }
GET/user/puzzlesGet puzzles created by the user.(auth required)
PUT/:idUpdate a puzzle (auth required).{ "title": "..." }
DELETE/:idDelete a puzzle (auth required).
POST/:id/answerSubmit an answer to a puzzle.{ "answer": "B" }
POST/:id/reviewAdd a review to a puzzle.{ "rating": 5, "comment": "Great!" }
POST/:id/reportReport a puzzle.{ "reason": "Inappropriate" }
GET/user/statsGet creator statistics (auth required).

3. Leaderboard (/api/leaderboard)

MethodEndpointDescriptionExample Body/Params
GET/globalGet global leaderboard.?sortBy=totalPoints&limit=10&page=1
GET/weeklyGet weekly leaderboard.
GET/monthlyGet monthly leaderboard.
GET/ranking/:usernameGet ranking for a user.
POST/challengeCreate a friend challenge (auth required).{ "challenged": "alice", ... }
PUT/challenge/:username/respondRespond to a challenge (auth required).{ "accepted": true }
GET/challenges/:usernameGet user's challenges (auth required).
GET/notifications/:usernameGet user notifications (auth required).
PUT/notifications/:username/:notificationId/readMark notification as read (auth required).
PUT/competition/:username/pointsUpdate competition points (auth required).{ "points": 100 }

4. Profile (/api/profile)

MethodEndpointDescriptionExample Body/Params
POST/Create a user profile (auth required).{ "username": "john" }
GET/:usernameGet profile by username.
PUT/:usernameReplace profile (admin only).{ "hintPoints": 10, ... }
PATCH/:usernameUpdate profile fields.{ "hintPoints": 20 }
PATCH/:username/wrong-answerAdd a wrong answer to profile.
DELETE/:usernameDelete profile (admin only).
POST/:username/daily-streakCheck and update daily streak.
GET/Get all profiles.

5. Transactions (/api/transactions)

MethodEndpointDescriptionExample Body/Params
POST/Create a transaction.{ "username": "john", "transactionId": "abc123", "selectedPackage": "pro" }
GET/Get all transactions (admin only).
PUT/:idUpdate transaction by ID (admin only).{ "status": "approved" }
PATCH/:idUpdate transaction by ID (admin only).{ "status": "faked" }
GET/user/:usernameGet all transactions for a user.

6. Chat (/api/chat)

MethodEndpointDescriptionExample Body/Params
GET/messages/:roomIdGet chat messages for a room.?page=1&limit=50
GET/history/:userIdGet user's chat history (auth required).?page=1&limit=20
DELETE/messages/:messageIdDelete a message (auth required).

7. Levels (/api/levels)

MethodEndpointDescriptionExample Body/Params
GET/Get all levels.
POST/Add a new level (admin only).{ "title": "...", ... }
PUT/:idUpdate a level (admin only).{ "title": "..." }
DELETE/:idDelete a level (admin only).

8. Survey (/api/survey)

MethodEndpointDescriptionExample Body/Params
POST/Submit a survey (auth required).{ "rating": 5, "happyIfClosed": true, "suggestion": "..." }
GET/summaryGet survey summary (public).
GET/allGet all survey responses (public).


© 2025 React JS Bangla Tutorial.