Overview
Theevershop start command starts your EverShop application in production mode. It serves the optimized bundles created by evershop build.
Usage
Prerequisites
Before runningevershop start, you must:
- Complete the installation:
evershop install - Build the application:
evershop build - Configure environment variables in
.env
What It Does
The start command:- Loads production environment configuration
- Initializes database connections
- Loads modules and extensions
- Runs bootstrap scripts
- Starts the Express HTTP server
- Serves pre-built static assets
- Handles API and GraphQL requests
Implementation
Fromsrc/bin/start/index.ts:
Production Environment
Environment Variables
Required environment variables:Configuration
Production configuration inconfig/production.json:
Server Configuration
Port
Default port is3000. Configure in config/production.json:
Host Binding
By default, the server binds to all interfaces (0.0.0.0). Configure specific host:
Process Management
Using PM2
Recommended for production:PM2 Ecosystem File
Using systemd
Create a systemd service:Using Docker
Performance Optimization
Database Connection Pooling
Configure connection pool size:Caching
Enable Redis caching:Static Asset Serving
Use Nginx as reverse proxy:Monitoring
Health Check Endpoint
Check if server is running:Logging
Production logs are written to:logs/error.log- Error logslogs/combined.log- All logs
Metrics
Monitor with PM2:- New Relic
- DataDog
- Prometheus + Grafana
Graceful Shutdown
The server handles shutdown signals:Scaling
Horizontal Scaling
Run multiple instances:Load Balancing
Use Nginx for load balancing:Troubleshooting
Server Won’t Start
evershop build first.
Port Already in Use
Database Connection Failed
Out of Memory
Security
Environment Variables
Never commit.env to version control:
HTTPS
Use reverse proxy (Nginx/Apache) for SSL:Security Headers
Configure in reverse proxy:Example Startup Output
Related Commands
evershop build- Build for productionevershop dev- Development serverevershop install- Initial setup