This guide explains how to start and stop all components of the Email Client CLI system with a single command.
./start_all.shpython start_all.pystart_all.batThe startup scripts launch three components:
-
Email Processor (
main.py)- Monitors emails from Tile Pro Depot
- Processes orders every 5 minutes
- Runs in the background
-
Admin Backend (FastAPI)
- REST API server on http://localhost:8000
- Handles authentication and data management
- API documentation at http://localhost:8000/docs
-
Admin Frontend (React)
- Web interface on http://localhost:5173
- Default login:
admin@example.com/changeme - Real-time monitoring dashboard
./stop_all.sh
# or press Ctrl+C in the terminal running start_all.sh# Press Ctrl+C in the terminal running the start scriptClose all command windows or press Ctrl+C in each window
All services write logs to the logs/ directory:
logs/email_processor.log- Main email processinglogs/admin_backend.log- API server logslogs/admin_frontend.log- Frontend dev server logs
Before running the startup scripts, ensure you have:
- Python 3.8+ installed
- Node.js 14+ and npm installed
.envfile configured (copy from.env.example)- Virtual environments will be created automatically
chmod +x start_all.sh stop_all.sh start_all.py# Check what's using the ports
lsof -i :8000 # Backend port
lsof -i :5173 # Frontend port
# Kill the processes
kill -9 <PID>- Check the log files in
logs/directory - Ensure all prerequisites are installed
- Verify
.envfile is properly configured - Try starting services individually:
# Email processor python main.py # Admin backend cd admin_panel/backend ./run_dev.sh # Admin frontend cd admin_panel/frontend npm run dev
# Remove and recreate virtual environments
rm -rf venv admin_panel/backend/venv
# Then run the start script again- Automatic dependency installation: Creates virtual environments and installs packages
- Health checks: Waits for services to be ready before proceeding
- Colored output: Clear status messages
- Log management: All output redirected to log files
- Graceful shutdown: Stops all services when interrupted
- Cross-platform: Works on Mac, Linux, and Windows
- First run: The first run may take longer as it installs dependencies
- Background mode: Services run in the background, check logs for output
- Development: The scripts use development servers with hot-reload enabled
- Production: For production, use proper process managers (systemd, PM2, etc.)
Once started, you can:
- Open http://localhost:5173 for the admin panel
- View real-time logs:
tail -f logs/*.log - Check API docs: http://localhost:8000/docs
- Monitor system status in the admin dashboard
The default login credentials are for development only. In production:
- Change the default password immediately
- Use strong passwords
- Enable HTTPS
- Restrict access to trusted networks