Deployment Guide
RADS-R Self-Host is a static web application that can be deployed to any hosting provider that serves HTML, CSS, and JavaScript files. No backend or database required.Deployment Overview
The application is built using Vite, which generates a production-optimized build in thedist/ directory. This folder contains everything needed to run the application.
All hosting options serve the same static files. Choose based on your familiarity, existing infrastructure, or specific requirements.
Build for Production
Before deploying, create a production build:- Compiles TypeScript to JavaScript
- Bundles all dependencies
- Optimizes assets (minification, tree-shaking)
- Outputs to the
dist/directory
dist/ folder structure:
Static Hosting Providers
Deploy to any static hosting provider with minimal configuration.Netlify
Deploy to Netlify with automatic builds from Git:Connect repository
- Sign in to Netlify
- Click “Add new site” → “Import an existing project”
- Connect your Git provider and select the repository
Configure build settings
Set the following build settings:
- Build command:
npm run build - Publish directory:
dist - Node version: 18 or higher (set in Environment variables)
netlify.toml for configuration:
netlify.toml
Vercel
Deploy to Vercel with zero configuration:Import project
- Sign in to Vercel
- Click “Add New” → “Project”
- Import your Git repository
Configure (auto-detected)
Vercel automatically detects Vite projects and sets:
- Build command:
npm run build - Output directory:
dist - Install command:
npm install
Cloudflare Pages
Deploy to Cloudflare Pages with global CDN:Create project
- Sign in to Cloudflare
- Navigate to Pages → “Create a project”
- Connect your Git provider
Configure build
Set build configuration:
- Framework preset: Vite
- Build command:
npm run build - Build output directory:
dist
GitHub Pages
Deploy to GitHub Pages for free hosting:
Alternative: Use GitHub Actions for automated deployments:
.github/workflows/deploy.yml
AWS S3 + CloudFront
Deploy to AWS with S3 for storage and CloudFront for CDN:Docker Deployment
Run the application in a Docker container with nginx:
Docker Compose (optional):
docker-compose.yml
docker-compose up -d
Self-Hosted Options
Deploy to your own infrastructure:Apache
- Build the application:
npm run build - Copy
dist/contents to Apache document root:/var/www/html/ - Configure
.htaccessfor SPA routing:
.htaccess
Nginx
- Build the application:
npm run build - Copy
dist/contents to nginx html directory:/usr/share/nginx/html/ - Configure nginx for SPA routing:
/etc/nginx/sites-available/raads-r
- Enable site and reload nginx:
Environment Considerations
HTTPS Requirement
Most hosting providers (Netlify, Vercel, Cloudflare Pages) provide automatic HTTPS. For self-hosted:- Use Let’s Encrypt for free SSL certificates
- Configure nginx/Apache with SSL
- Use Cloudflare for SSL termination
Base Path Configuration
If deploying to a subdirectory (e.g.,example.com/raads-r/), update vite.config.ts:
vite.config.ts
Build Optimization
The production build is automatically optimized by Vite:- Minification: JavaScript and CSS are minified
- Tree-shaking: Unused code is removed
- Code splitting: Automatic chunking for optimal loading
- Asset hashing: Cache busting for static assets
Verification
After deployment, verify the application works correctly:Test functionality
- Start the questionnaire
- Answer a few questions
- Navigate forward and backward
- Test dark/light mode toggle
Continuous Deployment
Automate deployments with Git-based workflows:- Push to main branch triggers automatic deployment
- Pull request previews for testing before merge (Netlify, Vercel)
- Rollback capability to previous versions if issues arise
- Build logs for debugging deployment failures
Performance Considerations
- CDN: Use providers with global CDN (Netlify, Vercel, Cloudflare)
- Caching: Static assets are cached with far-future expires headers
- Compression: Enable gzip/brotli compression on your server
- Lazy loading: Vite automatically code-splits for optimal loading
Next Steps
Customization
Customize the questionnaire and UI to fit your needs.
User Guide
Learn how to use the questionnaire and interpret results.