Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

120 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fack API's Logo

🛠️ FACK API'S

A premium, self-hostable, node-based mock API platform for modern frontend & backend decoupled workflows.

Next.js TypeScript Tailwind CSS Drizzle ORM SQLite Docker License


Fack API's is a zero-configuration, self-hostable mock API platform designed to streamline decoupled software development. It functions as a flexible, high-fidelity mock backend that allows frontend and mobile teams to build and test code independently. With a graphical node canvas, a visual schema builder, custom chaos testing, and automatic TypeScript compilation, Fack API's accelerates your dev cycle from days to hours.


📸 Screenshots & Showcase

🗂️ Workspaces Dashboard
Workspaces Dashboard
🎨 Node-Based Canvas Designer
Node-Based Canvas Designer
⚙️ Workspace Settings & Safe Deletion
Workspace Settings

✨ Features

  • 🌐 Isolated Namespaces: Segment routes under individual projects and custom URL prefixes (e.g. /mock/project-slug/...).
  • 🎨 Visual Node Canvas: Design your endpoints graphically, customize HTTP methods, and simulate response pipelines with React Flow.
  • 🌳 Nested JSON Schema Builder: Build complex response bodies with deep nestings ("objects inside arrays of objects") without writing raw JSON.
  • 🎲 Faker.js Data Synthesizer: Connect any schema property to a rich library of data providers (names, images, finance, strings, addresses).
  • Chaos Testing Simulator: Inject randomized delays (min/max latency) and specify failure rates (e.g. 5% of queries fail with a 500 error) to test UI resilience.
  • 📁 Type Contract Exporter: Automatically compile client-side TypeScript interfaces (.d.ts files) directly from your visual schemas.
  • 🚀 Zero-Config Database: Backed by a high-performance local SQLite file wrapped in type-safe Drizzle ORM queries.
  • 🐳 Native Containerization: Light Alpine-based multi-stage Docker build ready for instant deployments with persistent volumes.

🏗️ Architecture

graph TD
    A["💻 Client / Frontend App"] -->|"1. API Request (/mock/:slug/*)"| D["🔀 Router / Proxy Layer"]
    B["🖥️ Dashboard UI"] -->|"Define Schema & Topology"| C[("sqlite SQLite Database")]
    C -->|"Sync & Load TOPOLOGY"| D
    D -->|"2. Match Route (path-to-regexp)"| E["🎲 Mock Engine (JSF + Faker.js)"]
    E -->|"3. Add Latency & Chaos Sim"| F["⚡ Delay / Error Injector"]
    F -->|"4. Return Payload / Code"| A

    style A fill:#4F46E5,stroke:#fff,stroke-width:2px,color:#fff
    style B fill:#10B981,stroke:#fff,stroke-width:2px,color:#fff
    style C fill:#0F172A,stroke:#fff,stroke-width:2px,color:#fff
    style D fill:#F59E0B,stroke:#fff,stroke-width:2px,color:#fff
    style E fill:#6366F1,stroke:#fff,stroke-width:2px,color:#fff
    style F fill:#EF4444,stroke:#fff,stroke-width:2px,color:#fff
Loading

🛠️ Technology Stack

Component Technology Role
Framework Next.js 16 (App Router) Runtime container, rendering, and API handler
Flow Canvas React Flow (v12) Topology graph canvas layout
UI Components Radix UI + Tailwind CSS v4 Clean interface styling and accessibility
State Manager Zustand + Immer Schema tree edits and node transformations
ORM Drizzle ORM Database schema mapping and DDL generation
Database SQLite (@libsql/client) Portable file-based storage engine
Mock Engine json-schema-faker + Faker.js Synthetic mock payload parser
Route Matcher path-to-regexp Fast Express-like matching
Type Compiler json-schema-to-typescript Compiles schema trees into raw .d.ts strings

🚀 Quick Start (Local Development)

Prerequisites

  • Node.js 20+
  • pnpm (v10+)

Step-by-Step Setup

  1. Clone the repository and enter the folder.
  2. Install dependencies:
    pnpm install
  3. Initialize the local database:
    mkdir data
    pnpm drizzle-kit push
  4. Boot the Next.js server:
    pnpm dev
  5. Open http://localhost:3000/dashboard to manage your projects.

🐳 Docker Deployment

To self-host Fack API's on your local network or server, you have two options:

Option A: Pull Pre-built Image from Docker Hub

You can pull and run the official pre-built image directly:

# Pull the Docker image
docker pull mkkatiyar277/fake-api:latest

# Run the container
docker run -d -p 3000:3000 -v fack-data:/app/data mkkatiyar277/fake-api:latest

Note: Replace latest with a specific version tag if needed.

Option B: Build and Run with Docker Compose

If you cloned the source repository and want to run it locally using Docker Compose:

  1. Spin up the container:

    docker compose up -d
  2. The dashboard will be accessible at http://localhost:3000.

  3. Database and project topologies are persisted in the fack-data volume.


📡 API Usage Example

If you create a project payment-service and add a GET /v1/customers/:customerId route:

curl -X GET http://localhost:3000/mock/payment-service/v1/customers/cust_9923

Response Payload:

{
  "id": "cust_9923",
  "name": "Jane Smith",
  "email": "jane.smith@example.com",
  "profile": {
    "avatar": "https://avatars.io/jane_smith",
    "jobTitle": "Lead System Architect"
  }
}

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A premium, self-hostable, node-based mock API platform for modern frontend & backend decoupled workflows.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Sponsor this project

Used by

Contributors

Languages