1.5 KiB
1.5 KiB
420Deals.ch
A premium collective buying platform for CBD in Switzerland.
Setup
Database
- Create the database using the provided SQL file:
mysql -u root -p < cbd420.sql
- Run the migration to add image support (optional but recommended):
mysql -u root -p cbd420 < migrations/add_image_url.sql
- Create a
.env.localfile in the root directory:
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=cbd420
Installation
npm install
Development
npm run dev
Visit http://localhost:3000 for the main site and http://localhost:3000/admin for the admin panel.
Admin Panel
Access the admin panel at /admin to:
- Create new drops
- View all drops
- Monitor drop progress and sold out status
Creating a Drop
- Navigate to
/admin - Fill in the form:
- Product Name: e.g., "Harlequin – Collective Drop"
- Batch Size: Total amount (e.g., 1000)
- Unit: Custom unit (e.g., g, kg, ml, etc.)
- Price Per Gram: Price in CHF (e.g., 2.50)
- Product Image: Optional product image upload (JPEG, PNG, WebP, max 5MB)
- Click "Create Drop"
Project Structure
app/- Next.js app directoryapi/drops/- API routes for drop managementadmin/- Admin panel pagecomponents/- React components
lib/db.ts- Database connection poolcbd420.sql- Database schema