🍸 Transform TypeScript type definitions into instant mock data using AI.
mockTail 🪄 is a web-based tool that generates mock data from TypeScript type definitions using AI models (OpenAI or Google's Gemini). Simply paste your type definitions and get test data for your development workflow instantly.
- Choose between OpenAI or Gemini for mock data generation.
- Type-safe output that follows your TypeScript definitions.
- Paste your TypeScript types and get structured mock data instantly.
- Supports nested objects, arrays, enums, and optional properties.
- Autosave generated mock data for future reference.
- Trash System: Deleted mock data is soft-deleted and moved to a trash bin instead of being lost forever.
- Restore Deleted Items: Accidentally deleted something? Restore it back to history.
- Permanent Deletion: Clean up by removing items from the trash forever.
- View your generated JSON data in a collapsible tree format.
- Expand/collapse nested objects and arrays for better readability.
- Quickly download the generated JSON to use in your projects.
- No installation required – works directly in your browser.
- Copy to Clipboard: One-click copy of mock data to use in your project.
- Enter Your API Key: Provide your OpenAI or Google Gemini API key in the designated field.
- Paste a Type Definition: For instance:
interface UserProfile { id: string; username: string; age: number; email: string; hobbies: string[]; }
- Select an AI Model (OpenAI or Gemini) to generate your data.
- Click "Generate" to instantly receive valid, realistic mock data:
{ "id": "123e4567-e89b-12d3-a456-426614174000", "username": "johndoe", "age": 25, "email": "johndoe@example.com", "hobbies": ["gaming", "hiking"] }
- Use the JSON Tree Viewer to inspect and expand nested structures.
- Copy or Download the JSON for direct use in your code.
- Manage previous generations in History, restore from Trash, or delete permanently.
- Every mock data generation automatically saves to history.
- If you delete an item, it moves to the Trash instead of being lost forever.
- Items in Trash can be:
- Restored back to history.
- Deleted permanently if no longer needed.
This ensures no accidental loss of important mock data while keeping your workspace clean.
-
Clone the repository:
git clone https://github.com/realabdullah/mocktail.git cd mocktail
-
Install dependencies:
npm install # or yarn install # or pnpm install
-
Start the development server:
npm run dev # or yarn dev # or pnpm dev
-
Open http://localhost:3000 in your browser.
Contributions are welome! If you have ideas for improvements, feel free to open an issue or submit a pull request.