This guide will help you deploy your Portfolio Tracker application to production.
- Supabase Account - Sign up here
- Finnhub API Key - Get free API key here
- GitHub Account - Your code is already there
- Render Account - Sign up here (for backend)
- Vercel Account - Sign up here (for frontend)
- Frontend (React/Vite) → Vercel
- Backend (Express.js) → Render
- Go to supabase.com and sign in
- Click "New Project"
- Choose your organization
- Enter project name:
portfolio-tracker - Enter a database password (save this!)
- Choose a region close to your users
- Click "Create new project"
- In your Supabase dashboard, go to Settings > API
- Copy these values:
- Project URL:
https://your-project-id.supabase.co - anon public key:
eyJ...(starts with eyJ) - service_role key:
eyJ...(starts with eyJ)
- Project URL:
- Go to finnhub.io/register
- Sign up for a free account
- Copy your API key from the dashboard
-
Go to render.com and sign up/login
-
Click "New +" → "Web Service"
-
Connect your GitHub repository:
HackStyx/portfolio-tracker -
Configure the service:
Basic Settings:
- Name:
portfolio-tracker-backend - Environment:
Node - Region: Choose closest to your users
- Branch:
main - Root Directory:
backend - Build Command:
npm install - Start Command:
npm start - Plan: Free
- Name:
-
Add Environment Variables (click "Advanced" → "Add Environment Variable"):
NODE_ENV=production PORT=5000 FINNHUB_API_KEY=your_finnhub_api_key_here SUPABASE_URL=https://your-project-id.supabase.co SUPABASE_KEY=your_supabase_service_role_key_here -
Click "Create Web Service"
-
Wait for deployment (usually 2-5 minutes)
-
Copy your backend URL (e.g.,
https://portfolio-tracker-backend-abc123.onrender.com)
-
Go to vercel.com and sign up/login
-
Click "New Project"
-
Import your GitHub repository:
HackStyx/portfolio-tracker -
Configure the project:
Build Settings:
- Framework Preset: Vite
- Root Directory:
./(leave empty) - Build Command:
npm run build - Output Directory:
dist - Install Command:
npm install
-
Add Environment Variables (click "Environment Variables"):
VITE_SUPABASE_URL=https://your-project-id.supabase.co VITE_SUPABASE_ANON_KEY=your_supabase_anon_key_here VITE_API_BASE_URL=https://your-render-backend-url.onrender.com/api -
Click "Deploy"
-
Wait for deployment (usually 1-3 minutes)
-
Copy your frontend URL (e.g.,
https://portfolio-tracker-abc123.vercel.app)
- Go to your Supabase dashboard
- Navigate to Authentication > Settings
- Update Site URL to your Vercel frontend URL:
https://your-frontend-url.vercel.app
- In the same Authentication settings
- Add these Redirect URLs:
https://your-frontend-url.vercel.app/dashboard https://your-frontend-url.vercel.app/ http://localhost:5173/dashboard http://localhost:5173/
- In Authentication settings
- Enable "Enable email confirmations"
- This ensures users verify their email before accessing the app
- Visit your backend URL:
https://your-backend-url.onrender.com/api/health - You should see a response indicating the server is running
- Visit your frontend URL:
https://your-frontend-url.vercel.app - Try creating a new account
- Test the login functionality
- Navigate through the dashboard
- Sign in to your app
- Try adding stocks to your watchlist
- Check if stock data loads correctly
- Test the news and calendar features
-
"Module not found" errors
- Check that all dependencies are in
backend/package.json - Verify the build command is correct
- Check that all dependencies are in
-
"Environment variable not set" errors
- Double-check all environment variables in Render dashboard
- Make sure there are no extra spaces
-
"Port already in use" errors
- Render automatically sets the PORT environment variable
- Make sure your code uses
process.env.PORT
-
"Invalid API key" errors
- Verify your Supabase anon key is correct
- Check that environment variables are set in Vercel
-
"CORS errors"
- Backend should already be configured for CORS
- Check that your frontend URL is allowed
-
"Authentication not working"
- Verify Supabase site URL and redirect URLs
- Check browser console for detailed errors
-
"Table not found" errors
- Run the database migrations in Supabase
- Check the SQL editor in Supabase dashboard
-
"RLS policy errors"
- Verify Row Level Security policies are set up
- Check the authentication is working properly
- Go to your Render dashboard
- Click on your backend service
- Monitor logs, performance, and uptime
- Go to your Vercel dashboard
- Click on your project
- Monitor deployments, performance, and analytics
- Go to your Supabase dashboard
- Monitor database usage, API calls, and authentication
- Push changes to your GitHub repository
- Render will automatically redeploy
- Monitor the deployment logs
- Push changes to your GitHub repository
- Vercel will automatically redeploy
- Monitor the deployment status
Your Portfolio Tracker is now live!
- Frontend:
https://your-frontend-url.vercel.app - Backend:
https://your-backend-url.onrender.com - Database: Supabase dashboard
- Customize your app - Update branding, colors, and features
- Add more features - Implement additional portfolio tracking features
- Monitor performance - Keep an eye on usage and performance
- Scale up - Upgrade plans as your user base grows
If you encounter issues:
- Check the troubleshooting section above
- Review the deployment logs in Render/Vercel
- Check the browser console for frontend errors
- Review Supabase logs for backend errors
- Check the GitHub repository for updates
Happy deploying! 🚀