Spaces:
Runtime error
Runtime error
Hanzo Dev
commited on
Commit
Β·
ddaec8b
1
Parent(s):
eb916d9
Simplify Docker startup
Browse files- .npmrc +1 -0
- Dockerfile +7 -10
- README.bak.md +132 -0
- next.config.js +0 -1
.npmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
legacy-peer-deps=true
|
Dockerfile
CHANGED
|
@@ -2,20 +2,17 @@ FROM node:20-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Copy
|
| 6 |
-
COPY
|
| 7 |
|
| 8 |
-
# Install dependencies
|
| 9 |
RUN npm ci --legacy-peer-deps
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
COPY . .
|
| 13 |
-
|
| 14 |
-
# Build the Next.js app
|
| 15 |
RUN npm run build
|
| 16 |
|
| 17 |
-
# Expose
|
| 18 |
EXPOSE 3000
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
CMD ["
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Copy everything
|
| 6 |
+
COPY . .
|
| 7 |
|
| 8 |
+
# Install dependencies
|
| 9 |
RUN npm ci --legacy-peer-deps
|
| 10 |
|
| 11 |
+
# Build the app
|
|
|
|
|
|
|
|
|
|
| 12 |
RUN npm run build
|
| 13 |
|
| 14 |
+
# Expose port
|
| 15 |
EXPOSE 3000
|
| 16 |
|
| 17 |
+
# Start with npm start
|
| 18 |
+
CMD ["npm", "start"]
|
README.bak.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ecommerce Storefront
|
| 2 |
+
|
| 3 |
+
Complete online store with cart and product management
|
| 4 |
+
|
| 5 |
+
Built with [@hanzo/ui](https://github.com/hanzoai/ui) components - a modern React component library based on Radix UI and Tailwind CSS.
|
| 6 |
+
|
| 7 |
+
## π Quick Start
|
| 8 |
+
|
| 9 |
+
### Deploy to Hanzo Cloud
|
| 10 |
+
|
| 11 |
+
[](https://hanzo.app/deploy?template=https://github.com/hanzoai/template-ecommerce-storefront)
|
| 12 |
+
|
| 13 |
+
**Instant deployment** - Click to deploy this template to Hanzo Cloud. If you're not signed in, we'll create a public repo for you and you can start editing immediately!
|
| 14 |
+
|
| 15 |
+
### Edit on Hanzo
|
| 16 |
+
|
| 17 |
+
[](https://hanzo.app/edit/github/hanzoai/template-ecommerce-storefront)
|
| 18 |
+
|
| 19 |
+
**Cloud IDE** - Click to open this template in Hanzo's cloud development environment. No local setup required!
|
| 20 |
+
|
| 21 |
+
### Local Development
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
# Clone this template
|
| 25 |
+
git clone https://github.com/hanzoai/template-ecommerce-storefront.git
|
| 26 |
+
cd ecommerce-storefront
|
| 27 |
+
|
| 28 |
+
# Install dependencies
|
| 29 |
+
npm install
|
| 30 |
+
# or
|
| 31 |
+
pnpm install
|
| 32 |
+
|
| 33 |
+
# Start development server
|
| 34 |
+
npm run dev
|
| 35 |
+
# or
|
| 36 |
+
pnpm dev
|
| 37 |
+
|
| 38 |
+
# Open http://localhost:3000
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## π’ Deploy to Hugging Face
|
| 42 |
+
|
| 43 |
+
This template includes a built-in publish option for Hugging Face Spaces:
|
| 44 |
+
|
| 45 |
+
1. **Login to Hugging Face** in your terminal:
|
| 46 |
+
```bash
|
| 47 |
+
huggingface-cli login
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
2. **Use the built-in publish command**:
|
| 51 |
+
```bash
|
| 52 |
+
npm run publish-hf
|
| 53 |
+
# or
|
| 54 |
+
pnpm publish-hf
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
This will automatically:
|
| 58 |
+
- Create a new Space in your HF account
|
| 59 |
+
- Configure it for Next.js deployment
|
| 60 |
+
- Push all necessary files
|
| 61 |
+
- Your app will be live at: `https://huggingface.co/spaces/YOUR_USERNAME/ecommerce-storefront`
|
| 62 |
+
|
| 63 |
+
3. **Or manually push** to an existing Space:
|
| 64 |
+
```bash
|
| 65 |
+
git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/ecommerce-storefront
|
| 66 |
+
git push hf main
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
## π¨ Features
|
| 70 |
+
|
| 71 |
+
- **Product Grid**: Beautiful product showcase with filters
|
| 72 |
+
- **Shopping Cart**: Full cart functionality with quantity controls
|
| 73 |
+
- **Filters & Search**: Advanced product filtering
|
| 74 |
+
- **Responsive Design**: Works perfectly on all devices
|
| 75 |
+
- **Dark Mode**: Built-in dark mode support
|
| 76 |
+
- **TypeScript**: Full type safety
|
| 77 |
+
|
| 78 |
+
## π¦ What's Included
|
| 79 |
+
|
| 80 |
+
- Next.js 14 with App Router
|
| 81 |
+
- React 18 with Server Components
|
| 82 |
+
- TypeScript configuration
|
| 83 |
+
- Tailwind CSS with custom theme
|
| 84 |
+
- ESLint and Prettier configs
|
| 85 |
+
- @hanzo/ui component library
|
| 86 |
+
- Lucide React icons
|
| 87 |
+
- Hugging Face deployment config
|
| 88 |
+
|
| 89 |
+
## π οΈ Customization
|
| 90 |
+
|
| 91 |
+
### Theme Colors
|
| 92 |
+
|
| 93 |
+
Edit `tailwind.config.js` to customize the color scheme:
|
| 94 |
+
|
| 95 |
+
```js
|
| 96 |
+
theme: {
|
| 97 |
+
extend: {
|
| 98 |
+
colors: {
|
| 99 |
+
primary: {
|
| 100 |
+
DEFAULT: "hsl(var(--primary))",
|
| 101 |
+
foreground: "hsl(var(--primary-foreground))",
|
| 102 |
+
},
|
| 103 |
+
// Add your custom colors
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
### Components
|
| 110 |
+
|
| 111 |
+
All UI components are in `components/ui/`. They're built with:
|
| 112 |
+
- Radix UI primitives for accessibility
|
| 113 |
+
- Tailwind CSS for styling
|
| 114 |
+
- Full TypeScript support
|
| 115 |
+
|
| 116 |
+
## π Documentation
|
| 117 |
+
|
| 118 |
+
- [Hanzo Documentation](https://hanzo.app/docs)
|
| 119 |
+
- [@hanzo/ui Components](https://github.com/hanzoai/ui)
|
| 120 |
+
- [Template Gallery](https://huggingface.co/spaces/hanzo-community/gallery)
|
| 121 |
+
|
| 122 |
+
## π€ Contributing
|
| 123 |
+
|
| 124 |
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
| 125 |
+
|
| 126 |
+
## π License
|
| 127 |
+
|
| 128 |
+
MIT License - see [LICENSE](LICENSE) file for details.
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
Built with β€οΈ by [Hanzo AI](https://hanzo.ai)
|
next.config.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
/** @type {import('next').NextConfig} */
|
| 2 |
const nextConfig = {
|
| 3 |
-
output: 'standalone',
|
| 4 |
reactStrictMode: true,
|
| 5 |
swcMinify: true,
|
| 6 |
}
|
|
|
|
| 1 |
/** @type {import('next').NextConfig} */
|
| 2 |
const nextConfig = {
|
|
|
|
| 3 |
reactStrictMode: true,
|
| 4 |
swcMinify: true,
|
| 5 |
}
|