create-ecom-app 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/index.js +101 -0
  2. package/package.json +25 -0
  3. package/templates/ecommerce/app/about/page.tsx +152 -0
  4. package/templates/ecommerce/app/cart/page.tsx +103 -0
  5. package/templates/ecommerce/app/checkout/page.tsx +126 -0
  6. package/templates/ecommerce/app/contact/page.tsx +124 -0
  7. package/templates/ecommerce/app/globals.css +137 -0
  8. package/templates/ecommerce/app/layout.tsx +31 -0
  9. package/templates/ecommerce/app/login/page.tsx +224 -0
  10. package/templates/ecommerce/app/not-found.tsx +14 -0
  11. package/templates/ecommerce/app/orders/[id]/page.tsx +138 -0
  12. package/templates/ecommerce/app/page.tsx +215 -0
  13. package/templates/ecommerce/app/product/[id]/page.tsx +417 -0
  14. package/templates/ecommerce/app/products/page.tsx +244 -0
  15. package/templates/ecommerce/app/profile/page.tsx +273 -0
  16. package/templates/ecommerce/app/register/page.tsx +221 -0
  17. package/templates/ecommerce/app/wishlist/page.tsx +89 -0
  18. package/templates/ecommerce/components/CartItem.tsx +74 -0
  19. package/templates/ecommerce/components/CheckoutForm.tsx +109 -0
  20. package/templates/ecommerce/components/Filters.tsx +142 -0
  21. package/templates/ecommerce/components/Footer.tsx +100 -0
  22. package/templates/ecommerce/components/Header.tsx +194 -0
  23. package/templates/ecommerce/components/ProductCard.tsx +158 -0
  24. package/templates/ecommerce/components/SearchBar.tsx +41 -0
  25. package/templates/ecommerce/data/products.json +427 -0
  26. package/templates/ecommerce/lib/localStorage.ts +27 -0
  27. package/templates/ecommerce/lib/utils.ts +25 -0
  28. package/templates/ecommerce/next-env.d.ts +5 -0
  29. package/templates/ecommerce/next.config.js +13 -0
  30. package/templates/ecommerce/next.config.ts +14 -0
  31. package/templates/ecommerce/package.json +30 -0
  32. package/templates/ecommerce/postcss.config.js +7 -0
  33. package/templates/ecommerce/public/images/about-2.jpg +0 -0
  34. package/templates/ecommerce/public/images/contact-bg.jpg +0 -0
  35. package/templates/ecommerce/public/images/hero-bg.jpg +0 -0
  36. package/templates/ecommerce/public/images/products/product-1.jpg +0 -0
  37. package/templates/ecommerce/public/images/products/product-10.jpg +0 -0
  38. package/templates/ecommerce/public/images/products/product-11.jpg +0 -0
  39. package/templates/ecommerce/public/images/products/product-12.jpg +0 -0
  40. package/templates/ecommerce/public/images/products/product-13.jpg +0 -0
  41. package/templates/ecommerce/public/images/products/product-14.jpg +0 -0
  42. package/templates/ecommerce/public/images/products/product-15.jpg +0 -0
  43. package/templates/ecommerce/public/images/products/product-16.jpg +0 -0
  44. package/templates/ecommerce/public/images/products/product-17.jpg +0 -0
  45. package/templates/ecommerce/public/images/products/product-18.jpg +0 -0
  46. package/templates/ecommerce/public/images/products/product-19.jpg +0 -0
  47. package/templates/ecommerce/public/images/products/product-2.jpg +0 -0
  48. package/templates/ecommerce/public/images/products/product-20.jpg +0 -0
  49. package/templates/ecommerce/public/images/products/product-21.jpg +0 -0
  50. package/templates/ecommerce/public/images/products/product-22.jpg +0 -0
  51. package/templates/ecommerce/public/images/products/product-23.jpg +0 -0
  52. package/templates/ecommerce/public/images/products/product-24.jpg +0 -0
  53. package/templates/ecommerce/public/images/products/product-25.jpg +0 -0
  54. package/templates/ecommerce/public/images/products/product-3.jpg +0 -0
  55. package/templates/ecommerce/public/images/products/product-4.jpg +0 -0
  56. package/templates/ecommerce/public/images/products/product-5.jpg +0 -0
  57. package/templates/ecommerce/public/images/products/product-6.jpg +0 -0
  58. package/templates/ecommerce/public/images/products/product-7.jpg +0 -0
  59. package/templates/ecommerce/public/images/products/product-8.jpg +0 -0
  60. package/templates/ecommerce/public/images/products/product-9.jpg +0 -0
  61. package/templates/ecommerce/public/service-worker.js +1 -0
  62. package/templates/ecommerce/store/useAuthStore.ts +56 -0
  63. package/templates/ecommerce/store/useCartStore.ts +63 -0
  64. package/templates/ecommerce/store/useOrderStore.ts +43 -0
  65. package/templates/ecommerce/store/useReviewStore.ts +60 -0
  66. package/templates/ecommerce/store/useWishlistStore.ts +43 -0
  67. package/templates/ecommerce/tailwind.config.ts +44 -0
  68. package/templates/ecommerce/tsconfig.json +22 -0
  69. package/templates/ecommerce/types/index.ts +69 -0
@@ -0,0 +1,427 @@
1
+ [
2
+ {
3
+ "id": "1",
4
+ "name": "Classic White Sneakers",
5
+ "description": "Timeless white sneakers crafted with premium leather upper and cushioned sole. Perfect for everyday casual wear.",
6
+ "price": 2499,
7
+ "originalPrice": 3499,
8
+ "category": "Footwear",
9
+ "image": "/images/products/product-1.jpg",
10
+ "rating": 4.5,
11
+ "reviewCount": 128,
12
+ "inStock": true,
13
+ "tags": [
14
+ "sneakers",
15
+ "casual",
16
+ "white"
17
+ ]
18
+ },
19
+ {
20
+ "id": "2",
21
+ "name": "Slim Fit Denim Jacket",
22
+ "description": "Modern slim-fit denim jacket with subtle distressing. Versatile layering piece for any season.",
23
+ "price": 1999,
24
+ "originalPrice": 2999,
25
+ "category": "Clothing",
26
+ "image": "/images/products/product-2.jpg",
27
+ "rating": 4.3,
28
+ "reviewCount": 87,
29
+ "inStock": true,
30
+ "tags": [
31
+ "jacket",
32
+ "denim",
33
+ "casual"
34
+ ]
35
+ },
36
+ {
37
+ "id": "3",
38
+ "name": "Wireless Noise-Cancelling Headphones",
39
+ "description": "Premium over-ear headphones with active noise cancellation, 30-hour battery, and Hi-Res audio support.",
40
+ "price": 7999,
41
+ "originalPrice": 11999,
42
+ "category": "Electronics",
43
+ "image": "/images/products/product-3.jpg",
44
+ "rating": 4.8,
45
+ "reviewCount": 342,
46
+ "inStock": true,
47
+ "tags": [
48
+ "headphones",
49
+ "wireless",
50
+ "audio"
51
+ ]
52
+ },
53
+ {
54
+ "id": "4",
55
+ "name": "Leather Crossbody Bag",
56
+ "description": "Genuine leather crossbody bag with adjustable strap, multiple compartments, and gold-tone hardware.",
57
+ "price": 3499,
58
+ "originalPrice": 4999,
59
+ "category": "Accessories",
60
+ "image": "/images/products/product-4.jpg",
61
+ "rating": 4.6,
62
+ "reviewCount": 215,
63
+ "inStock": true,
64
+ "tags": [
65
+ "bag",
66
+ "leather",
67
+ "crossbody"
68
+ ]
69
+ },
70
+ {
71
+ "id": "5",
72
+ "name": "Smart Watch Pro",
73
+ "description": "Feature-packed smartwatch with health tracking, GPS, AMOLED display, and 7-day battery life.",
74
+ "price": 12999,
75
+ "originalPrice": 17999,
76
+ "category": "Electronics",
77
+ "image": "/images/products/product-5.jpg",
78
+ "rating": 4.7,
79
+ "reviewCount": 456,
80
+ "inStock": true,
81
+ "tags": [
82
+ "smartwatch",
83
+ "fitness",
84
+ "tech"
85
+ ]
86
+ },
87
+ {
88
+ "id": "6",
89
+ "name": "Oversized Graphic Tee",
90
+ "description": "Premium cotton oversized tee with bold graphic print. Streetwear staple for effortless cool.",
91
+ "price": 799,
92
+ "originalPrice": 1199,
93
+ "category": "Clothing",
94
+ "image": "/images/products/product-6.jpg",
95
+ "rating": 4.2,
96
+ "reviewCount": 193,
97
+ "inStock": true,
98
+ "tags": [
99
+ "tshirt",
100
+ "graphic",
101
+ "streetwear"
102
+ ]
103
+ },
104
+ {
105
+ "id": "7",
106
+ "name": "Minimalist Leather Wallet",
107
+ "description": "Ultra-slim bifold wallet in genuine leather. Holds 8 cards with RFID blocking technology.",
108
+ "price": 1299,
109
+ "originalPrice": 1799,
110
+ "category": "Accessories",
111
+ "image": "/images/products/product-7.jpg",
112
+ "rating": 4.4,
113
+ "reviewCount": 267,
114
+ "inStock": true,
115
+ "tags": [
116
+ "wallet",
117
+ "leather",
118
+ "minimal"
119
+ ]
120
+ },
121
+ {
122
+ "id": "8",
123
+ "name": "Running Shoes Elite",
124
+ "description": "Lightweight performance running shoes with responsive foam midsole and breathable mesh upper.",
125
+ "price": 4999,
126
+ "originalPrice": 6499,
127
+ "category": "Footwear",
128
+ "image": "/images/products/product-8.jpg",
129
+ "rating": 4.6,
130
+ "reviewCount": 389,
131
+ "inStock": true,
132
+ "tags": [
133
+ "running",
134
+ "sports",
135
+ "shoes"
136
+ ]
137
+ },
138
+ {
139
+ "id": "9",
140
+ "name": "Stainless Steel Water Bottle",
141
+ "description": "Double-wall insulated bottle keeps drinks cold 24hrs, hot 12hrs. 750ml with leak-proof lid.",
142
+ "price": 999,
143
+ "originalPrice": 1499,
144
+ "category": "Lifestyle",
145
+ "image": "/images/products/product-9.jpg",
146
+ "rating": 4.5,
147
+ "reviewCount": 521,
148
+ "inStock": true,
149
+ "tags": [
150
+ "bottle",
151
+ "hydration",
152
+ "eco"
153
+ ]
154
+ },
155
+ {
156
+ "id": "10",
157
+ "name": "Polarized Sunglasses",
158
+ "description": "UV400 polarized lenses in acetate frame. Protection meets style with timeless wayfarer silhouette.",
159
+ "price": 1799,
160
+ "originalPrice": 2499,
161
+ "category": "Accessories",
162
+ "image": "/images/products/product-10.jpg",
163
+ "rating": 4.3,
164
+ "reviewCount": 156,
165
+ "inStock": true,
166
+ "tags": [
167
+ "sunglasses",
168
+ "UV",
169
+ "fashion"
170
+ ]
171
+ },
172
+ {
173
+ "id": "11",
174
+ "name": "Portable Bluetooth Speaker",
175
+ "description": "360° surround sound, IPX7 waterproof, 20-hour playtime. Your perfect outdoor companion.",
176
+ "price": 3999,
177
+ "originalPrice": 5499,
178
+ "category": "Electronics",
179
+ "image": "/images/products/product-11.jpg",
180
+ "rating": 4.5,
181
+ "reviewCount": 298,
182
+ "inStock": true,
183
+ "tags": [
184
+ "speaker",
185
+ "bluetooth",
186
+ "outdoor"
187
+ ]
188
+ },
189
+ {
190
+ "id": "12",
191
+ "name": "Yoga Mat Premium",
192
+ "description": "6mm thick non-slip yoga mat with alignment lines, carrying strap, and eco-friendly TPE material.",
193
+ "price": 1499,
194
+ "originalPrice": 2199,
195
+ "category": "Lifestyle",
196
+ "image": "/images/products/product-12.jpg",
197
+ "rating": 4.4,
198
+ "reviewCount": 178,
199
+ "inStock": true,
200
+ "tags": [
201
+ "yoga",
202
+ "fitness",
203
+ "wellness"
204
+ ]
205
+ },
206
+ {
207
+ "id": "13",
208
+ "name": "Hoodie Essential",
209
+ "description": "400gsm heavyweight fleece hoodie with kangaroo pocket, ribbed cuffs, and adjustable drawstring.",
210
+ "price": 2199,
211
+ "originalPrice": 2999,
212
+ "category": "Clothing",
213
+ "image": "/images/products/product-13.jpg",
214
+ "rating": 4.7,
215
+ "reviewCount": 412,
216
+ "inStock": true,
217
+ "tags": [
218
+ "hoodie",
219
+ "comfort",
220
+ "winter"
221
+ ]
222
+ },
223
+ {
224
+ "id": "14",
225
+ "name": "Mechanical Keyboard TKL",
226
+ "description": "Tenkeyless mechanical keyboard with Cherry MX switches, RGB backlighting, and PBT doubleshot keycaps.",
227
+ "price": 6499,
228
+ "originalPrice": 8999,
229
+ "category": "Electronics",
230
+ "image": "/images/products/product-14.jpg",
231
+ "rating": 4.8,
232
+ "reviewCount": 234,
233
+ "inStock": true,
234
+ "tags": [
235
+ "keyboard",
236
+ "mechanical",
237
+ "gaming"
238
+ ]
239
+ },
240
+ {
241
+ "id": "15",
242
+ "name": "Scented Soy Candle Set",
243
+ "description": "Set of 3 hand-poured soy wax candles. Scents: Vanilla Bean, Ocean Breeze, Sandalwood. 45hrs burn time each.",
244
+ "price": 1299,
245
+ "originalPrice": 1799,
246
+ "category": "Lifestyle",
247
+ "image": "/images/products/product-15.jpg",
248
+ "rating": 4.6,
249
+ "reviewCount": 143,
250
+ "inStock": true,
251
+ "tags": [
252
+ "candle",
253
+ "home",
254
+ "wellness"
255
+ ]
256
+ },
257
+ {
258
+ "id": "16",
259
+ "name": "Canvas Backpack 28L",
260
+ "description": "Heavy-duty waxed canvas backpack, 28L capacity, laptop sleeve, multiple pockets, leather accents.",
261
+ "price": 3999,
262
+ "originalPrice": 5299,
263
+ "category": "Accessories",
264
+ "image": "/images/products/product-16.jpg",
265
+ "rating": 4.5,
266
+ "reviewCount": 267,
267
+ "inStock": true,
268
+ "tags": [
269
+ "backpack",
270
+ "canvas",
271
+ "travel"
272
+ ]
273
+ },
274
+ {
275
+ "id": "17",
276
+ "name": "Chino Pants Slim",
277
+ "description": "Stretch cotton chino pants in slim fit. Wrinkle-resistant fabric, perfect for office to weekend.",
278
+ "price": 1699,
279
+ "originalPrice": 2299,
280
+ "category": "Clothing",
281
+ "image": "/images/products/product-17.jpg",
282
+ "rating": 4.2,
283
+ "reviewCount": 189,
284
+ "inStock": true,
285
+ "tags": [
286
+ "pants",
287
+ "chino",
288
+ "formal"
289
+ ]
290
+ },
291
+ {
292
+ "id": "18",
293
+ "name": "Wireless Mouse Ergonomic",
294
+ "description": "2.4GHz wireless ergonomic mouse, 90-day battery, silent clicks, 6 DPI levels, multi-device pairing.",
295
+ "price": 2499,
296
+ "originalPrice": 3299,
297
+ "category": "Electronics",
298
+ "image": "/images/products/product-18.jpg",
299
+ "rating": 4.4,
300
+ "reviewCount": 312,
301
+ "inStock": false,
302
+ "tags": [
303
+ "mouse",
304
+ "wireless",
305
+ "ergonomic"
306
+ ]
307
+ },
308
+ {
309
+ "id": "19",
310
+ "name": "Chelsea Leather Boots",
311
+ "description": "Classic Chelsea boots in full-grain leather with elastic side panels and pull tab. Timeless style.",
312
+ "price": 5999,
313
+ "originalPrice": 7999,
314
+ "category": "Footwear",
315
+ "image": "/images/products/product-19.jpg",
316
+ "rating": 4.7,
317
+ "reviewCount": 98,
318
+ "inStock": true,
319
+ "tags": [
320
+ "boots",
321
+ "leather",
322
+ "formal"
323
+ ]
324
+ },
325
+ {
326
+ "id": "20",
327
+ "name": "Ceramic Pour-Over Coffee Set",
328
+ "description": "Handcrafted ceramic pour-over dripper with server, 2 cups, and 40 filters. The perfect morning ritual.",
329
+ "price": 2299,
330
+ "originalPrice": 2999,
331
+ "category": "Lifestyle",
332
+ "image": "/images/products/product-20.jpg",
333
+ "rating": 4.8,
334
+ "reviewCount": 167,
335
+ "inStock": true,
336
+ "tags": [
337
+ "coffee",
338
+ "ceramic",
339
+ "kitchen"
340
+ ]
341
+ },
342
+ {
343
+ "id": "21",
344
+ "name": "Sports Bra Performance",
345
+ "description": "High-impact sports bra with moisture-wicking fabric, adjustable straps, and built-in cups.",
346
+ "price": 899,
347
+ "originalPrice": 1299,
348
+ "category": "Clothing",
349
+ "image": "/images/products/product-21.jpg",
350
+ "rating": 4.3,
351
+ "reviewCount": 234,
352
+ "inStock": true,
353
+ "tags": [
354
+ "sports",
355
+ "activewear",
356
+ "women"
357
+ ]
358
+ },
359
+ {
360
+ "id": "22",
361
+ "name": "Desk Lamp LED Smart",
362
+ "description": "Smart LED desk lamp, 5 color temps, touch control, USB-C charging port, eye-care technology.",
363
+ "price": 2999,
364
+ "originalPrice": 3999,
365
+ "category": "Electronics",
366
+ "image": "/images/products/product-22.jpg",
367
+ "rating": 4.5,
368
+ "reviewCount": 143,
369
+ "inStock": true,
370
+ "tags": [
371
+ "lamp",
372
+ "led",
373
+ "smart home"
374
+ ]
375
+ },
376
+ {
377
+ "id": "23",
378
+ "name": "Silk Tie Collection",
379
+ "description": "Premium 100% silk tie in classic 8cm width. Available in timeless patterns for every occasion.",
380
+ "price": 1199,
381
+ "originalPrice": 1699,
382
+ "category": "Accessories",
383
+ "image": "/images/products/product-23.jpg",
384
+ "rating": 4.2,
385
+ "reviewCount": 78,
386
+ "inStock": true,
387
+ "tags": [
388
+ "tie",
389
+ "silk",
390
+ "formal"
391
+ ]
392
+ },
393
+ {
394
+ "id": "24",
395
+ "name": "Foam Roller Recovery",
396
+ "description": "High-density EPP foam roller for muscle recovery and deep tissue massage. 33cm x 15cm.",
397
+ "price": 699,
398
+ "originalPrice": 999,
399
+ "category": "Lifestyle",
400
+ "image": "/images/products/product-24.jpg",
401
+ "rating": 4.4,
402
+ "reviewCount": 189,
403
+ "inStock": true,
404
+ "tags": [
405
+ "fitness",
406
+ "recovery",
407
+ "sports"
408
+ ]
409
+ },
410
+ {
411
+ "id": "25",
412
+ "name": "Linen Shirt Relaxed",
413
+ "description": "Breathable 100% linen shirt in relaxed fit. Summer essential that gets better with every wash.",
414
+ "price": 1599,
415
+ "originalPrice": 2199,
416
+ "category": "Clothing",
417
+ "image": "/images/products/product-25.jpg",
418
+ "rating": 4.3,
419
+ "reviewCount": 156,
420
+ "inStock": true,
421
+ "tags": [
422
+ "shirt",
423
+ "linen",
424
+ "summer"
425
+ ]
426
+ }
427
+ ]
@@ -0,0 +1,27 @@
1
+ export function getItem<T>(key: string, fallback: T): T {
2
+ try {
3
+ if (typeof window === 'undefined') return fallback;
4
+ const item = localStorage.getItem(key);
5
+ return item ? (JSON.parse(item) as T) : fallback;
6
+ } catch {
7
+ return fallback;
8
+ }
9
+ }
10
+
11
+ export function setItem<T>(key: string, value: T): void {
12
+ try {
13
+ if (typeof window === 'undefined') return;
14
+ localStorage.setItem(key, JSON.stringify(value));
15
+ } catch {
16
+ console.warn(`Could not save to localStorage: ${key}`);
17
+ }
18
+ }
19
+
20
+ export function removeItem(key: string): void {
21
+ try {
22
+ if (typeof window === 'undefined') return;
23
+ localStorage.removeItem(key);
24
+ } catch {
25
+ console.warn(`Could not remove from localStorage: ${key}`);
26
+ }
27
+ }
@@ -0,0 +1,25 @@
1
+ export function formatPrice(price: number): string {
2
+ return new Intl.NumberFormat('en-IN', {
3
+ style: 'currency',
4
+ currency: 'INR',
5
+ minimumFractionDigits: 0,
6
+ maximumFractionDigits: 0,
7
+ }).format(price);
8
+ }
9
+
10
+ export function truncate(text: string, maxLength: number): string {
11
+ if (text.length <= maxLength) return text;
12
+ return text.slice(0, maxLength).trim() + '...';
13
+ }
14
+
15
+ export function getDiscount(original: number, current: number): number {
16
+ return Math.round(((original - current) / original) * 100);
17
+ }
18
+
19
+ export function generateId(): string {
20
+ return Date.now().toString(36) + Math.random().toString(36).slice(2);
21
+ }
22
+
23
+ export function cn(...classes: (string | undefined | false | null)[]): string {
24
+ return classes.filter(Boolean).join(' ');
25
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+
4
+ // NOTE: This file should not be edited
5
+ // see https://nextjs.org/docs/basic-features/typescript for more information.
@@ -0,0 +1,13 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ images: {
4
+ remotePatterns: [
5
+ {
6
+ protocol: 'https',
7
+ hostname: 'images.unsplash.com',
8
+ },
9
+ ],
10
+ },
11
+ };
12
+
13
+ module.exports = nextConfig;
@@ -0,0 +1,14 @@
1
+ import type { NextConfig } from 'next';
2
+
3
+ const nextConfig: NextConfig = {
4
+ images: {
5
+ remotePatterns: [
6
+ {
7
+ protocol: 'https',
8
+ hostname: 'images.unsplash.com',
9
+ },
10
+ ],
11
+ },
12
+ };
13
+
14
+ export default nextConfig;
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "my-store",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "lint": "next lint"
10
+ },
11
+ "dependencies": {
12
+ "next": "14.2.5",
13
+ "react": "^18",
14
+ "react-dom": "^18",
15
+ "zustand": "^4.5.4",
16
+ "lucide-react": "^0.400.0",
17
+ "framer-motion": "^11.3.0"
18
+ },
19
+ "devDependencies": {
20
+ "typescript": "^5",
21
+ "@types/node": "^20",
22
+ "@types/react": "^18",
23
+ "@types/react-dom": "^18",
24
+ "postcss": "^8",
25
+ "tailwindcss": "^3.4.1",
26
+ "autoprefixer": "^10",
27
+ "eslint": "^8",
28
+ "eslint-config-next": "14.2.5"
29
+ }
30
+ }
@@ -0,0 +1,7 @@
1
+ /** @type {import('postcss').Config} */
2
+ module.exports = {
3
+ plugins: {
4
+ tailwindcss: {},
5
+ autoprefixer: {},
6
+ },
7
+ };
@@ -0,0 +1 @@
1
+ // Service Worker placeholder — prevents 404 in browser console