OpenCommerce Admin Panel is the open source staff console for OpenCommerce — a full-featured eCommerce platform. Built with Next.js, React, and Tailwind CSS, it gives warehouse admins, marketers, and support agents a role-aware workspace for orders, catalog, customers, marketing, finance, and platform settings.
Pair it with the OpenCommerce backend (Node.js + Express + MongoDB) and the storefront for a complete open source commerce stack.
backend repo: https://github.com/TheCasperSolangi/ecommerce_backend
frontend (storefront) repo: https://github.com/TheCasperSolangi/ecommerce_frontend
- 🔐 Staff-only auth — Login for
admin,marketing, andcustomer_support(customers are redirected to the storefront) - 🧭 Role-aware sidebar — Navigation filtered by role so each user only sees tools they can use
- 📊 Dashboard — Warehouse-scoped stats, recent activity, and charts
- 📦 Orders — Status cards, search, detail dialog, status transitions, and refunds
- 🛍️ Products — Catalog list with search, create / edit / soft-delete, brands & categories, image upload to storage
- 👥 Team — Invite staff, assign roles & warehouses, lock / unlock / remove accounts
- 🧍 Customers — Browse end users; lock or unlock accounts (admin + support)
- 🎫 Tickets — Triage support tickets (status + team notes; notifies the customer)
- 🏷️ Coupons — Full coupon CRUD with eligibility, expiry, usage limits, and active toggle
- 🖼️ Banners — Sliders, pop-ups, app & header banners with upload and storefront visibility toggle
- 📣 Marketing — Create campaigns (Email / WhatsApp / Push), then broadcast with delivery stats
- 🏪 Vendors — Maintain vendor records for expense tagging
- 💰 Finance — Income / expense / net summary and ledger with manual entries
- ⚙️ Settings — Profile & password for all staff; platform branding and warehouses for admins
| Layer | Technology |
|---|---|
| Framework | Next.js (App Router) |
| UI | React, Lucide React, React Icons, Radix UI primitives |
| Styling | Tailwind CSS |
| Charts | Recharts |
| Auth | JWT (Bearer) in cookies (token / authToken) |
| API client | Fetch helpers in src/lib/ via NEXT_PUBLIC_API_URL |
| Module | Admin | Marketing | Customer support |
|---|---|---|---|
| Dashboard | ✅ | ✅ | ✅ |
| Orders | ✅ | — | ✅* |
| Products | ✅ | ✅ (view-oriented; mutate is admin) | — |
| Banners | ✅ | ✅ | — |
| Marketing | ✅ | ✅ | — |
| Coupons | ✅ | ✅ | — |
| Team | ✅ | — | — |
| Customers | ✅ | — | ✅ |
| Tickets | ✅ | — | ✅ |
| Vendors | ✅ | — | — |
| Finance | ✅ | — | — |
| Settings | ✅ (all tabs) | ✅ (profile) | ✅ (profile) |
*Order management APIs are warehouse-scoped and typically require admin privileges on the backend; support may see the nav depending on your API policy.
Staff create flows (Team → Add member) can also create rider accounts for delivery operations; riders do not use this panel.
- Node.js 18+ and npm
- A running OpenCommerce backend (default API:
http://localhost:6464) - A running storage / upload server for product & banner images (default:
http://localhost:4755) - At least one staff user (
admin/marketing/customer_support) in the backend
git clone <your-admin-panel-repo-url>.git
cd admin_panel
npm installCreate a .env (or .env.local) in the project root:
# OpenCommerce backend API (must match backend PORT, default 6464)
NEXT_PUBLIC_API_URL=http://localhost:6464/api
# Image storage server
NEXT_PUBLIC_STORAGE_URL=http://localhost:4755Make sure the API is up on port 6464 and the storage server on 4755 before signing in or uploading images.
npm run devOpen http://localhost:3000 (or the port Next.js prints). If the storefront already uses 3000, start the panel on another port:
npx next dev -p 3001Go to /auth/login with a staff email and password. Only management roles are accepted.
npm run build
npm startadmin_panel/
├── src/
│ ├── app/
│ │ ├── auth/login/ # Staff login
│ │ └── dashboard/ # Authenticated shell
│ │ ├── page.js # Dashboard
│ │ ├── orders/
│ │ ├── products/ # List + new + [id]/edit
│ │ ├── banners/
│ │ ├── marketing/
│ │ ├── coupons/
│ │ ├── team/
│ │ ├── customers/
│ │ ├── tickets/
│ │ ├── vendors/
│ │ ├── finance/
│ │ └── settings/
│ ├── components/
│ │ ├── dashboard/ # Sidebar, shell, charts
│ │ ├── products/ # ProductForm, brand/category dialogs
│ │ ├── team/ # Create staff dialog
│ │ └── ui/ # Shared UI primitives
│ ├── context/ # AuthContext
│ ├── lib/ # API helpers (orders, products, users, …)
│ └── hooks/ · i18n/
├── public/
├── .env # NEXT_PUBLIC_API_URL, NEXT_PUBLIC_STORAGE_URL
└── package.json
| Route | Description |
|---|---|
/auth/login |
Staff sign-in |
/dashboard |
Overview & charts |
/dashboard/orders |
Orders management |
/dashboard/products |
Product catalog |
/dashboard/products/new |
Create product |
/dashboard/products/[id]/edit |
Edit product |
/dashboard/banners |
Banner management |
/dashboard/marketing |
Marketing campaigns |
/dashboard/coupons |
Coupon management |
/dashboard/team |
Team / staff management |
/dashboard/customers |
Customer accounts |
/dashboard/tickets |
Support tickets |
/dashboard/vendors |
Vendors |
/dashboard/finance |
Finance ledger |
/dashboard/settings |
Profile, platform, warehouses |
- Access token is stored in cookies (
token/authToken) with role and optionalwarehouse_code - Authenticated requests send
Authorization: Bearer <token>viasrc/lib/api.js AuthContextloadsGET /api/auth/meon boot and blocks non-management roles- Account locks (
suspendedstatus or failed-login lock) are enforced by the backend
Product, brand, banner, and marketing image uploads go to:
POST {NEXT_PUBLIC_STORAGE_URL}/api/uploads
Ensure that host is reachable from the browser during local development.
Contributions are welcome! A good starting path:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Make focused changes with clear commits
- Open a pull request describing the why and how to test
Please keep PRs scoped, match existing patterns in src/lib/ and dashboard pages, and avoid unrelated refactors.
If you find a bug or have a feature request, open an issue with:
- Steps to reproduce
- Expected vs actual behavior
- Browser / Node versions
- Staff role used (
admin/marketing/customer_support) - Whether the backend API and storage server were running and reachable
This project is licensed under the MIT License — see the LICENSE file for details.
Built as the companion admin console to OpenCommerce, an open source eCommerce platform for developers who want full control over their commerce stack.