Skip to content

Admin Web App

The PharmaNet Admin Web App is a React SPA for platform administrators to manage users, products, orders, payments, CMS content, promotions, and system settings.

Source: pharmanet-admin/


App Identity

Property Value
Name PharmaNet
Version 1.1.0
Stack React 18 + Vite + MUI 5 + Redux Toolkit + Supabase
Port 5173 (dev)

Feature Overview

Feature Route Description
Dashboard / KPI cards, charts, recent activity
Users /users User management, pharmacy approval
Products /products Product CRUD, approval, variants, brands
Categories /categories Category tree with drag-and-drop
Orders /orders Order management, status updates
Payments /payments Transactions, Chapa config, logs
CMS /cms/banners, /cms/pages Banners, static pages
Promotions /promotions Campaign CRUD, activate/end
Reports /reports Sales, product, seller performance
Settings /settings General, payment, email config
Featured Products /featured-products Manage boosted products
Subscriptions /subscriptions Pharmacy subscription oversight

Architecture

graph TB
    subgraph "Admin Web App"
        R["React Router v6<br/>Lazy-loaded pages"]
        RTK["Redux Toolkit<br/>9 slices"]
        MUI["MUI 5 Component Library"]
        SVC["Service Layer<br/>18 modules"]
    end
    subgraph "Supabase"
        PG[(PostgreSQL)]
        SA[Auth]
        SR[Realtime]
        SS[Storage]
    end
    R --> SVC
    RTK --> SVC
    SVC --> PG
    SVC --> SA
    SVC --> SS
    SR --> RTK

Redux Slices

Slice State Shape Key Actions
auth user, isAuthenticated, loading login, verifyToken, logout
users users[], pendingPharmacies[], filters fetchUsers, approvePharmacy
products products[], brands[], attributes[], filters fetchProducts, approveProduct
orders orders[], filters, pagination fetchOrders, subscribeToOrders
ui sidebarOpen, darkMode, modals, notifications toggleSidebar, toggleDarkMode
dashboard stats, overview fetchDashboardStats
categories categories[], selectedCategory fetchCategories, reorderCategories
featureProduct featured_products[], filters fetchFeaturedProducts
pharmacySubscription subscriptions[], analytics fetchPharmacySubscriptions

Service Modules

Module File Key Functions
Auth services/auth.js login, logout, verifyToken
Users services/users.js getUsers, approvePharmacy, rejectPharmacy
Products services/products.js getProducts, createProduct, approveProduct
Orders services/orders.js getOrders, updateOrderStatus
Payments services/payments.js getTransactions, updateChapaSettings
Dashboard services/dashboard.js getStats, getOverview
Categories services/categories.js getCategories, reorderCategories
CMS services/cms.js getBanners, createBanner, getPages
Promotions services/promotions.js getPromotions, activatePromotion, endPromotion
Notifications services/notifications.js getNotifications, createNotification, subscribeToNotifications
Reports services/reports.js getSalesReport, getProductPerformance
Settings services/settings.js getSettings, updateSettings
Chapa services/chapa.js initializeChapaKeys, verifyPayment
Featured Products services/featuredProducts.js getFeaturedProducts, activateFeaturedProduct
Subscriptions services/pharmacySubscription.js getPharmacySubscriptions, activateSubscription

Sections

Section Description
Getting Started Setup, env vars, run
Architecture Code structure deep-dive
Features All feature documentation
Services Service layer reference

Source Code

Source: pharmanet-admin/src/