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 (includes variants)
PUT/api/products/[id]Update product (Admin only)
DELETE/api/products/[id]Delete product (Admin only)

Variants

GET/api/products/[id]/variantsList all variants for a product
POST/api/products/[id]/variantsCreate variant (Admin only)
PUT/api/products/[id]/variants/[variantId]Update variant (Admin only)
DELETE/api/products/[id]/variants/[variantId]Delete variant (Admin only)

Reviews

GET/api/products/[id]/reviewsList reviews with stats (public, paginated)
POST/api/products/[id]/reviewsCreate review (auth required, must have purchased)
DELETE/api/products/[id]/reviews/[reviewId]Delete review (owner or admin)

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)

Checkout & Payments

POST/api/checkoutProcess checkout
POST/api/payment-intentCreate Stripe payment intent
GET/api/shippingCalculate shipping cost

Subscriptions

GET/api/subscriptionsList user subscriptions
POST/api/subscriptionsCreate subscription
GET/api/subscriptions/[id]Get subscription by ID
PUT/api/subscriptions/[id]Update subscription
GET/api/plansList available plans

Apps (AI)

GET/api/appsList available AI apps
POST/api/apps/ai-chatAI Chat
POST/api/apps/ai-writingAI Writing Assistant
POST/api/apps/ai-codeAI Code Assistant
POST/api/apps/ai-emailAI Email Writer
POST/api/apps/ai-imageAI Image Generation
GET/api/apps/[id]/usageGet app usage for current user

Supplier / Dropshipping

GET/api/supplier/suppliersList suppliers (Admin only)
GET/api/supplier/mappingsList supplier-variant mappings (Admin only)
POST/api/supplier/mappingsCreate supplier-variant mapping (Admin only)
PUT/api/supplier/mappings/[id]Update mapping (Admin only)
DELETE/api/supplier/mappings/[id]Delete mapping (Admin only)
GET/api/supplier/ordersList supplier orders (Admin only)
GET/api/supplier/orders/[orderId]Get supplier order details
POST/api/supplier/retryRetry failed supplier order

Webhooks

POST/api/webhooks/stripeStripe webhook handler
GET/api/webhooks/stripe/checkVerify Stripe webhook config
POST/api/webhooks/stripe/testTest Stripe webhook (dev only)
POST/api/webhooks/supplierSupplier webhook handler

Health & System

GET/api/healthHealth check endpoint