Skip to main content

Overview

The Bİ DOLU İÇECEK application is a static React app that can be deployed to various hosting platforms. This guide covers deployment to popular platforms and configuration requirements.

Prerequisites

Before deploying, ensure you have:
  • Built the application (npm run build)
  • A Git repository with your code
  • An account on your chosen hosting platform
This application uses static hosting and doesn’t require a server-side runtime. Any platform that can serve static files will work.

Deployment Platforms

Environment Variables

Configure environment variables for your deployment:

Required Variables

For Vercel Edge Config integration, you’ll need the EDGE_CONFIG environment variable.
EDGE_CONFIG - Edge Config connection string (Vercel only)
EDGE_CONFIG=https://edge-config.vercel.com/[CONFIG_ID]?token=[TOKEN]

Setting Environment Variables

  1. Go to Project Settings → Environment Variables
  2. Add variables for each environment:
    • Production
    • Preview
    • Development
  3. Redeploy for changes to take effect
Or via CLI:
vercel env add EDGE_CONFIG production
Environment variables starting with REACT_APP_ are embedded in the build at build-time. Never commit .env files containing secrets to version control.

Edge Config Setup (Vercel)

The application uses Vercel Edge Config for remote configuration of service hours, store status, and emergency messages.
1

Create Edge Config Store

  1. Go to Vercel Dashboard
  2. Navigate to Storage → Edge Config
  3. Click “Create Edge Config”
  4. Name it suapp-config
2

Configure Initial Data

Click “Edit Items” and add the configuration:
{
  "service_hours": {
    "enabled": true,
    "startHour": 8,
    "startMinute": 30,
    "endHour": 22,
    "endMinute": 50,
    "weekdaysEnabled": true,
    "weekendsEnabled": true,
    "closedDates": [],
    "timezone": "Europe/Istanbul"
  },
  "store_status": {
    "isOpen": true,
    "temporarilyClosed": false,
    "maintenanceMode": false,
    "reason": ""
  },
  "emergency_message": {
    "enabled": false,
    "message": "",
    "priority": "normal"
  }
}
3

Connect to Project

  1. In Edge Config, go to Tokens tab
  2. Copy the Connection String
  3. Add to Project Environment Variables:
    • Name: EDGE_CONFIG
    • Value: Your connection string
    • Environments: All (Production, Preview, Development)
4

Redeploy Application

vercel --prod

Edge Config Features

With Edge Config, you can remotely control:
  1. Service Hours - Change opening/closing times without redeploying
  2. Store Status - Temporarily close the store or enable maintenance mode
  3. Emergency Messages - Display urgent notifications to customers
Edge Config changes propagate globally within 2 minutes and don’t require rebuilding or redeploying the application.

Managing Edge Config

Temporarily Close Store:
{
  "store_status": {
    "isOpen": false,
    "temporarilyClosed": true,
    "reason": "Teknik bakım nedeniyle geçici olarak kapalıyız."
  }
}
Update Service Hours:
{
  "service_hours": {
    "startHour": 9,
    "endHour": 18,
    "weekendsEnabled": false
  }
}
Add Holiday Closures:
{
  "service_hours": {
    "closedDates": ["2024-01-01", "2024-12-25"]
  }
}
See src/config/edgeConfig.js:1 for implementation details.

Post-Deployment Checklist

After deploying, verify:
1

Check Application Loads

  • Visit your deployment URL
  • Verify the homepage loads correctly
  • Test navigation between sections
2

Test Core Features

  • Product selection and cart functionality
  • WhatsApp order integration
  • Service hours display
  • Responsive design on mobile
3

Verify Edge Config (Vercel)

  • Check browser console for Edge Config logs
  • Test service hours enforcement
  • Verify store status updates
4

Performance Check

  • Run Lighthouse audit
  • Check page load times
  • Test on various devices and networks

Common Deployment Issues

Blank Page After Deployment

Cause: Incorrect base URL or routing configuration Solution:
  • Check homepage in package.json
  • Ensure server redirects all routes to index.html
  • Verify build output in deployment logs

Assets Not Loading

Cause: Incorrect asset paths Solution:
  • Use relative imports: import logo from './logo.png'
  • Place static assets in public/ folder
  • Reference public assets with process.env.PUBLIC_URL

Environment Variables Not Working

Cause: Variables not prefixed or not set at build time Solution:
  • Prefix with REACT_APP_
  • Set variables before building
  • Redeploy after changing variables

Edge Config Not Loading

Cause: Missing or incorrect connection string Solution:
# Verify environment variable is set
vercel env ls

# Check connection string format
EDGE_CONFIG=https://edge-config.vercel.com/[ID]?token=[TOKEN]

# Redeploy with correct variable
vercel --prod
If Edge Config fails to load, the application will fall back to local configuration in src/config/serviceHours.js. Check browser console for Edge Config error messages.

Continuous Deployment

Set up automatic deployments for a seamless workflow:
1

Connect Git Repository

Link your hosting platform to your Git repository (GitHub, GitLab, or Bitbucket)
2

Configure Build Settings

  • Build command: npm run build
  • Output directory: build
  • Node version: 16.x or higher
3

Set Up Branch Deployments

  • Production: Deploy from main branch
  • Preview: Deploy from pull requests
  • Development: Deploy from develop branch (optional)
4

Enable Deploy Hooks

Configure webhooks for automatic deployments:
  • On git push
  • On pull request
  • On tag creation

Monitoring and Analytics

After deployment, monitor your application:
  • Vercel Analytics - Built-in performance monitoring
  • Google Analytics - User behavior tracking
  • Sentry - Error tracking and monitoring
  • Web Vitals - Core web vitals reporting
The application includes web-vitals package for performance monitoring. Check src/reportWebVitals.js for configuration.

Next Steps

  • Review Building Guide for build optimization tips
  • Set up monitoring and analytics
  • Configure custom domain
  • Enable HTTPS/SSL certificate
  • Set up staging environment

Build docs developers (and LLMs) love