The digital twin of your backend.
DoppelAPI is a powerful CLI tool that instantly converts your OpenAPI (Swagger) definition into a fully functional, intelligent mock server.
It is designed to solve the age-old problem in software development: Frontend developers waiting for backend APIs to be implemented.
With DoppelAPI, you create a "Digital Twin" of your future backend. It reads your API contract (OpenAPI file) and spawns a server that behaves exactly like the real thing—populating responses with realistic, smart data automatically.
- Unblock Frontend Teams: Start building UI components immediately using the agreed-upon API contract. No more "mocking hardcoded JSONs" in your codebase.
- Smart & Realistic Data: Instead of returning
stringornull, DoppelAPI uses AI-driven Faker.js integration to return real names, emails, addresses, and images based on your schema. - Test Edge Cases: Simulate slow networks (latency) or server crashes (chaos mode) with a single flag to ensure your app handles errors gracefully.
- Self-Documenting: Includes a beautiful Visual Dashboard that serves as live documentation for your team, complete with copy-pasteable request/response examples.
DoppelAPI doesn't just serve static files. It understands your OpenAPI schema and generates data on the fly.
- Dynamic Data: Every request returns fresh, varied data. It feels like a real database.
- Schema Compliant: If your schema defines a field as a
UUIDor anemail, DoppelAPI ensures the response matches perfectly. - Zero Config: No need to write manual mock scripts. It works straight out of the box with your existing definition file.
Knowing what to send to an API is half the battle. DoppelAPI removes the guesswork.
- Visual Examples: The built-in Dashboard displays precise JSON Request Bodies for every endpoint. Just copy and paste into your app.
- Postman Ready: Export the entire API collection to Postman in one click, pre-configured with variable URLs and paths.
- CORS Solved: Forget about CORS errors during development. DoppelAPI handles headers automatically, so your frontend calls just work.
- Instant Mock Server: Turn any valid OpenAPI 3.0+ file (YAML or JSON) into a running server instantly.
- Smart Data Generation: Uses
json-schema-fakerand@faker-js/fakerto generate realistic data.- Supports
x-fakerschema extensions for precise control (e.g. usernames, emails, avatars).
- Supports
- Visual Dashboard: A beautiful web interface to view endpoints, request/response examples and documentation.
- Postman Export: One-click export of your mock API as a Postman Collection.
- Hot Reload: Automatically watches your OpenAPI file and restarts the server on changes.
- Network Simulation: Simulate network latency (500-1500ms) to test loading states.
- Chaos Mode: Simulate server instability with random 500 errors (10% chance) to test error handling.
- CORS Enabled: Automatically handles CORS headers, allowing access from any frontend application.
- Docker Support: Run explicitly in a containerized environment for consistent testing.
- Interactive CLI: User-friendly wizard to auto-discover files and configure options.
npm install -g doppelapiSimply run the command without arguments to launch the wizard:
doppelapiThe interactive menu will auto-discover OpenAPI files in your directory, or let you provide a custom path:
? Select an OpenAPI file (or choose custom path):
> openapi.yaml
ecommerce.json
Enter custom path manually...
# Basic usage
doppelapi start ./openapi.yaml --port 3000
# Basic usage with custom port
doppelapi start /Users/sametuca/Desktop/example.json --port 8080
doppelapi start /Users/sametuca/Desktop/example.yaml --port 8080
# Enable Hot Reload
doppelapi start ./openapi.yaml --watch
# Enable Network Latency Simulation
doppelapi start ./openapi.yaml --delay
# Enable Chaos Mode (Random 500 Errors)
doppelapi start ./openapi.yaml --chaos
# Combine flags
doppelapi start ./ecommerce.json --watch --delay --chaosYou can run DoppelAPI as a Docker container:
docker build -t doppelapi .
docker run -p 3000:3000 -v $(pwd)/openapi.yaml:/app/openapi.yaml doppelapi start /app/openapi.yamlYou can control the generated data by adding x-faker properties to your OpenAPI schema:
User:
type: object
properties:
id:
type: string
format: uuid
x-faker: "string.uuid"
email:
type: string
x-faker: "internet.email"
avatar:
type: string
x-faker: "image.avatar"- Clone the repository
git clone https://github.com/sametuca/doppelapi
- Install dependencies
npm install
- Run in development mode
npm run dev
MIT


