Route Rover is a comprehensive expense and mileage tracking application that can be self-hosted. This guide will help you deploy the application on your own server.
- Node.js 18+
- PostgreSQL 12+
- Git
- PM2 (recommended for production)
# Clone or extract the application
cd route-rover
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env# Create PostgreSQL database
createdb route_rover
# Update .env with your database URL
DATABASE_URL="postgresql://user:password@localhost:5432/route_rover"
# Push database schema
npm run db:pushEdit .env file with your settings:
# Required
DATABASE_URL="postgresql://user:password@localhost:5432/route_rover"
SESSION_SECRET="your-very-secure-session-secret-minimum-32-characters"
# API keys are configured through the application Settings UI
# (not as server environment variables)
# Production settings
NODE_ENV="production"
PORT="5000"
ALLOWED_ORIGINS="https://yourdomain.com"# Build the application
npm run build
# Start in production
npm start
# Or use PM2 for production (recommended)
pm2 start dist/index.js --name route-rover- ✅ Expense tracking with receipt OCR
- ✅ Mileage tracking with GPS
- ✅ Schedule import (CSV/Excel)
- ✅ IRS-compliant reporting
- ✅ Mobile-responsive design
- ✅ Dark/light theme support
- ✅ Rate limiting on all endpoints
- ✅ Helmet security headers
- ✅ Input sanitization
- ✅ CORS protection
- ✅ Session-based authentication
- ✅ Password hashing with bcrypt
- ✅ File upload validation
- OpenAI API: Enhanced OCR for receipt processing
- Google Maps API: Route calculation for mileage tracking
The application uses session-based authentication with username/password.
- Start the application
- Navigate to the registration page
- Create your admin account
- Login with your credentials
In development mode, you can login with:
- Username:
demo - Password:
password123
- Use a strong
SESSION_SECRET(32+ random characters) - Set
NODE_ENV=production - Configure
ALLOWED_ORIGINSfor your domain - Use HTTPS in production
- Regularly update dependencies
- Monitor logs for security issues
- Use PM2 or similar process manager
- Configure PostgreSQL for your workload
- Set up log rotation
- Monitor resource usage
- Consider Redis for session storage in high-traffic scenarios
- Regular PostgreSQL backups
- Backup uploaded files in
uploads/directory - Export data using built-in export features
route-rover/
├── client/ # React frontend
├── server/ # Express backend
├── shared/ # Shared types and schemas
├── dist/ # Built application
├── uploads/ # File uploads (receipts)
├── .env # Environment configuration
└── package.json # Dependencies
# Reset database schema
npm run db:push --force
# Check database connection
psql $DATABASE_URL -c "SELECT version();"# Ensure proper file permissions
chmod 755 uploads/
chown -R app:app route-rover/# Check if port is in use
netstat -tlnp | grep :5000
# Kill process using port
sudo kill $(sudo lsof -t -i:5000)# PM2 logs
pm2 logs route-rover
# Check application logs
tail -f logs/app.logPOST /api/register- Create new userPOST /api/login- User loginPOST /api/logout- User logoutGET /api/user- Get current user
GET /api/expenses- List expensesPOST /api/expenses- Create expenseGET /api/trips- List tripsPOST /api/trips- Create tripPOST /api/receipts/upload- Upload receipt
For issues and questions:
- Check the logs first
- Verify environment configuration
- Ensure database connectivity
- Check file permissions
MIT License - See LICENSE file for details.