Sign inSign up

sanyammalik/mockplant

By sanyammalik

•Updated about 1 month ago

Mockplant is a powerful API mocking tool that allows you to create and manage mock servers.

Image
Developer tools
0

364

sanyammalik/mockplant repository overview

⁠MockPlant

Mockplant is a powerful API mocking tool that allows you to create and manage mock servers for testing and development purposes. It provides a user-friendly interface for creating imposters (mock endpoints) and recording API responses.

⁠Features

  • Create and manage mock servers (imposters)
  • Record real API responses and convert them to mock endpoints
  • Support for various HTTP methods (GET, POST, PUT, DELETE)
  • Flexible request matching with predicates
  • Customizable response headers and body
  • Dark/Light mode support
  • Responsive design for all devices

⁠Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • Modern web browser

⁠Installation

  1. Clone the repository:
git clone https://github.com/Sanyam-malik/MockPlant
cd mockplant
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
⁠Docker Installation

Alternatively, you can run Mockplant using Docker:

  1. Make sure you have Docker and Docker Compose installed on your system.

  2. Build and start the container:

docker-compose up -d
  1. To stop the container:
docker-compose down
  1. To view logs:
docker-compose logs -f

The container will automatically restart unless explicitly stopped.

⁠Usage

  1. Start the server:
python mockplant_http.py
  1. Open your web browser and navigate to:
http://localhost

Note: The project comes with some example imposters in the imposters folder that you can use as reference or starting points for your own mock endpoints.

⁠Creating an Imposter
  1. Click the "Create Imposter" button in the sidebar
  2. Fill in the required information:
    • Name
    • Description
    • Type (HTTP)
  3. Click "Create" to save the imposter
⁠Recording API Responses (Not Implemented Yet)
  1. Click "Record API Response" on the welcome page
  2. Enter the API endpoint URL
  3. Configure request parameters:
    • HTTP Method
    • Headers
    • Query Parameters
    • Request Body (if needed)
  4. Click "Send Request" to make the API call
  5. Use "Create Imposter" to save the recorded response as a mock endpoint

⁠Contributing

  1. Fork the repository
  2. Create a new branch for your feature
  3. Make your changes
  4. Submit a pull request

⁠License

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

⁠Acknowledgments

  • Built with Flask
  • Uses Bootstrap for the UI
  • Font Awesome for icons

Tag summary

Content type

Image

Digest

sha256:611238812…

Size

34.9 MB

Last updated

about 1 month ago

docker pull sanyammalik/mockplant