Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,51 @@ VITE_ENV=prod
VITE_API_URL_LOCAL=http://localhost:8080/
VITE_API_URL_DEV=https://api-dev.revive.com/
VITE_API_URL_PROD=https://revive-backend-production-93ea.up.railway.app/
# Set to true to use mock data (no backend required)
# Set to false when the real backend is ready
VITE_USE_MOCK=false

# Backend API base URL (used when VITE_USE_MOCK=false)
VITE_API_BASE_URL=https://revive-backend-production-93ea.up.railway.app/

# Stripe Publishable Key (from Stripe Dashboard)
# Key is not secret and can be exposed in the frontend
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_51TVquTBk5GmGQu8B3V0uymV7htzlgCLWpffQkRzemVflZvSu3QXc0HN0jg9c1FmzRenfbskDBtB12DJyAD6YMzHp00huHgTqol

# ======================================================================================
# WARNNING: STRIPE does NOT support transactions of less than $0.50 USD (25 - 30 EGP).
# If you are testing with a lower amount, Stripe will return an error.
#=======================================================================================

# Stripe Test Cards — Sandbox mode only
# Use any future expiry date (e.g. 12/34), any 3-digit CVC

# ✅ Successful payment
STRIPE_TEST_CARD_SUCCESS=4242424242424242

# ✅ Successful payment - Visa (debit)
STRIPE_TEST_CARD_VISA_DEBIT=4000056655665556

# ✅ Successful payment - Mastercard
STRIPE_TEST_CARD_MASTERCARD=5555555555554444

# ✅ Successful payment - American Express (4-digit CVC)
STRIPE_TEST_CARD_AMEX=378282246310005

# ⚠️ Requires 3D Secure authentication (tests your webhook/confirm flow)
STRIPE_TEST_CARD_3DS_REQUIRED=4000002500003155

# ❌ Card declined (generic)
STRIPE_TEST_CARD_DECLINED=4000000000000002

# ❌ Declined - insufficient funds
STRIPE_TEST_CARD_INSUFFICIENT_FUNDS=4000000000009995

# ❌ Declined - expired card
STRIPE_TEST_CARD_EXPIRED=4000000000000069

# ❌ Declined - incorrect CVC
STRIPE_TEST_CARD_CVC_FAIL=4000000000000127

# ❌ Charge succeeds but dispute/fraud flagged later (good for testing refund flow)
STRIPE_TEST_CARD_DISPUTE=4000000000000259
54 changes: 54 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Environment Configuration Example
# Copy this file to .env and fill in the actual values

# Set environment to local, dev, or prod
VITE_ENV=prod

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Unsafe defaults in .env.example risk accidental production targeting.

VITE_ENV=prod combined with VITE_USE_MOCK=false means a developer who copies this file to .env without reading carefully will immediately make real requests against the production API. Default to VITE_ENV=local and VITE_USE_MOCK=true for safety.

🛡️ Proposed fix for safe defaults
 # Set environment to local, dev, or prod
-VITE_ENV=prod
+VITE_ENV=local
 # Set to true to use mock data (no backend required)
 # Set to false when the real backend is ready
-VITE_USE_MOCK=false
+VITE_USE_MOCK=true

Also applies to: 14-14

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.env.example at line 5, Update the environment template defaults to use
VITE_ENV=local and VITE_USE_MOCK=true, ensuring copied configuration cannot
target the production API or make real requests by default.


# Environment URLs
VITE_API_URL_LOCAL=http://localhost:8080/
VITE_API_URL_DEV=https://api-dev.revive.com/
VITE_API_URL_PROD=https://revive-backend-production-93ea.up.railway.app/

# Set to true to use mock data (no backend required)
# Set to false when the real backend is ready
VITE_USE_MOCK=false

# Backend API base URL (used when VITE_USE_MOCK=false)
VITE_API_BASE_URL=https://revive-backend-production-93ea.up.railway.app/

# Stripe Publishable Key (from Stripe Dashboard)
# Key is not secret and can be exposed in the frontend
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_YOUR_STRIPE_PUBLISHABLE_KEY

# Stripe Test Cards — Sandbox mode only
# Use any future expiry date (e.g. 12/34), any 3-digit CVC

# ✅ Successful payment
STRIPE_TEST_CARD_SUCCESS=4242424242424242

# ✅ Successful payment - Visa (debit)
STRIPE_TEST_CARD_VISA_DEBIT=4000056655665556

# ✅ Successful payment - Mastercard
STRIPE_TEST_CARD_MASTERCARD=5555555555554444

# ✅ Successful payment - American Express (4-digit CVC)
STRIPE_TEST_CARD_AMEX=378282246310005

# ⚠️ Requires 3D Secure authentication (tests your webhook/confirm flow)
STRIPE_TEST_CARD_3DS_REQUIRED=4000002500003155

# ❌ Card declined (generic)
STRIPE_TEST_CARD_DECLINED=4000000000000002

# ❌ Declined - insufficient funds
STRIPE_TEST_CARD_INSUFFICIENT_FUNDS=4000000000009995

# ❌ Declined - expired card
STRIPE_TEST_CARD_EXPIRED=4000000000000069

# ❌ Declined - incorrect CVC
STRIPE_TEST_CARD_CVC_FAIL=4000000000000127

# ❌ Charge succeeds but dispute/fraud flagged later (good for testing refund flow)
STRIPE_TEST_CARD_DISPUTE=4000000000000259
Loading