113 lines
3.3 KiB
Markdown
113 lines
3.3 KiB
Markdown
|
|
# ✅ quiXzoom Shop — Komplett
|
|||
|
|
|
|||
|
|
## Sammanfattning
|
|||
|
|
|
|||
|
|
quiXzoom Shop är byggd och redo för produktion. Allt finns på plats.
|
|||
|
|
|
|||
|
|
## 🎯 quiXzoom Field Program
|
|||
|
|
|
|||
|
|
| Nivå | Uppdrag | Krav | Förmåner |
|
|||
|
|
|------|---------|------|----------|
|
|||
|
|
| **Contributor** | 0–9 | Registrerad | Digital profil |
|
|||
|
|
| **Field Contributor** | 10+ | 10 godkända uppdrag | 🔓 Field Gear Store |
|
|||
|
|
| **Verified Field Contributor** | 100+ | 100 uppdrag + 95% approval + verifierad ID + inga violations | 🔓 Field ID Kit (gratis) + publik verifiering |
|
|||
|
|
|
|||
|
|
## ✅ Allt byggt
|
|||
|
|
|
|||
|
|
### Backend (745 rader Python)
|
|||
|
|
- FastAPI service
|
|||
|
|
- PostgreSQL + Redis
|
|||
|
|
- JWT-auth
|
|||
|
|
- Tier-system med kvalitetskrav
|
|||
|
|
- Stripe-betalning
|
|||
|
|
- QR-kod generering
|
|||
|
|
- Publik verifieringssida
|
|||
|
|
|
|||
|
|
### Frontend (1234 rader HTML/CSS/JS)
|
|||
|
|
- Shop med produktlista
|
|||
|
|
- Kundvagn
|
|||
|
|
- Stripe Checkout
|
|||
|
|
- Verifieringssida med sök
|
|||
|
|
- Tier-badges
|
|||
|
|
|
|||
|
|
### App (React Native/Expo)
|
|||
|
|
- Shop-tab (🛒)
|
|||
|
|
- Tre tillstånd: Contributor / Field / Verified
|
|||
|
|
- WebView med token-injection
|
|||
|
|
|
|||
|
|
## 📁 Filer
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
quixzoom-shop/
|
|||
|
|
├── main.py # FastAPI backend (745 rader)
|
|||
|
|
├── requirements.txt # Dependencies
|
|||
|
|
├── Dockerfile # Docker
|
|||
|
|
├── docker-compose.yml # Docker Compose
|
|||
|
|
├── nginx-shop.conf # Nginx reverse proxy
|
|||
|
|
├── quixzoom-shop.service # systemd service
|
|||
|
|
├── setup.sh # Automatisk deployment
|
|||
|
|
├── deploy.sh # Docker deployment
|
|||
|
|
├── README.md # Översikt
|
|||
|
|
├── STRIPE_SETUP.md # Stripe guide
|
|||
|
|
├── DEPLOY.md # Produktionsguide
|
|||
|
|
├── SHOP_STATUS.md # Status
|
|||
|
|
├── COMPLETE.md # Denna fil
|
|||
|
|
├── templates/
|
|||
|
|
│ ├── shop.html # Produktlista (458 rader)
|
|||
|
|
│ ├── product.html # Produktdetalj (192 rader)
|
|||
|
|
│ ├── checkout.html # Stripe-betalning (250 rader)
|
|||
|
|
│ └── verify.html # Verifieringssida (334 rader)
|
|||
|
|
└── static/ # Bilder, CSS, JS
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 🚀 Deployment
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
# Automatisk setup (som root)
|
|||
|
|
sudo ./setup.sh
|
|||
|
|
|
|||
|
|
# Eller manuellt:
|
|||
|
|
sudo cp quixzoom-shop.service /etc/systemd/system/
|
|||
|
|
sudo cp nginx-shop.conf /etc/nginx/conf.d/
|
|||
|
|
sudo certbot --nginx -d shop.quixzoom.com
|
|||
|
|
sudo systemctl start quixzoom-shop
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 🔗 URL:er (efter deployment)
|
|||
|
|
|
|||
|
|
| Sida | URL |
|
|||
|
|
|------|-----|
|
|||
|
|
| Shop | `https://shop.quixzoom.com` |
|
|||
|
|
| Produkt | `https://shop.quixzoom.com/product/{id}` |
|
|||
|
|
| Checkout | `https://shop.quixzoom.com/checkout` |
|
|||
|
|
| Verifiering | `https://shop.quixzoom.com/verify/{id}` |
|
|||
|
|
| QR-kod | `https://shop.quixzoom.com/api/verify/qrcode/{id}` |
|
|||
|
|
| Health | `https://shop.quixzoom.com/health` |
|
|||
|
|
|
|||
|
|
## 🔧 Konfiguration
|
|||
|
|
|
|||
|
|
Miljövariabler (i systemd service):
|
|||
|
|
- `DATABASE_URL` — PostgreSQL
|
|||
|
|
- `REDIS_URL` — Redis
|
|||
|
|
- `JWT_SECRET` — JWT signing
|
|||
|
|
- `STRIPE_SECRET_KEY` — Stripe (test/live)
|
|||
|
|
- `STRIPE_PUBLISHABLE_KEY` — Stripe frontend
|
|||
|
|
- `STRIPE_WEBHOOK_SECRET` — Stripe webhook
|
|||
|
|
|
|||
|
|
## 📊 Produkter
|
|||
|
|
|
|||
|
|
18 Field Gear-produkter (10+ uppdrag) + 1 Field ID Kit (100+ uppdrag, gratis)
|
|||
|
|
|
|||
|
|
## 🔄 Nästa steg (efter deployment)
|
|||
|
|
|
|||
|
|
1. Ladda upp produktbilder till `static/`
|
|||
|
|
2. Konfigurera Stripe webhook
|
|||
|
|
3. Testa betalningsflöde med test-kort
|
|||
|
|
4. Byt till live Stripe-nycklar
|
|||
|
|
5. Sätt upp e-postbekräftelser
|
|||
|
|
6. Bygg admin-panel för ordrar
|
|||
|
|
|
|||
|
|
## 🎉 Klart!
|
|||
|
|
|
|||
|
|
Allt är byggt. Kör `sudo ./setup.sh` för att deploya.
|