← All Project Ideas

API Mock Server Generator

intermediate

A tool that generates mock API servers from OpenAPI specs or custom definitions with realistic data, delayed responses, and stateful behavior. Supports scenario switching, request logging, and CORS...

Target user

Frontend developers who need mock APIs for development

Problem

Frontend developers need mock APIs that match the real API contract for development before the backend is ready, with realistic data and stateful behavior.

Requirements

  • Generate mock server from OpenAPI spec
  • Produce realistic mock data with faker
  • Support stateful mock behavior
  • Switch between mock scenarios
  • Log and inspect mock requests

Core technologies

TypeScript, Express, Faker

Completion criteria

Developers can generate mock API servers from specs with realistic data, stateful behavior, and scenario switching.

Optional extensions

  • Add WebSocket mocking
  • Implement error simulation
  • Add GraphQL mocking
  • Support proxy fallback

Project phases

Phase 1: Phase 1: Spec to Mock

Tasks: Set up Express project, Parse OpenAPI spec for endpoints, Generate mock data with Faker, Build route handlers

Phase 2: Phase 2: Stateful Behavior

Tasks: Implement in-memory state store, Add CRUD stateful mocking, Build scenario switching, Create request logging

Phase 3: Phase 3: Polish and Integration

Tasks: Add CORS support, Implement response delays, Create admin dashboard, Add CLI configuration