This guide will walk you through deploying your Anti-Ragging and Human Rights Support System to Vercel.
- A GitHub account to host your repository
- A Vercel account (you can sign up at vercel.com using your GitHub account)
- Firebase project (as set up during development)
- Create a new GitHub repository
- Initialize Git in your project folder (if not already done):
git init git add . git commit -m "Initial commit"
- Add your GitHub repo as a remote and push your code:
git remote add origin https://github.com/yourusername/your-repo-name.git git push -u origin main
Before deploying, make sure you have the following Firebase configuration values ready:
- Firebase API Key
- Firebase Project ID
- Firebase App ID
These were configured as environment variables in your development environment.
- Log in to your Vercel account
- Click on "Add New..." → "Project"
- Import your GitHub repository
- Configure the project settings:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist
- In the "Environment Variables" section, add the following:
VITE_FIREBASE_API_KEY: Your Firebase API keyVITE_FIREBASE_PROJECT_ID: Your Firebase Project IDVITE_FIREBASE_APP_ID: Your Firebase App ID
- Click "Deploy"
Vercel will automatically build and deploy your application.
- After deployment, get your Vercel domain (usually
your-project-name.vercel.app) - Go to the Firebase console → Authentication → Settings → Authorized domains
- Add your Vercel domain to the list of authorized domains
- If you've set up Firebase Security Rules, make sure they're configured properly for production use
Follow the instructions in the ADMIN_SETUP_GUIDE.md file to set up admin access for your deployed application.
- Visit your Vercel deployment URL
- Test all major functionality:
- Home page loads correctly
- Anonymous report submission works
- Authentication works for admins
- Incidents page displays reports from Firebase
- Statistics are generated from real data
- Any changes pushed to your GitHub repository's main branch will automatically trigger a new deployment
- Monitor your Firebase console for any issues with authentication or database operations
- Periodically check for security vulnerabilities in your dependencies and update as needed
If you want to use a custom domain:
- In Vercel, go to your project settings → Domains
- Add your custom domain
- Follow the instructions to configure DNS settings
- Don't forget to add your custom domain to Firebase authorized domains list
If you encounter any issues with your deployment, check:
- Vercel deployment logs
- Firebase console for authentication or Firestore errors
- Application error logs in your browser's developer console