- Go to Vercel
- Import your GitHub repository:
https://github.com/gauravsonii/PayThree.git - Set the Root Directory to
employee-portal - Configure Environment Variables:
MONGODB_URI=your_mongodb_connection_string NEXTAUTH_SECRET=your_random_secret_key NEXTAUTH_URL=https://your-app.vercel.app NEXT_PUBLIC_AVALANCHE_RPC_URL=https://api.avax.network/ext/bc/C/rpc RESEND_API_KEY=your_resend_api_key FROM_EMAIL=noreply@yourcompany.com - Deploy!
- Go to Vercel
- Import your GitHub repository:
https://github.com/gauravsonii/PayThree.git - Set the Root Directory to
hr-portal - Configure the same environment variables as above
- Deploy!
- Deploy Employee Portal first (follow Option 1)
- Deploy HR Portal as a separate project (follow Option 2)
- Update the URLs in each portal to reference the other
MONGODB_URI: MongoDB connection stringNEXTAUTH_SECRET: Random secret for authenticationNEXTAUTH_URL: Your deployed app URL
RESEND_API_KEY: For email notificationsFROM_EMAIL: Email address for notificationsNEXT_PUBLIC_AVALANCHE_RPC_URL: Avalanche RPC endpointNEXT_PUBLIC_ESOP_CONTRACT_ADDRESS: ESOP contract addressNEXT_PUBLIC_PAYROLL_CONTRACT_ADDRESS: Payroll contract addressNEXT_PUBLIC_USDC_CONTRACT_ADDRESS: USDC contract address
-
Clone the repository:
git clone https://github.com/gauravsonii/PayThree.git cd PayThree -
Install dependencies:
npm run install:all
-
Set up environment variables:
- Copy
.env.exampleto.env.localin bothemployee-portalandhr-portal - Update the values as needed
- Copy
-
Run development servers:
# Employee Portal (port 3000) npm run dev:employee # HR Portal (port 3001) npm run dev:hr
- Check Root Directory: Make sure Vercel is pointing to the correct directory (
employee-portalorhr-portal) - Check Build Output: Ensure the build completes successfully
- Check Environment Variables: All required variables must be set
- Check MongoDB Connection: Ensure MongoDB is accessible from Vercel
- Check API Routes: Verify that API routes are properly configured
- Create a MongoDB Atlas account
- Create a new cluster
- Get your connection string
- Add it to your environment variables
- Deploy contracts to Avalanche C-Chain
- Update contract addresses in environment variables
- Ensure contracts are properly configured
If you encounter issues:
- Check the Vercel deployment logs
- Verify all environment variables are set
- Ensure MongoDB is accessible
- Check that all dependencies are installed correctly