How to speed up the development time of E-commerce mobile applications using DhiWise and Medusa?

Pankti Shah
DhiWise
Published in
4 min readSep 9, 2022

Introduction

E-commerce application development is time-consuming. Fetching data, updating, deleting, and creating. Doing grunt stuff in a loop is decreasing your productivity and shooting up the development time, significantly.

But this isn’t the end of the road! Instead, you have DhiWise to help.

In this blog, we will discuss how you can develop an E-commerce application in a shorter development cycle and increase productivity.

But first, what is Medusa:

Medusa?

  • Developers can design incredible digital commerce experiences using Medusa, an open-source headless commerce engine.
  • They provide amazing APIs for E-commerce, and you can customize them based on your need.

To use Medusa, you can:

Install Medusa CLI

npm install -g @medusajs/medusa-cli

Create a new Medusa Project

medusa new my-medusa-store --seed

  • I have written a custom code in Medusa to fetch the latest cart of the customer

In src>services>customer_cart.js

In src>api>index.js

Now that you are aware of how Medusa works, here is how the DhiWise-Medusa integration bears fruits:

Power of DhiWise X Medusa
(1) Figma to Flutter in
DhiWise:

“People ignore design that ignores people.”

Because it makes it easier for users to connect with your website or application. A strong user interface is crucial because it can convert potential customers into purchasers. With DhiWise you can convert your Figma design into a Flutter code rapidly.

(2) Setup Auth

Along with Facebook and Google social authentication, I also wanted to provide email sign-up and sign-in. Surprisingly, DhiWise supports all these features with Firebase on the backend. Using DhiWise, setting up auth was so quick.

3) API Integration

For integrating an API one must upload the APIs, they would like to integrate. DhiWise provides an option of uploading the API postman collection file or adding APIs manually. I’ve imported the Medusa API postman collection.

When the user goes to the product display for that bind API on the onReady() method

Now we select API from the suggestion in the response and select view as we want to show that response on the screen and after clicking bind with a view.

What if there is an error while getting a response from the server you can set on success and error action handler.

In this action handler, you can bind another API. I need the order placed and a set request response for that.

Ex, select payment-session API from the list and then select another API call complete the call in the success of that API by selecting it.

(4) Navigations

From Product Listing screen to Product Detail screen with product id. In DhiWise, after selecting the type of navigation and screen, you want to redirect add a navigation argument for that and select API & response that you want as a navigation argument

(5) Customization after downloading source code using Medusa

  1. In login and register API, set cookie in saved preference and set in the common header.
  2. In the login and register screens, Firebase social authentication response was sent to Medusa.
  3. Product search screen, Listing of products as soon as user types.

Code Quality

DhiWise generated code is clean code which means business logic is encapsulated from UI. When there is a change in UI, the business logic doesn’t get affected. And file naming to variable naming conventions is maintained in the entire code generation from DhiWise.

Here is the GitHub link to the application: https://github.com/DhiWise/Shopsie

Benefits

By using Medusa and DhiWise, you can create amazing E-commerce applications in less time. It creates applications in less time than traditional coding and is also effective in terms of the cost of an application, helping with faster time-to-market.

Conclusion

With DhiWise and Medusa combo, it is a seamless experience to develop your E-commerce application. And it works with the existing business logic part, ensuring that the development time is reduced by 60%. And on top of that, the synergy supports cost savings.

About me:

I am Programmer Analsyt at DhiWise. DhiWise is a procode platform that helps programmers generate code for mundane tasks and help to focus on the business logic in Flutter and React.

You can find me on LinkedIn and Twitter. We can talk about dev tools and technologies.

--

--