🚀 Consultancy API Server

Express.js MongoDB API with Admin Authentication

📋 Available Endpoints

🔐 Admin Authentication

  • POST /api/admin/login - Admin login
  • POST /api/admin/logout - Admin logout
  • GET /api/admin/profile - Get admin profile
  • PUT /api/admin/profile - Update admin profile

📄 Terms & Conditions

  • GET /api/terms - Get terms and conditions
  • PUT /api/terms - Update terms (Admin only)

🔒 Privacy Policy

  • GET /api/privacy - Get privacy policy
  • PUT /api/privacy - Update privacy policy (Admin only)

📝 Blog Management

  • GET /api/blogs - Get all blogs
  • GET /api/blogs/:id - Get single blog
  • GET /api/blogs/slug/:slug - Get blog by slug
  • POST /api/blogs - Create blog (Admin only)
  • PUT /api/blogs/:id - Update blog (Admin only)
  • DELETE /api/blogs/:id - Delete blog (Admin only)

⭐ Reviews Management

  • GET /api/reviews - Get all reviews
  • GET /api/reviews/stats - Get review statistics
  • GET /api/reviews/:id - Get single review
  • POST /api/reviews - Create review (Public)
  • PUT /api/reviews/:id - Update review (Admin only)
  • DELETE /api/reviews/:id - Delete review (Admin only)

🏥 System

  • GET /api/health - Health check

⚙️ Setup Instructions

  1. Create an admin user in MongoDB manually or through a script
  2. Use POST /api/admin/login to authenticate
  3. Include the JWT token in Authorization header: Bearer <token>
  4. Access protected endpoints with the token

✨ Features