✅ Live URL: https://advert-platform-backend.onrender.com
This is the Advert Platform Backend — an Express + Node.js + MongoDB app for creating and managing advertisements. Vendors can register and post ads, including external media URLs (no direct uploads), and visitors can view these ads.
- User Registration (Email or Username + Password).
- User Login (Email or Username + Password).
- Publicly Viewable Ads (
GET /api/ads). - Create, Edit, and Delete Ads (Vendor Role).
- Media added via external URLs.
- POST
/api/register: Register a new user- Body example:
{ "name": "John", "email": "john@example.com", "username": "johnny", "phoneNumber": "123456789", "password": "securepass", "role": "vendor" }
- Body example:
- POST
/api/login: Login (Email OR Username + Password)
- GET
/api/ads: Get All Ads - GET
/api/ads/{id}: Get Specific Ad by ID - POST
/api/ads: Create an Ad (Vendor Only)
Send JSON:
{
"title": "Matte Lipstick",
"category": "beauty",
"price": 25,
"description": "Long-lasting matte lipstick",
"media": ["https://www.istockphoto.com/photo/matte-lipstick-makeup-image.png"]
}