Mara Store

Mara Store

Meeting the traveller through commerce

I recently took on the challenge of creating a traveller's e-commerce store. The goal was to develop a cart, user and payment management system around products these users would need.

A few thought processes. I could very well use an open-source solution that is already built and trusted by the community such as Django Oscar or Strapi. Alternatively, I could build one from scratch or modify one of my open-source projects to suit these needs. I chose the latter - one that I understood back to back.


:br

The Mara Store

The Mara Store is an e-commerce platform for travellers and backpackers. It provides a one-stop solution to travelling needs such as camping gear, suitable attire, etc. Let us understand the build process.

The Traveller

Choice of Stack - The Why

More than having an existing platform to borrow and build upon, I chose Django because it comes with an administrative dashboard right off the bat - a quick adjustable context solution.

Project Setup

Following recommended practice, we split settings and recommendation files for development and production and create base files for each. We also set a root templates file to manage all templates in one directory and create pre-commit configurations to place our focus on code changes instead of white spaces and linting. Eventually, a yaml file to handle continuous intergration and deployment to follow suite.

Order management - background tasks and their implication

What happens when we want to make an order?

Our system should be able to notify a user whenever an order is made on their account and process the same order in the background. Let the system generate the invoice with an order number(reference number)and mail it over as they wait for the delivery. As well, we want a backpacker to be able to come back and observe what they bought at that time.

My Orders

Product Recommendations

Referencing my last article - The Internet knows you better than you know yourself, I wanted to showcase the capacity of recommendation systems and their relevance to e-commerce.

Retail - Example:

Say you walked into a store and wanted to buy some bread. It is highly likely that you will see butter and jam next to it on the aisle. Basic psychology. Retail owners know, amongst other things, what goes with what and what is common to what age group of people.

Building on this, I added Redis, an in-memory data store to manage recommendations on the go; offsetting my main database to do other things.

We are recommending products that could be purchased together based on what other users had previously purchased together and their order of purchase frequency.

MaraStore - Example:

On one occasion, Mel bought hiking boots and a jacket. Later on, I logged on to the platform and wanted a tent, a jacket and a pocket knife. The store would go ahead and suggest a pair of boots since it was previously purchased with a jacket, an item currently on my cart.


Recommendations

Back to order management and with the integration of ou tasks, our store can go: ”Hey! Remember the jacket you bought 2 months ago? It comes in black.” :br

Invoice management

Because we intend to have a number of users and orders, our staff and administrators need to somehow view what was ordered, when it was made and possibly generate invoices for these items.

Image of an invoice

Administratively, the administrator should be able to perform basic operations and modify any order that the customer wants to change at the time.

What next?

As a first mockup, I am proud of the journey this product has taken so far. What comes next would be to determine how sustainable my solutions can be - choice constraints.

Just because I can, I want to implement the same product with a different set of tools. Adhering to best practices in e-commerce such as SEO and ease of use, I want to build the Mara Store with a javascript SSR framework like Nuxt, implement a backend on a concurrent-friendly framework like phoenix or really get with socket communication and use phoenix LiveView - whichever comes to mind first.

In the meantime, I invite you to probe marvinkweyu/marastore for a sneak peek at what lies ahead.

As always, contributions are welcome.

Marvin Kweyu © 2024