Implemented comprehensive beta testing system with tier badges and
reorganized environment configuration for better maintainability.
Beta Testing Features:
- Beta banner component with dismissible state (localStorage)
- Auto-assign SUPPORTER tier to new registrations (env controlled)
- TierBadge component with SUPPORTER/COMFORT tier display
- Badge shown in Navbar, ProfilePage, and PublicProfilePage
- Environment variables: VITE_BETA_MODE, BETA_AUTO_SUPPORTER
Environment Configuration Reorganization:
- Moved .env files from root to frontend/ and backend/ directories
- Created .env.{development,production}{,.example} structure
- Updated docker-compose.yml to use env_file for frontend
- All env vars properly namespaced and documented
Privacy Policy Implementation:
- New /privacy route with dedicated PrivacyPage component
- Comprehensive GDPR/RODO compliant privacy policy (privacy.html)
- Updated CookieConsent banner to link to /privacy
- Added Privacy Policy links to all footers (HomePage, PublicFooter)
- Removed privacy section from About Us page
HTML Content System:
- Replaced react-markdown dependency with simple HTML loader
- New HtmlContentPage component for rendering .html files
- Converted about-us.md and how-it-works.md to .html format
- Inline CSS support for full styling control
- Easier content editing without React knowledge
Backend Changes:
- Registration auto-assigns SUPPORTER tier when BETA_AUTO_SUPPORTER=true
- Added accountTier to auth middleware and user routes
- Updated public profile endpoint to include accountTier
Files:
- Added: frontend/.env.{development,production}{,.example}
- Added: backend/.env variables for BETA_AUTO_SUPPORTER
- Added: components/BetaBanner.jsx, TierBadge.jsx, HtmlContentPage.jsx
- Added: pages/PrivacyPage.jsx
- Added: public/content/{about-us,how-it-works,privacy}.html
- Modified: docker-compose.yml (env_file configuration)
- Modified: App.jsx (privacy route, beta banner)
- Modified: auth.js (auto SUPPORTER tier logic)
45 lines
1.2 KiB
Bash
45 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
# Test script for beta registration with SUPPORTER tier
|
|
|
|
API_URL="http://localhost:8080/api"
|
|
TIMESTAMP=$(date +%s)
|
|
TEST_USERNAME="betatester${TIMESTAMP}"
|
|
TEST_EMAIL="beta${TIMESTAMP}@example.com"
|
|
TEST_PASSWORD="BetaTest123!"
|
|
|
|
echo "================================"
|
|
echo "Beta Registration Test"
|
|
echo "================================"
|
|
echo "Username: $TEST_USERNAME"
|
|
echo "Email: $TEST_EMAIL"
|
|
echo ""
|
|
|
|
# Register new user (skip Turnstile for testing)
|
|
echo "1. Registering new user..."
|
|
REGISTER_RESPONSE=$(curl -s -X POST "${API_URL}/auth/register" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{
|
|
\"username\": \"$TEST_USERNAME\",
|
|
\"email\": \"$TEST_EMAIL\",
|
|
\"password\": \"$TEST_PASSWORD\",
|
|
\"firstName\": \"Beta\",
|
|
\"lastName\": \"Tester\",
|
|
\"turnstileToken\": \"dummy-token-for-dev\"
|
|
}")
|
|
|
|
echo "Response: $REGISTER_RESPONSE"
|
|
echo ""
|
|
|
|
# Extract user ID and account tier
|
|
ACCOUNT_TIER=$(echo "$REGISTER_RESPONSE" | grep -o '"accountTier":"[^"]*"' | cut -d'"' -f4)
|
|
|
|
if [ "$ACCOUNT_TIER" == "SUPPORTER" ]; then
|
|
echo "✅ SUCCESS: User registered with SUPPORTER tier!"
|
|
else
|
|
echo "❌ FAILED: Expected SUPPORTER tier, got: $ACCOUNT_TIER"
|
|
fi
|
|
|
|
echo ""
|
|
echo "================================"
|