Skip to content

tacheraSasi/mockwails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MockWails

MockWails Logo

A powerful desktop application for creating and managing mock HTTP servers

Go Version Wails React TypeScript License

About

MockWails is a comprehensive desktop application designed for developers, testers, and API designers who need to create and manage mock HTTP servers efficiently. Built with modern technologies including Wails v2, Go, and React, it provides a seamless experience for API mocking and testing.

Why MockWails?

  • πŸš€ Fast & Lightweight: Native desktop pericnoformance with minimal resource usage
  • 🎯 Developer-Friendly: Intuitive interface designed by developers, for developers
  • ⚑ Instant Setup: Create and deploy mock servers in seconds
  • πŸ”§ Highly Configurable: Fine-tune every aspect of your mock responses
  • πŸ’Ύ Persistent Storage: All configurations saved locally with SQLite
  • πŸ”„ Auto-Recovery: Servers automatically restart when the application launches
  • 🌐 Multi-Platform: Available for Windows, macOS, and Linux

The application allows you to define sophisticated mock servers with specific endpoints, HTTP methods, response statuses, custom headers, and response bodies. All configurations are persisted in a local SQLite database, ensuring your mock setups are preserved across application restarts. Active servers are automatically restarted when the application launches, making it perfect for development workflows.

✨ Features

Core Functionality

  • πŸ—οΈ Create and Manage Mock Servers: Intuitive interface for creating, editing, and deleting mock servers with comprehensive configuration options
  • 🎨 Customizable Responses: Full control over HTTP responses including:
    • Custom endpoints and HTTP methods (GET, POST, PUT, DELETE, PATCH)
    • Configurable status codes (200, 404, 500, etc.)
    • Custom headers and response bodies (JSON, XML, HTML, plain text)
    • Request validation with expected headers and body matching
    • Simulated response latency for realistic testing
  • πŸ’Ύ Persistent Storage: All mock server configurations are automatically saved to a local SQLite database
  • πŸ”„ Automatic Restart: Active servers intelligently restart when the application launches, maintaining your development workflow
  • 🎯 Easy to Use UI: Clean, modern, and intuitive user interface with dark/light theme support

Advanced Features

  • πŸ“Š Real-time Status Monitoring: Live status indicators showing which servers are running
  • πŸ” Request Inspection: Monitor incoming requests to your mock servers
  • ⚑ Quick Actions: Start, stop, edit, and delete servers with single-click actions
  • πŸ”„ Bulk Operations: Manage multiple servers simultaneously
  • πŸ“± Responsive Design: Optimized interface that works perfectly on any screen size
  • 🎨 Modern UI Components: Built with Shadcn UI for consistency and accessibility

Developer Experience

  • πŸš€ Hot Reload: Instant updates during development
  • πŸ“ TypeScript Support: Full type safety across the entire application
  • πŸ§ͺ Testing Ready: Perfect for API testing, frontend development, and CI/CD pipelines
  • πŸ”§ Extensible: Clean architecture for easy customization and extension

πŸ–ΌοΈ Screenshots

Main Interface - Server Management Dashboard

Overview of all your mock servers with real-time status monitoring MockWails Main Interface

Mock Server Creation - Comprehensive Configuration

Detailed form for creating sophisticated mock endpoints with full customization Create Mock Server

Server Management - Live Operations

Real-time server control with start, stop, edit, and delete operations Server Management

Settings & Configuration - Personalization

Customize the application behavior and preferences to fit your workflow Settings


πŸš€ Getting Started

Prerequisites

Quick Start

  1. Clone the repository:

    git clone https://github.com/tacheraSasi/mockwails.git
    cd mockwails
  2. Install dependencies:

    make deps
  3. Run in development mode:

    make dev
  4. Build for production:

    # For your current platform
    wails build
    
    # Or use make commands for specific platforms
    make build-mac      # macOS universal binary
    make build-windows  # Windows 64-bit
    make build-linux    # Linux 64-bit

Usage Examples

Creating Your First Mock Server

  1. Launch MockWails and click "Create Mock Endpoint"
  2. Configure your endpoint:
    • Name: "User API"
    • Endpoint: "/api/users"
    • Method: "GET"
    • Response: {"users": [{"id": 1, "name": "John Doe"}]}
    • Status Code: 200
  3. Click "Create" - your mock server starts automatically
  4. Test it: Visit http://localhost:8080/api/users in your browser

Advanced Configuration

{
  "endpoint": "/api/users",
  "method": "POST",
  "expectedHeaders": {
    "Content-Type": "application/json",
    "Authorization": "Bearer token"
  },
  "expectedBody": {
    "name": "string",
    "email": "string"
  },
  "response": {
    "status": 201,
    "headers": {
      "Content-Type": "application/json"
    },
    "body": {
      "id": 123,
      "message": "User created successfully"
    }
  },
  "latency": 500
}

πŸ› οΈ Tech Stack

Backend

  • Go: High-performance backend with excellent concurrency
  • Wails v2: Modern desktop app framework bridging Go and web technologies
  • SQLite: Embedded database for configuration persistence
  • GORM: Elegant ORM for database operations

Frontend

  • React 18: Modern UI library with hooks and concurrent features
  • TypeScript: Type safety and enhanced developer experience
  • Shadcn UI: Beautiful, accessible, and customizable components
  • Tailwind CSS: Utility-first CSS framework for rapid styling
  • Vite: Lightning-fast build tool and development server

Development Tools

  • Biome: Fast formatter and linter for JavaScript/TypeScript
  • React Hook Form: Performant forms with easy validation
  • Sonner: Beautiful toast notifications

πŸ”§ Development

Live Development

For the best development experience with hot reload:

# Install dependencies (only needed once)
make deps

# Start development server with hot reload
make dev

This starts the app with hot reload for both frontend and backend. For frontend-only development in a browser (with access to Go methods), open http://localhost:34115 in your browser.

Development Workflow

  1. Backend Changes: Modify Go files - Wails automatically rebuilds and restarts
  2. Frontend Changes: Edit React/TypeScript files - Vite provides instant hot reload
  3. Database Changes: Update models in db/ - restart required for schema changes
  4. UI Components: Modify components in frontend/src/components/ - see changes instantly

Project Structure

mockwails/
β”œβ”€β”€ app.go              # Main application logic and Wails bindings
β”œβ”€β”€ main.go             # Application entry point
β”œβ”€β”€ wails.json          # Wails configuration
β”œβ”€β”€ config/             # Application configuration
β”‚   └── config.go
β”œβ”€β”€ db/                 # Database models and operations
β”‚   β”œβ”€β”€ db.go           # Database initialization
β”‚   β”œβ”€β”€ server.go       # Server model definitions
β”‚   β”œβ”€β”€ server_ops.go   # Server CRUD operations
β”‚   └── migrate.go      # Database migrations
β”œβ”€β”€ mockserver/         # HTTP server implementation
β”‚   β”œβ”€β”€ server.go       # Mock server logic
β”‚   └── templates.go    # HTML templates for 404 pages
β”œβ”€β”€ utils/              # Utility functions
β”‚   └── utils.go
β”œβ”€β”€ frontend/           # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/ # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/      # Application pages
β”‚   β”‚   β”œβ”€β”€ contexts/   # React contexts
β”‚   β”‚   └── lib/        # Utility functions
β”‚   └── wailsjs/        # Generated Wails bindings
└── build/              # Build outputs and assets

πŸ“¦ Building

Production Builds

To build a redistributable, production-ready package:

# Build for your current platform
wails build

# Or use platform-specific make commands
make build-windows    # Windows 64-bit (.exe)
make build-linux      # Linux 64-bit (AppImage)
make build-mac        # macOS universal binary (.app)

Build Outputs

  • Windows: build/bin/MockWails.exe
  • macOS: build/bin/MockWails.app
  • Linux: build/bin/MockWails (executable)

Distribution

The built applications are self-contained and don't require any additional dependencies. They can be distributed directly to end users.

πŸ› οΈ Makefile Commands

The project includes a comprehensive Makefile to simplify common development tasks. Run make help to see all available commands:

Development Commands

  • make dev - Run the application in development mode with hot reloading
  • make deps - Install frontend dependencies from package.json
  • make clean - Clean build artifacts and temporary files

Build Commands

  • make build-windows - Build the application for Windows (64-bit)
  • make build-linux - Build the application for Linux (64-bit)
  • make build-mac - Build the application for macOS (universal binary)

Code Quality Commands

  • make lint - Lint the frontend code using Biome
  • make format - Format the frontend code using Biome
  • make check - Check and apply automatic fixes to the frontend code using Biome

Database Commands

  • make db-reset - Reset the database (removes all data)
  • make db-migrate - Run database migrations

Example Workflow

# Setup project
make deps

# Start development
make dev

# Before committing
make check
make lint

# Build for production
make build-mac

πŸ“‹ Use Cases

API Development & Testing

  • Frontend Development: Mock backend APIs before they're implemented
  • API Design: Prototype and test API responses during design phase
  • Integration Testing: Create predictable endpoints for automated testing
  • Third-party API Simulation: Mock external services for development

DevOps & CI/CD

  • Build Pipelines: Provide consistent mock services for automated tests
  • Environment Testing: Simulate different API responses and error conditions
  • Load Testing: Create lightweight mock endpoints for performance testing
  • Staging Environments: Replace expensive external dependencies

Education & Training

  • API Learning: Understand HTTP protocols and REST principles
  • Workshop Demos: Quick setup for coding workshops and tutorials
  • Student Projects: Provide APIs for learning frontend development
  • Interview Preparation: Practice API integration skills

🀝 Contributing

We welcome contributions! Here's how you can help:

Getting Started

  1. Fork the repository on GitHub
  2. Clone your fork: git clone https://github.com/yourusername/mockwails.git
  3. Create a branch: git checkout -b feature/amazing-feature
  4. Make your changes and test thoroughly
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Development Guidelines

  • Follow existing code style and patterns
  • Write clear commit messages
  • Add tests for new features
  • Update documentation as needed
  • Run make check before submitting

Ways to Contribute

  • πŸ› Bug Reports: Found a bug? Open an issue with details
  • πŸ’‘ Feature Requests: Have an idea? We'd love to hear it
  • πŸ“– Documentation: Help improve our docs
  • πŸ§ͺ Testing: Add test cases and improve coverage
  • 🎨 UI/UX: Enhance the user interface and experience

πŸ“„ License

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

πŸ™ Acknowledgments

  • Wails Team - For the amazing desktop app framework
  • Shadcn - For the beautiful UI component library
  • Go Community - For the robust backend language
  • React Team - For the powerful frontend framework

πŸ“ž Support & Contact


Crafted by tacheraSasi
Making API mocking simple and powerful

About

Simple MockServer creator inn go - wails - react

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published