Inspiration

Amazon is the world's largest e-commerce company and one way they've achieved this is through their ability to deliver to customers much more efficiently that gets products on doorsteps much faster. They're able to do this because of their ability to store commonly bought products in their massive warehouses. Smaller businesses don't have this same luxury to be able to store many products in massive warehouses.

That's where RegionSell comes in! With RegionSell, all sorts of businesses can begin to predict where and when sales of certain items might increase, all through an easy to use Chrome extension! This can help e-commerce developers move certain items to the top of recommendations on a storefront based on a user's location and can assist e-commerce brands as a whole to get a better idea of what sells better where. Further, couriers can keep commonly bought items on their route, allowing for even faster delivery for certain lucky customers.

What it does

RegionSell provides a Google Chrome extension that works by displaying the top locations where any item on any storefront is especially popular at the moment. It does this by calling a custom Cohere classification model trained on a dataset of over 55000 e-commerce transactions that returns the top regions above a certain confidence level.

Further, RegionSell provides live updates and feedback by adding more examples to the data that the custom Cohere model is based on whenever a customer buys an item, by logging the item, the date and time, as well as the location where the user bought the item. This means that whenever a developer or store owner checks to see which items are popular in a location, the information is current.

How I built it

I built the frontend Chrome extension using React with TypeScript, and Bootstrap 5 for the styling. The Chrome API was used to get the information from the page and URL.

I built the backend web API using Flask with Python. This backend used the Cohere Python SDK's /classify endpoint, which was using the custom model that I trained using a dataset from Kaggle. This API would communicate with the frontend and provide information on regional rankings. Further, when an item was added to cart, it would be added to the new examples via an endpoint on this API. Data cleaning for the datasets was done with Python as well.

The backend was hosted on Azure Web Apps, and for this I used GitHub Actions to set up a Continuous Deployment pipeline that would build and deploy the API whenever changes were made to it. Other GitHub Actions were also used, including Pylint to enforce coding standard and CodeQL to ensure code security, as e-commerce data security can be incredibly important and any compromise can lead to massive losses for brands.

In addition to all this, a small test storefront was created for demo purposes to showcase how this tool works on any potential e-commerce storefront.

Challenges I ran into

Since it was my first time setting up CI/CD pipelines, especially using GitHub Actions, I had trouble with ensuring that I was following standards and avoiding security bugs on the CI side. I also had trouble with Azure Web Apps and connecting this to the GitHub Action to allow for Continuous Deployment of the API. Eventually I was able to figure out how the app could be configured on Azure's portal to connect to GitHub Actions and properly deploy the web app.

Further, I had never made a Google Chrome extension before, so it was quite a learning curve for me to figure out how the extension could read a page's contents and URL to use this to communicate with the Flask API.

Accomplishments that I'm proud of

I'm proud of the GitHub repository I have created, specifically with respect to not only the code that is on it, but also the various configurations I have made to allow for a more secure and standardized open-source repository. By adding the GitHub Actions for Continuous Integration, I can ensure that others contributing to the repository will have to follow the same standards and make it harder for bad actors to hurt the product.

I'm also proud of my ability to create what I did within the time constraints, including all 3 applications and configuring various GitHub Actions, which I had never done before.

What I learned

I learned about the importance of a well constructed open-source repository, and how CI/CD platforms can make development so much easier by allowing bugs to be found, corrected, and put into production much easier.

I also learned a great amount about how JS scripts work for Google Chrome extensions, including the differences with those for regular web apps.

What's next for RegionSell

A next step for RegionSell would be to further generalize the product so that it could not only work for countries, but possibly even certain cities or streets, depending on the size and capability of a business that uses it.

Share this project:

Updates