https://github.com/rukaachan/ecom
A modern e-commerce admin dashboard built with Next.js 15, TypeScript, and Prisma.
https://github.com/rukaachan/ecom
ecommerce nextjs typescript website
Last synced: 2 months ago
JSON representation
A modern e-commerce admin dashboard built with Next.js 15, TypeScript, and Prisma.
- Host: GitHub
- URL: https://github.com/rukaachan/ecom
- Owner: rukaachan
- Created: 2025-04-06T05:52:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-17T16:59:38.000Z (5 months ago)
- Last Synced: 2026-02-17T21:52:09.459Z (5 months ago)
- Topics: ecommerce, nextjs, typescript, website
- Language: TypeScript
- Homepage:
- Size: 2.48 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ecom
Next.js 15 e-commerce app (storefront + admin dashboard) built with TypeScript, Prisma, and PostgreSQL.
## Features
- Storefront: product listing, product detail, cart, checkout (Xendit Payment Request)
- Admin: products, categories, brands, locations, orders, customers
- Auth: Lucia sessions (superadmin + customer)
- Image uploads: local storage under `public/uploads/*` (gitignored)
## Tech Stack
- Next.js 15 (App Router) + React 19
- TypeScript
- Prisma + PostgreSQL
- Lucia Auth
- Tailwind CSS + Radix UI (shadcn/ui)
- Zod validation
- Xendit (`xendit-node`)
- oxlint / oxfmt (lint/format)
## Setup
### 1) Install dependencies
```bash
pnpm install
```
### 2) Configure environment variables
Create `.env` from `.env.example`.
Required:
- `DATABASE_URL`
- `XENDIT_SECRET_KEY`
- `NEXT_PUBLIC_REDIRECT_URL`
Recommended:
- `XENDIT_WEBHOOK_CALLBACK_TOKEN` (validate webhook requests)
Optional:
- `NEXT_PUBLIC_FAILURE_RETURN_URL`
### 3) Prepare database
```bash
pnpm prisma migrate dev
```
Optional seed:
```bash
pnpm prisma:seed
```
### 4) Run the app
```bash
pnpm dev
```
Open `http://localhost:3000`.
## Xendit Webhook
The app exposes:
- `POST /api/order/status`
This endpoint:
- Accepts `reference_id` / `referenceId` (also supports nested `data.reference_id` / `data.referenceId`)
- Updates the `order.status` by matching `order.code`
- If `XENDIT_WEBHOOK_CALLBACK_TOKEN` is set, it requires header `x-callback-token` to match
- Ignores unsupported events (expects `payment.succeeded`)
Configure your Xendit dashboard webhook URL to:
- `https:///api/order/status`
## Scripts
- `pnpm dev`: start dev server
- `pnpm build`: build for production
- `pnpm start`: run production server
- `pnpm lint`: oxlint
- `pnpm lint:fix`: oxlint autofix
- `pnpm format`: oxfmt write
- `pnpm type-check`: `tsc --noEmit`
## Project Structure
```
src/
app/ Next.js routes (App Router)
(admin)/ Admin dashboard
(customer)/ Storefront
api/ Route handlers
components/ Shared UI
lib/ Utilities (auth, prisma, uploads, xendit)
type/ Shared TS types
```