2.0 KiB
2.0 KiB
Setup Anleitung
Quick Start Guide für das OMS
Voraussetzungen
- Node.js 18+
- npm
- Docker (optional)
Installation
Variante 1: Docker (empfohlen)
docker compose up
Das war's!
- Backend läuft auf http://localhost:3990
- Frontend läuft auf http://localhost:3980
Variante 2: Lokal
# Dependencies installieren
npm run install:all
# In zwei separaten Terminals:
npm run dev # Backend (Terminal 1)
npm run dev:frontend # Frontend (Terminal 2)
API Testen
Mit Browser
- Frontend öffnen: http://localhost:3980
- Formular ausfüllen
- Bestellung abschicken
Mit curl
curl -X POST http://localhost:3990/orders \
-H "Content-Type: application/json" \
-d '{
"customerId": "DW001",
"customerName": "Lui Denkwerk",
"customerEmail": "lui@test.de",
"items": [{
"productId": "TISCH1",
"quantity": 1,
"price": 200.80
}],
"shippingAddress": {
"street": "Hauptstr. 1",
"city": "Grevenbroich",
"postalCode": "41515",
"country": "DE"
}
}'
Tests ausführen
npm test
Production Build
npm run build
npm start
Troubleshooting
Port schon belegt
Backend läuft auf Port 3990 Frontend auf 3980
Ändern in:
backend/src/server.ts-> PORT Konstantefrontend/vite.config.ts-> proxy config
DB Fehler
Die SQLite DB wird automatisch unter ./data/orders.db erstellt.
Falls Probleme: rm -rf data/ und neu starten
Docker Probleme
docker compose down
docker compose build --no-cache
docker compose up
Wichtige Hinweise
- SQLite DB wird beim ersten Start automatisch angelegt
- Events werden in der Console geloggt (Simulation)
- Backend Port ist 3990
- Frontend Proxy leitet
/ordersrequests an Backend weiter - In Production PostgreSQL statt SQLite verwenden
Nächste Schritte
Für Production:
- PostgreSQL Setup
- Environment Variables (
.env) - JWT Auth implementieren
- Message Queue für Events
- Monitoring Setup
- CI/CD Pipeline