MockWails
August 29, 2025 ยท View on GitHub
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

Mock Server Creation - Comprehensive Configuration
Detailed form for creating sophisticated mock endpoints with full customization

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

Settings & Configuration - Personalization
Customize the application behavior and preferences to fit your workflow

๐ Getting Started
Prerequisites
- Go 1.21+: Download and install Go
- Node.js 18+: Download and install Node.js
- Wails CLI: Install with
go install github.com/wailsapp/wails/v2/cmd/wails@latest
Quick Start
-
Clone the repository:
git clone https://github.com/tacheraSasi/mockwails.git cd mockwails -
Install dependencies:
make deps -
Run in development mode:
make dev -
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
- Launch MockWails and click "Create Mock Endpoint"
- Configure your endpoint:
- Name: "User API"
- Endpoint: "/api/users"
- Method: "GET"
- Response:
{"users": [{"id": 1, "name": "John Doe"}]} - Status Code: 200
- Click "Create" - your mock server starts automatically
- Test it: Visit
http://localhost:8080/api/usersin 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
- Backend Changes: Modify Go files - Wails automatically rebuilds and restarts
- Frontend Changes: Edit React/TypeScript files - Vite provides instant hot reload
- Database Changes: Update models in
db/- restart required for schema changes - 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 reloadingmake deps- Install frontend dependencies frompackage.jsonmake 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 Biomemake format- Format the frontend code using Biomemake 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
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/yourusername/mockwails.git - Create a branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - 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 checkbefore 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
- GitHub Issues: Report bugs or request features
- Discussions: Join community discussions
Making API mocking simple and powerful