Tìm kiếm


    API Mocker AI — Generate Realistic Mock REST APIs with AI in Seconds


    Stop hand-crafting fake JSON. Paste your response structure, let AI generate realistic rows, and hit live endpoints — no backend required.

    The Problem Every Frontend Team Knows Too Well

    You're building a new feature. The designs are locked in, the Jira ticket is green, and you're ready to ship. There's just one problem: the backend isn't done yet.

    So you do what every frontend dev has done a thousand times — you open your editor and type const mockUser = { name: "John", email: "[email protected]" }. A week later your codebase is littered with fake arrays, your pagination is fake, your edge cases are fake, and none of it looks anything like production.

    Demo day arrives. Your screenshots are full of "foo", "bar", "test123". The stakeholder frowns. You know this feeling.

    What if your mock data looked exactly like production — names, emails, dates, prices that made sense — without you writing a single fixture?

    Introducing API Mocker AI

    API Mocker AI is an open-source, self-hosted web app that spins up realistic mock REST APIs using large language models. You paste a JSON shape, pick an AI provider (OpenAI, Gemini, or Grok), and in a few seconds you have live HTTP endpoints serving data that looks like it came straight from production.

    Think of it as an API spec with real data — the missing link between JSON Server (write your own data) and SaaS mock tools (pay monthly, lose control of your data).

    What It Does

    ⚡ Auto CRUD Endpoints

    Create one resource, get 5 endpoints for free — list, detail, create, update, delete.

    🤖 AI-Generated Data

    Paste a JSON shape, pick an AI provider, get 50 realistic rows — real names, plausible emails, sensible dates.

    🌐 Live HTTP Mock API

    Real HTTP methods, real status codes, real pagination — not a static file on disk.

    📄 Smart Pagination

    Auto-detects your shape (items, total, page) and serves paged responses without extra config.

    🔑 Bring Your Own Key

    OpenAI, Google Gemini, xAI Grok — swap freely. Keys encrypted at rest with AES-256-GCM.

    🌍 Multi-language UI

    English, Vietnamese, Chinese, Japanese out of the box via react-i18next.

    How It Stacks Up

    Here's an honest comparison with existing mock tools:

    Tool Data Generation Fake Data Quality Best For
    API Mocker AI AI from your JSON shape Realistic (LLM) Demo-quality mocks, fast iteration
    JSON Server You write fixtures Only what you type Quick local prototypes
    Mockoon Templating (Faker.js) Generic fake data Offline, stub rules, latency
    Postman Mock You write examples Only what you type Teams already in Postman
    Beeceptor / MockAPI.io Templates / faker Generic fake data Zero-setup public mocks
    WireMock Request matching Only what you stub Contract testing, edge cases

    The short version: JSON Server and Postman Mock make you write the data. Mockoon and WireMock shine at matching rules but give you Lorem Ipsum. API Mocker AI makes the opposite trade — weak on matching rules, strong on data that actually looks real.

    The Tech Behind It

    API Mocker AI is a clean-architecture monorepo built with modern, production-grade tooling:

    • Backend: Node.js · Express · TypeScript · Mongoose · Zod · JWT · bcryptjs · Helmet
    • Frontend: React 19 · Vite · TailwindCSS · Monaco Editor · react-i18next
    • Database: MongoDB 7
    • AI Providers: OpenAI · Google Gemini · xAI Grok (pluggable factory pattern)
    • Security: AES-256-GCM for API keys at rest · JWT access + refresh tokens · bcrypt password hashing
    • Infra: Docker · Docker Compose

    Getting Started in 60 Seconds

    You need Node 18+ and MongoDB 7+ (or Docker). Clone the repo and run:

    # One-shot with Docker Compose
    docker-compose up -d
    
    # Or run pieces separately
    cd backend && npm install && cp .env.example .env && npm run dev
    cd frontend && npm install && npm run dev

    Then open http://localhost:4002:

    1. First visit redirects to /setup — create your admin account.
    2. Head to /settings and paste your AI provider API key.
    3. Create a project, add a resource, paste your JSON shape, hit Generate.
    4. Call http://localhost:4000/mock// from your app.

    Who Should Try It

    • Frontend developers who are tired of waiting on APIs that aren't ready.
    • QA engineers who need reliable, realistic test data.
    • Solo devs prototyping ideas and MVPs at speed.
    • Teams building demos where screenshots need to look professional, not like a Lorem Ipsum generator.

    What's Next

    The roadmap is open. Upcoming work includes request-matching rules (return 500 when body has X), artificial latency / failure injection, OpenAPI spec import, and webhook simulation. If any of that excites you — contributions welcome. Issues, PRs, and ideas are all fair game.

    API Mocker AI is MIT-licensed and free forever. Self-hosted, your data on your infra, no vendor lock-in. The only cost is whatever your AI provider charges for tokens — and a typical resource generation costs less than a cent.

    ⭐ Star on GitHub  ·  ▶ Watch the Demo


    Tiểu sử
    Are you one or zero?


    Bình luận