Mockingbird: New tool for your mock environments
Tags: programming, tooling, webdev, testing
Published: 2024-05-05 09:11:25

## TL;DR
I created a mock tool that can significantly increase your productivity and reduce your integration time to nearly zero.
Mockingbird [Homepage](https://github.com/ozkeisar/mockingbird).
Mockingbird [Releases](https://github.com/ozkeisar/mockingbird/releases).


## Motivation
In my journey as a developer, I’ve encountered the common challenge of waiting for server development to be completed, which often led to significant delays in our projects.

Frustrated by this inefficiency, I decided to take matters into my own hands and develop a solution.

This led to the creation of Mockingbird, a tool designed to streamline server mocking with an intuitive interface.

Implementing Mockingbird within my team not only reduced our waiting time but also transformed our development process.

With integration times nearly eliminated, our productivity soared.
Now, as I share Mockingbird with the wider developer community, my goal is to provide others with the same opportunity to optimize their workflows and achieve seamless development experiences.

## How mockingbird works

Mockingbird works with your Git setup, keeping things simple and secure. No need for extra servers or worrying about security — just focus on coding. With Git being so widely used, Mockingbird fits right into your team’s workflow. Any APIs you add are instantly available to your teammates. It’s an easy, safe way to develop and test APIs without any extra hassle.

## Downloading and Installing Mockingbird

- Go to [Releases](https://github.com/ozkeisar/mockingbird/releases) and download the latest stable version of Mockingbird for your operating system.
- Run the installer and follow the on-screen instructions to complete the installation process.


### Initializing Your Project in Mockingbird
Locate the Mockingbird application on your system and launch it.

The initial screen is your starting point for creating and managing projects.

Once you opened the app you have two options to start a new project

1. Clone existing project of mockingbird from your git service
2. Create new project locally (you can connect it to git at any time)

![Mockingbird welcome screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s5bvjb73gjkeoke85rml.png)

#### Cloning project from Repository

1. Choose between HTTPS or SSH cloning methods. SSH is recommended for its security, but it requires SSH keys to be set up on your system.
2. Input Repository URL:

- For SSH: Enter the SSH URL into the ‘ssh url’ input field.
- For HTTPS: Switch to the HTTPS tab and enter the repository URL into the provided field.

3. Type in a unique name for your project in the ‘project name’ input field.
4. Click the ‘CLONE’ button to clone the repository and establish your project in Mockingbird.

### Setting Up Your Project

#### Initiating a New Server

- Click on the `+ new server` button
- A dialogue box will appear, insert your server name.
- Hit `SAVE`.

![Server dialog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g7se9lq4v5muk5e0x8rz.png)


#### Creating parent

- Adding a new parent, parent will hold the routes under it
- select `New Parent`
- insert the parent path in the `path` field
- insert filename in the `filename` field, this will create new file in your project that will hold all the routes in it


![Parent dialog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ukwe2o439qzax73gmw2b.png)


#### Creating route

- Select `Add Route`.
- Specify the HTTP method and route path.
- You can ignore the params row.
- Click `ADD ROUTE` to add the route to your server.

![Route dialog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1rrf9o4wzxake7c3zgy8.png)

#### Adding Response

- Once your route is created, select your route
- click on `ADD RESPONSE` button.
- You can choose between three response options `function` `object` and `proxy`
- `Function` will give you the option to create custom response based on params you have on your request.
- `Object` will return the object that you set to response.
- `Proxy` will pass your request to a url that you set.
- Choose your response type and fill the data, set response name and hit `SAVE`.

![Response Dialog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1r1m6q6xa9qylh56u6k.png)


> You can add multiple responses and switch between them by clicking on SET ACTIVE button.


![Route with multiple responses](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9jloo1678v30lvta61r.png)

### Spread the wings!
Now that your all set, hit the `start server` button, and your mock server is up and running.

In the top bar you will have `servers ips` button, hit it and you will see your server address.

Open the **console** to view all the requests handled by the Mockingbird server.

To start mocking, simply change the `baseUrl` in your project so all your API calls will directed to your mockingbird server.


### In Conclusion
Mockingbird is a powerful tool that can help not only front-end developers, but also can help back-end developers that need to integrate with 3rd party services, it can help QA that needs to have a specific environment for their testing, also Automation that needs its own servers, and you can take it further,
I hope that you will find use out of it and enjoy it.

Even if you don't plan on using it, I would still be grateful if you could endorse and star it on [Github](https://github.com/ozkeisar/mockingbird).

### In the next articles:

- [Setting up a Full Mock Server for Your APIs in minutes](https://dev.to/ozkeisar/setting-up-your-mock-server-with-mockingbird-1b72).
- Setting up GraphQL Mock Server with Mockingbird.
- Mockingbird: The power of Presets.
- Manage Multiple Projects in Mockingbird.
- Manage Multiple Servers in your Mockingbird project.
- Mockingbird console, quick overview.

You are more then welcome to ask questions and leave comments or raise an issue in the [Github issues](https://github.com/ozkeisar/mockingbird/issues) page.

Happy mocking, fellow developers!