- Node.js (v18 or higher)
- npm (comes with Node.js)
git clone https://github.com/adityakp15/ReServe.git
cd ReServecd backend
npm installCreate backend/.env:
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/ReServe?appName=ClusterName
JWT_SECRET=generate_with_command_below
GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
PORT=5001
NODE_ENV=developmentGenerate JWT_SECRET:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Get from your team:
MONGO_URI- MongoDB connection string (database is already hosted)GOOGLE_CLIENT_ID- Only needed if testing authentication features. Get from your team if needed.
Start backend:
npm startcd frontend
npm installCreate frontend/.env:
VITE_GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
VITE_API_URL=http://localhost:5001Get from your team:
VITE_API_URL- Backend URL (usehttp://localhost:5001if running backend locally, or your team's shared backend URL)VITE_GOOGLE_CLIENT_ID- Only needed if testing login/signup features. Get from your team if needed.
Start frontend:
npm run devOpen http://localhost:5173 in your browser
If running both backend and frontend:
- Terminal 1:
cd backend && npm start - Terminal 2:
cd frontend && npm run dev
If using shared backend (frontend only):
- Terminal:
cd frontend && npm run dev
Backend won't start:
- Check all variables in
backend/.envare set - Verify MongoDB connection string is correct
- Port 5001 might be in use - change
PORTin.env
Frontend won't start:
- Check all variables in
frontend/.envare set - Restart dev server after changing
.envfiles
"Failed to fetch" error:
- Verify backend is running (if using local backend)
- Check
VITE_API_URLmatches your backend URL - Restart both servers
Google Sign-In not working:
- Only needed if testing login/signup features
- Verify
GOOGLE_CLIENT_IDis set in both.envfiles - Use the same Client ID in frontend and backend
- Restart both servers after updating
.envfiles