📌 Backend API Endpoints Documentation
🔧 Base URL
[Link]
✅ Waitlist API
1. Join Waitlist
• Endpoint: POST /waitlist/join
• Description: Add a new user to the waitlist.
• Request Body:
{
"fname": "First Name",
"lname": "Last Name",
"email": "user@[Link]",
"role": "User's Role"
}
• Response:
{
"success": true,
"waitListEntry": { ...newly_created_entry }
}
2. Get Waitlist Entries
• Endpoint: GET /waitlist/list
• Description: Retrieve all users that have joined the waitlist.
• Response:
{
"success": true,
"waitlist": [ ...list_of_entries ]
}
1
✅ Authentication API
Method Endpoint Description
POST /auth/signup Register a new user
POST /auth/login Log in a user
POST /auth/logout Log out a user
✅ User Profile API
Method Endpoint Description
GET /users/profile/:username Get user profile info
POST /users/follow/:id Follow/Unfollow a user
POST /users/update Update user profile
✅ Property API
Method Endpoint Description
POST /property/create Create a property listing
GET /property/all Get all properties
GET /property/realtor Get properties for realtor
DELETE /property/:id Delete a property
PUT /property/:id Update a property
GET /property/search Search for properties
✅ Posts API
Method Endpoint Description
POST /posts/create Create a new post
GET /posts/all Retrieve all posts
2
✅ Download Badge API
Method Endpoint Description
GET /downloadBadge Generate personalized image badge
• Required Query Params:
• fname : First Name
• lname : Last Name
• role : User Role
Example:
/downloadBadge?fname=John&lname=Doe&role=Farmer
✅ Logging & Middlewares
• Logger Middleware: Captures and logs every request.
• Protect Route Middleware: Secures routes that require authentication.
✅ Server Setup Summary
• Port: 5000 (default)
• CORS: Enabled
• Cookie Parser: Enabled
• Static Files:
/images -> backend/public/images
✅ Deployment Notes for Dev Team
• Ensure environment variables are set in .env .
• MongoDB must be connected via the connectMongoDB() function.
• API endpoints follow REST principles.
If further documentation or Postman collections are needed, kindly notify the team lead.