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.
- π 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.
- ποΈ 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
- π 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
- π 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
Overview of all your mock servers with real-time status monitoring
Detailed form for creating sophisticated mock endpoints with full customization
Real-time server control with start, stop, edit, and delete operations
Customize the application behavior and preferences to fit your workflow
- 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
-
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
- 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
{
"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
}- 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
- 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
- Biome: Fast formatter and linter for JavaScript/TypeScript
- React Hook Form: Performant forms with easy validation
- Sonner: Beautiful toast notifications
For the best development experience with hot reload:
# Install dependencies (only needed once)
make deps
# Start development server with hot reload
make devThis 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.
- 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
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
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)- Windows:
build/bin/MockWails.exe - macOS:
build/bin/MockWails.app - Linux:
build/bin/MockWails(executable)
The built applications are self-contained and don't require any additional dependencies. They can be distributed directly to end users.
The project includes a comprehensive Makefile to simplify common development tasks. Run make help to see all available 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
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)
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
make db-reset- Reset the database (removes all data)make db-migrate- Run database migrations
# Setup project
make deps
# Start development
make dev
# Before committing
make check
make lint
# Build for production
make build-mac- 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
- 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
- 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
We welcome contributions! Here's how you can help:
- 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
- Follow existing code style and patterns
- Write clear commit messages
- Add tests for new features
- Update documentation as needed
- Run
make checkbefore submitting
- π 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
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
- GitHub Issues: Report bugs or request features
- Discussions: Join community discussions
Making API mocking simple and powerful