{
  "name": "Literaire Milestone",
  "description": "India's first literary creator economy — a book marketplace and creator platform where readers, authors, and content creators connect, collaborate, and earn.",
  "url": "https://www.literairemilestone.com",
  "platform_url": "https://www.literairemilestone.com/platform",
  "version": "2.0",
  "created_by": "Farah Naaz",
  "organization": "Literaire Milestone Book House",
  "contact": {
    "email": "lmbhfarah@gmail.com",
    "whatsapp": "+91 7304833964",
    "instagram": "https://www.instagram.com/literaire.milestonebh/"
  },
  "capabilities": [
    {
      "name": "Book Marketplace",
      "description": "Buy books directly from Indian authors with UPI payment. Free delivery across India.",
      "endpoint": "https://www.literairemilestone.com/#books",
      "actions": ["browse_books", "add_to_cart", "checkout", "track_order"]
    },
    {
      "name": "Creator Platform",
      "description": "Creators can register, browse books, submit reviews and reels, and earn based on engagement metrics.",
      "endpoint": "https://www.literairemilestone.com/platform",
      "actions": ["register_creator", "browse_catalog", "submit_review", "get_ai_brief", "track_earnings", "request_withdrawal"]
    },
    {
      "name": "Author Dashboard",
      "description": "Authors can manage their books, view analytics, collaborate with creators, and launch book events.",
      "endpoint": "https://www.literairemilestone.com/platform/author/dashboard",
      "actions": ["manage_books", "view_analytics", "collab_studio", "launch_events", "create_challenges"]
    },
    {
      "name": "AI Content Brief Generator",
      "description": "Generates structured content briefs for creators reviewing books — including angles, themes, hashtags, talking points, and hook ideas.",
      "endpoint": "https://www.literairemilestone.com/api/platform/books/{id}/brief",
      "method": "GET",
      "auth": "Bearer token required",
      "actions": ["generate_brief"]
    },
    {
      "name": "Milestone Press",
      "description": "Community-driven publishing pipeline. Readers submit story ideas, vote on concepts, authors write commissioned works.",
      "endpoint": "https://www.literairemilestone.com/platform/press",
      "actions": ["submit_story_idea", "vote_on_idea", "submit_manuscript"]
    }
  ],
  "api": {
    "base_url": "https://www.literairemilestone.com/api",
    "platform_base_url": "https://www.literairemilestone.com/api/platform",
    "authentication": "Bearer token (Base64 encoded JSON)",
    "endpoints": [
      {
        "path": "/platform/auth/register",
        "method": "POST",
        "description": "Register a new user as reader, creator, or author",
        "body": { "name": "string", "email": "string", "password": "string", "role": "reader|creator|author", "username": "string (creator only)" }
      },
      {
        "path": "/platform/auth/login",
        "method": "POST",
        "description": "Login and receive auth token",
        "body": { "email": "string", "password": "string" },
        "returns": { "token": "string", "user": "object", "profile": "object" }
      },
      {
        "path": "/platform/books",
        "method": "GET",
        "description": "List all books in catalog with optional filters",
        "params": { "genre": "string", "accessTier": "free|paid|monthly_free", "search": "string" }
      },
      {
        "path": "/platform/books/{id}/brief",
        "method": "GET",
        "description": "Generate AI content brief for a specific book",
        "auth": "required",
        "returns": { "book": "object", "brief": { "angles": "array", "themes": "array", "hashtags": "array", "talking_points": "array", "hook_ideas": "array", "cta": "string" } }
      },
      {
        "path": "/platform/content",
        "method": "POST",
        "description": "Submit new creator content for review",
        "auth": "required",
        "body": { "bookId": "string", "contentType": "review|summary|reel|discussion", "title": "string", "body": "string", "platform": "instagram|youtube|tiktok|internal", "externalUrl": "string" }
      },
      {
        "path": "/platform/content/{id}/engagement",
        "method": "POST",
        "description": "Sync engagement metrics from social platforms and calculate earnings",
        "body": { "platform": "string", "url": "string" },
        "returns": { "views": "number", "likes": "number", "shares": "number", "estimatedEarnings": "number" }
      },
      {
        "path": "/platform/earnings",
        "method": "GET",
        "description": "Get creator earnings summary and transaction history",
        "auth": "required",
        "returns": { "totalEarnings": "number", "pendingEarnings": "number", "thisMonth": "number", "transactions": "array" }
      },
      {
        "path": "/platform/earnings/withdraw",
        "method": "POST",
        "description": "Request withdrawal to UPI ID",
        "auth": "required",
        "body": { "amount": "number", "upiId": "string" }
      },
      {
        "path": "/platform/story-ideas",
        "method": "GET",
        "description": "List community story ideas sorted by votes"
      },
      {
        "path": "/platform/story-ideas/{id}/vote",
        "method": "POST",
        "description": "Toggle vote on a story idea",
        "auth": "required"
      },
      {
        "path": "/platform/creators/me",
        "method": "GET",
        "description": "Get current creator profile",
        "auth": "required"
      },
      {
        "path": "/platform/creators/me",
        "method": "PATCH",
        "description": "Update creator profile bio and social links",
        "auth": "required"
      },
      {
        "path": "/platform/notifications",
        "method": "GET",
        "description": "Get notifications for current user",
        "auth": "required"
      },
      {
        "path": "/products",
        "method": "GET",
        "description": "Get all books available for purchase in the marketplace"
      },
      {
        "path": "/submit-order",
        "method": "POST",
        "description": "Submit a new book purchase order with UPI UTR verification",
        "body": { "customerName": "string", "phone": "string", "email": "string", "address": "string", "city": "string", "state": "string", "pin": "string", "items": "array", "grandTotal": "number", "utrId": "string", "paymentMethod": "string" }
      },
      {
        "path": "/admin/orders",
        "method": "GET",
        "description": "Get all orders (admin only)"
      },
      {
        "path": "/update-order-status",
        "method": "POST",
        "description": "Update order status and notify customer via email",
        "body": { "orderId": "string", "status": "Pending|Confirmed|Shipped|Delivered|Cancelled" }
      }
    ]
  },
  "tech_stack": {
    "framework": "Next.js 15 with App Router",
    "language": "TypeScript",
    "database": "PostgreSQL (Neon) via Prisma ORM",
    "storage": "Cloudinary for images",
    "email": "Nodemailer with Gmail SMTP",
    "payments": "Manual UPI (GPay, PhonePe) with UTR verification",
    "deployment": "Vercel",
    "mobile": "React Native with Expo (Android)",
    "analytics_backup": "Google Sheets via googleapis"
  },
  "earnings_formula": {
    "description": "Creator earnings calculated on engagement",
    "formula": "earnings = (views/1000 * 50) + (likes * 0.5) + (shares * 2)",
    "platform_commission": "30%",
    "creator_share": "70%",
    "tiers": {
      "bronze": { "min_content": 0, "max_books": 3 },
      "silver": { "min_content": 10, "max_books": 10 },
      "gold": { "min_content": 25, "max_books": 25 },
      "milestone": { "min_content": 50, "max_books": "unlimited" }
    }
  },
  "books": [
    { "title": "Just a Flight Away", "author": "Farah Naaz", "genre": "Fiction", "price": 299 },
    { "title": "Dumbass to Kickass", "author": "Farah Naaz", "genre": "Self-Help", "price": 349 },
    { "title": "Not My Circus Always My Monkeys", "author": "Farah Naaz", "genre": "Humor", "price": 299 },
    { "title": "Silent Threads: Unclaimed Yet Eternal", "author": "Rajani Tewari", "genre": "Fiction" },
    { "title": "Confessions of a Hitman", "author": "Mahidhar K.S.S.", "genre": "Mystery & Thriller" },
    { "title": "Sherlock Holmes: The Master Plan", "author": "Mahidhar K.S.S.", "genre": "Mystery & Thriller" },
    { "title": "Super Nine Part 1: Ghosts of London", "author": "Mahidhar K.S.S.", "genre": "Mystery & Thriller" },
    { "title": "Shadowbound: An Indian Superhero Thriller", "author": "Nikhil Sampath", "genre": "Fiction" },
    { "title": "When Sakura Blooms", "author": "Nikhil Sampath", "genre": "Fiction" },
    { "title": "Book of Nightmares", "author": "Masih Rahmani", "genre": "Horror" },
    { "title": "The Headless Haunter", "author": "Masih Rahmani", "genre": "Horror" },
    { "title": "The Replaced Groom", "author": "S. C. Jain", "genre": "Romance" },
    { "title": "Heal my Heart", "author": "S. C. Jain", "genre": "Romance" },
    { "title": "The Girl Who Loved Too Loudly", "author": "Avi Sawhney", "genre": "Poetry" },
    { "title": "The Ideaa of You", "author": "Avi Sawhney", "genre": "Poetry" },
    { "title": "Wish I Were Dead", "author": "Avi Sawhney", "genre": "Poetry" }
  ],
  "authors": [
    { "name": "Farah Naaz", "role": "Founder & CEO", "genre": "Fiction, Self-Help, Humor" },
    { "name": "Rajani Tewari", "pen_name": "Ms. Zen", "genre": "Literary Fiction" },
    { "name": "Mahidhar K.S.S.", "genre": "Mystery & Thriller", "accolades": "Two-time Amazon Bestseller, published in 8 countries" },
    { "name": "Nikhil Sampath", "genre": "Literary Fiction", "accolades": "#1 Amazon in Asian Myth & Legend" },
    { "name": "Masih Rahmani", "genre": "Horror & Dark Fiction", "accolades": "Amazon Bestseller, 20-year-old author from Kolkata" },
    { "name": "S. C. Jain", "genre": "Romance", "accolades": "Amazon Bestseller 2026" },
    { "name": "Avi Sawhney", "genre": "Poetry", "instagram": "@authoravisawhney" }
  ],
  "permissions": {
    "allowed_agents": ["*"],
    "rate_limit": "100 requests per minute",
    "data_usage": "Public catalog data freely readable. User data requires auth token.",
    "commercial_use": "Contact lmbhfarah@gmail.com for licensing"
  }
}
