Samuel OkaFrontend developer
Case File #02
Web Application

SHOPOJA

Modern E-commerce Web Application

CASE FILE

#02

ROLE

Frontend Developer

TYPE

Web Application

ShopOja - hero
01 - Overview

THE MISSION

ShopOja is a responsive e-commerce web application that allows users to browse products, view detailed product information, and manage a persistent shopping cart across sessions.

02 - Problem

THE PROBLEM

Many small-scale online vendors lack a clean, responsive, and scalable digital storefront with proper state management for cart functionality.

Before the solution
Spreadsheet chaos — 47 open tabs
Lost invoices — no audit trail
Missed payments — zero visibility
Frustrated freelancer — every time
03 - The solution

THE SOLUTION

I built a React-powered e-commerce interface using global state management to handle cart operations, product routing, and pricing updates in real time.

  • Product listing page
  • Dynamic product details page
  • Persistent shopping cart
  • Real-time price calculation
  • Responsive design
04 - How i built it

HOW I BUILT IT

Step 01

Designed product and cart UI components

Step 02

Implemented global cart state using React Context

Step 03

Integrated REST API for product data

Step 04

Optimized cart persistence using localStorage

05 - Boss Battles

BOSS BATTLES

Battle #01

SYNCHRONIZING CART QUANTITIES ACROSS PAGES

Bug Detected

Cart updates made on the product page were not immediately reflected on the cart page because state was managed locally in separate components.

Fixed

Implemented global state management using React Context API and created a custom useCart hook to centralize cart logic. This ensured all components subscribed to the same state and updated instantly.

Battle #02

HANDLING DYNAMIC PRICE CALCULATIONS

Bug Detected

Total price calculations were inconsistent when items were removed or quantities changed, especially when the cart was empty.

Fixed

Used Array.reduce with a proper initial value to derive totals directly from cart state. This ensured accurate real-time recalculation without storing redundant derived state.

Battle #03

PREVENTING UNNECESSARY RE-RENDERS

Bug Detected

Updating cart state triggered multiple component re-renders, affecting performance.

Fixed

Optimized performance by using React.memo where necessary, functional state updates, and avoiding inline functions inside mapped components to reduce unnecessary re-renders.

Battle #04

PERSISTING CART DATA AFTER REFRESH

Bug Detected

Cart items were lost after page reload because state was stored only in memory.

Fixed

Integrated localStorage to save cart state and rehydrate it on initial render using useEffect, ensuring persistent cart functionality.

06 - Mission Complete

MISSION COMPLETE

Seamless cart updates across routes

Persistent cart data after refresh

Responsive layout for mobile and desktop

07 - Tools Used

TOOLS USED

next js
Typescript
Tailwind CSS
REST API
Context API
08 - Evidence

EVIDENCE

App screenshot 1
EXHIBIT 01
View Full
App screenshot 2
EXHIBIT 02
View Full
App screenshot 3
EXHIBIT 03
View Full
App screenshot 4
EXHIBIT 04
View Full
App screenshot 5
EXHIBIT 05
View Full
App screenshot 6
EXHIBIT 06
View Full

- End of Chapter#02

END OF
CHAPTER ?

“There's more to bulid.”

Prev Case FileTAXLYTICS Next Case FileSEE WEATHER AROUND THE WORLD