Sergei
4a4fc5c077
fix(security): add input validation for POST/PATCH endpoints
...
- Install express-validator package
- Add validation to beneficiaries.js:
- POST /: name (string 1-200), phone (optional), address (optional)
- PATCH /🆔 name (string 1-200), phone, address, customName (max 100)
- Add validation to stripe.js:
- create-checkout-session: userId, beneficiaryName, beneficiaryAddress, email
- create-portal-session: customerId (string)
- create-payment-sheet: email (valid email), amount (positive int)
- create-subscription: beneficiaryId (int), paymentMethodId (string)
- cancel-subscription: beneficiaryId (int)
- reactivate-subscription: beneficiaryId (int)
- create-subscription-payment-sheet: beneficiaryId (int)
- confirm-subscription-payment: subscriptionId (string)
- Add validation to invitations.js:
- POST /: beneficiaryId (int), role (enum: caretaker/guardian), email (valid)
- POST /accept: code (string)
- POST /accept-public: code (string)
- PATCH /🆔 role (enum: caretaker/guardian)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-26 16:47:35 -08:00
Sergei
3a20d5cc08
Add security middleware to backend
...
Security features:
- Helmet: Security headers (XSS, clickjacking protection)
- CORS: Whitelist only allowed domains
- Rate Limiting: 100 req/15min general, 5 req/15min for auth
- Stripe webhook signature verification (already had)
- Admin API key protection (already had)
Allowed origins:
- wellnuo.smartlaunchhub.com
- wellnuo.com
- localhost (dev)
- Expo dev URLs
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-19 09:50:27 -08:00
Sergei
e1b32560ff
Add Node.js backend with Stripe integration and admin panel
...
Backend features:
- Express.js API server
- Supabase database integration
- Stripe Checkout for payments ($249 kit + $9.99/mo premium)
- Stripe webhooks for payment events
- Admin panel with order management
- Auth middleware with JWT
- Email service via Brevo
API endpoints:
- /api/stripe/* - Payment processing
- /api/webhook/stripe - Stripe webhooks
- /api/admin/* - Admin operations
- /function/well-api/api - Legacy API proxy
Database migrations:
- orders, subscriptions, push_tokens tables
Schemes updated:
- Removed updatedAt from all schemes
- Updated credentials section with live values
- Added Stripe configuration details
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-19 09:49:24 -08:00