Next.js Backend API

RESTful API Server running on port 5000

✓ Server Running
📦 View Products (Paginated)🛡️ Admin Security Dashboard

Authentication

POST/api/auth/loginUser login
POST/api/auth/registerUser registration
POST/api/auth/logoutUser logout
GET/api/auth/meGet current user
PUT/api/auth/profileUpdate user profile
POST/api/auth/refreshRefresh access token
POST/api/auth/forgot-passwordRequest password reset
POST/api/auth/reset-passwordReset password with token

Admin

POST/api/auth/admin/loginAdmin login
GET/api/auth/admin/usersGet all users (Admin only)
GET/api/admin/statsGet admin statistics

Products

GET/api/productsGet products list with filters
POST/api/productsCreate product (Admin only)
GET/api/products/[id]Get product by ID or slug
PUT/api/products/[id]Update product (Admin only)
DELETE/api/products/[id]Delete product (Admin only)

Categories

GET/api/categoriesGet all categories
POST/api/categoriesCreate category (Admin only)
DELETE/api/categories/[id]Delete category (Admin only)

Orders

GET/api/ordersGet orders list (user's own or all for admin)
POST/api/ordersCreate order
GET/api/orders/[id]Get order by ID
PUT/api/orders/[id]Update order status

Blog

GET/api/blogList blog posts
POST/api/blogCreate blog post (Admin only)
GET/api/blog/[id]Get blog post by ID or slug
PUT/api/blog/[id]Update blog post (Admin only)
DELETE/api/blog/[id]Delete blog post (Admin only)

Projects

GET/api/projectsList projects (public)
POST/api/projectsCreate project (Admin only)
GET/api/projects/[id]Get project by ID
PUT/api/projects/[id]Update project (Admin only)
DELETE/api/projects/[id]Delete project (Admin only)

Services

GET/api/servicesList services (public - only active)
POST/api/servicesCreate service (Admin only)
GET/api/services/[id]Get service by ID
PUT/api/services/[id]Update service (Admin only)
DELETE/api/services/[id]Delete service (Admin only)

Contact

POST/api/contactCreate contact message (public, rate limited)
GET/api/contactList contact messages (Admin only)
GET/api/contact/[id]Get contact message by ID (Admin only)
PUT/api/contact/[id]Update contact message (Admin only)
DELETE/api/contact/[id]Delete contact message (Admin only)
POST/api/contact/[id]/replyReply to contact message (Admin only)
GET/api/contact/[id]/conversationGet conversation history (Admin only)

Messages

GET/api/messagesGet user messages (authenticated) or all messages (admin)
POST/api/messagesCreate user message (Admin can send to users, Users can send to admins)
GET/api/messages/[id]Get message by ID
PUT/api/messages/[id]Update message (mark as read)
DELETE/api/messages/[id]Delete message (Soft delete)
POST/api/messages/[id]/seenMark message as seen (User only)

Returns

GET/api/returns/requestGet return requests (user's own or all for admin)
POST/api/returns/requestCreate return request
PUT/api/returns/requestUpdate return status (Admin only)

Health & System

GET/api/healthHealth check endpoint