ebazaar

πŸ›’ Ebazaar - Modern E-Commerce Platform

A full-featured e-commerce platform built with Next.js 16, featuring a modern shopping experience with cart management, user authentication, order processing, and an admin dashboard.

Next.js TypeScript Prisma License

πŸ“‹ Table of Contents

✨ Features

Customer Features

Admin Features

πŸ›  Tech Stack

Category Technology
Framework Next.js 16 (App Router)
Language TypeScript
Database SQLite with Prisma ORM
Authentication NextAuth.js v5
State Management Zustand
Styling Tailwind CSS v4
Payments Stripe
Testing Vitest (unit) + Playwright (e2e)
Error Tracking Sentry

πŸ“Œ Prerequisites

Before you begin, ensure you have the following installed:

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/arya-dev2005/ebazaar.git
cd ebazaar

2. Install Dependencies

npm install
# or
yarn install
# or
pnpm install

3. Configure Environment Variables

Create a .env file in the root directory:

# Database
DATABASE_URL="file:./dev.db"

# NextAuth
AUTH_SECRET="your-secret-key-here-generate-with-openssl-rand-base64-32"
AUTH_URL="http://localhost:3000"

# Stripe (get keys from https://dashboard.stripe.com)
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

# Sentry (optional, get from https://sentry.io)
SENTRY_DSN=""

4. Initialize the Database

# Push schema to database
npm run db:push

# Seed with sample data (optional)
npm run db:seed

5. Start the Development Server

npm run dev

Open http://localhost:3000 in your browser.

6. Create an Admin User

After starting the server:

  1. Sign up a new account
  2. Access your database (e.g., via npm run db:studio)
  3. Manually update the user’s role field to "ADMIN"

πŸ“ Project Structure

ebazaar/
β”œβ”€β”€ prisma/
β”‚   β”œβ”€β”€ schema.prisma      # Database schema
β”‚   └── seed.ts            # Seed data
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ actions/           # Server actions
β”‚   β”‚   β”œβ”€β”€ admin.ts
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   β”œβ”€β”€ cart.ts
β”‚   β”‚   β”œβ”€β”€ category.ts
β”‚   β”‚   β”œβ”€β”€ order.ts
β”‚   β”‚   └── product.ts
β”‚   β”œβ”€β”€ app/               # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ (auth)/        # Auth routes (sign-in, sign-up)
β”‚   β”‚   β”œβ”€β”€ (shop)/        # Shop routes (products)
β”‚   β”‚   β”œβ”€β”€ admin/         # Admin dashboard
β”‚   β”‚   β”œβ”€β”€ api/           # API routes
β”‚   β”‚   β”œβ”€β”€ cart/          # Cart page
β”‚   β”‚   β”œβ”€β”€ checkout/      # Checkout flow
β”‚   β”‚   └── orders/        # Order history
β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”‚   β”œβ”€β”€ cart/
β”‚   β”‚   β”œβ”€β”€ home/
β”‚   β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”œβ”€β”€ products/
β”‚   β”‚   └── ui/
β”‚   β”œβ”€β”€ lib/               # Utilities and configs
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   β”œβ”€β”€ prisma.ts
β”‚   β”‚   β”œβ”€β”€ sentry.ts
β”‚   β”‚   β”œβ”€β”€ stripe.ts
β”‚   β”‚   └── utils.ts
β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   β”œβ”€β”€ cart.ts
β”‚   β”‚   β”œβ”€β”€ order.ts
β”‚   β”‚   β”œβ”€β”€ product.ts
β”‚   β”‚   β”œβ”€β”€ review.ts
β”‚   β”‚   └── user.ts
β”‚   └── types/             # TypeScript types
β”œβ”€β”€ e2e/                   # Playwright tests
β”œβ”€β”€ tests/                 # Unit tests
└── public/                # Static assets

πŸ—„ Database Schema

The application uses the following main models:

πŸ“œ Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint
npm run test Run unit tests
npm run test:watch Run tests in watch mode
npm run test:e2e Run end-to-end tests
npm run db:push Push schema to database
npm run db:seed Seed database with sample data
npm run db:studio Open Prisma Studio

🀝 Contributing

We welcome contributions! Please follow these steps:

1. Fork the Repository

Click the β€œFork” button on GitHub.

2. Clone Your Fork

git clone https://github.com/YOUR_USERNAME/ebazaar.git
cd ebazaar

3. Create a Feature Branch

git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description

4. Make Changes

5. Commit Your Changes

git add .
git commit -m "feat: Add new feature"

6. Push to Your Fork

git push origin feature/your-feature-name

7. Create a Pull Request

  1. Go to the original repository
  2. Click β€œNew Pull Request”
  3. Select your branch and submit
  4. Fill in the PR template with:
    • Description of changes
    • Related issue number (if applicable)
    • Screenshots (for UI changes)

Code Style Guidelines

Commit Message Format

We follow Conventional Commits:

<type>(<scope>): <description>

[optional body]

[optional footer]

Types:

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ’¬ Support

If you have questions or need help:


Made with ❀️ by [Arya](https://github.com/arya-dev2005)