DRT Store adalah aplikasi e-commerce modern yang dibangun dengan Next.js 14, TypeScript, dan Tailwind CSS.
- 🔐 Autentikasi dengan NextAuth.js
- 🛍️ Manajemen Produk
- 📦 Manajemen Kategori
- 🛒 Keranjang Belanja
- 📝 Manajemen Pesanan
- 📱 Responsive Design
- 🎨 UI Modern dengan Tailwind CSS
- 🔄 State Management dengan React Query
-
Frontend:
- Next.js 14
- TypeScript
- Tailwind CSS
- React Query
- NextAuth.js
- Shadcn UI
- Lucide Icons
-
Backend:
- Node.js
- Express.js
- MongoDB
- JWT Authentication
- Clone repository:
git clone https://github.com/yourusername/drt-store.git
cd drt-store- Install dependencies:
npm install
# atau
yarn install- Setup environment variables:
cp .env.example .env.local- Jalankan development server:
npm run dev
# atau
yarn devNEXT_PUBLIC_API_URL=http://localhost:5001/api
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000POST / api / auth / login
Body: {
username: string
password: string
}
Response: {
data: {
id: string
name: string
email: string
token: string
}
}GET /api/products
Query Parameters:
- page: number
- limit: number
- search: string
- category: string
- sort: string
Response: {
data: Product[]
total: number
page: number
limit: number
}
GET /api/products/:id
Response: {
data: Product
}
POST /api/products
Body: {
name: string
description: string
price: number
stock: number
categoryId: string
images: string[]
}
Response: {
data: Product
}
PUT /api/products/:id
Body: {
name?: string
description?: string
price?: number
stock?: number
categoryId?: string
images?: string[]
}
Response: {
data: Product
}
DELETE /api/products/:id
Response: {
message: string
}GET /api/categories
Query Parameters:
- page: number
- limit: number
- search: string
Response: {
data: Category[]
total: number
page: number
limit: number
}
GET /api/categories/:id
Response: {
data: Category
}
POST /api/categories
Body: {
name: string
description: string
}
Response: {
data: Category
}
PUT /api/categories/:id
Body: {
name?: string
description?: string
}
Response: {
data: Category
}
DELETE /api/categories/:id
Response: {
message: string
}GET /api/orders
Query Parameters:
- page: number
- limit: number
- status: string
Response: {
data: Order[]
total: number
page: number
limit: number
}
GET /api/orders/:id
Response: {
data: Order
}
POST /api/orders
Body: {
items: {
productId: string
quantity: number
}[]
shippingAddress: {
address: string
city: string
postalCode: string
country: string
}
}
Response: {
data: Order
}
PUT /api/orders/:id/status
Body: {
status: 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled'
}
Response: {
data: Order
}src/
├── app/ # App router pages
│ ├── (admin)/ # Admin routes
│ ├── (auth)/ # Auth routes
│ └── api/ # API routes
├── components/ # React components
│ ├── ui/ # UI components
│ └── layout/ # Layout components
├── hooks/ # Custom hooks
├── lib/ # Utility functions
├── types/ # TypeScript types
└── styles/ # Global styles
- Fork repository
- Buat branch fitur (
git checkout -b feature/amazing-feature) - Commit perubahan (
git commit -m 'Add some amazing feature') - Push ke branch (
git push origin feature/amazing-feature) - Buat Pull Request
Proyek ini dilisensikan di bawah MIT License.
Ahmad - @yourusername
Project Link: https://github.com/yourusername/drt-store