- Updated backend userService to calculate total litter collected across all attended events - Added totalLitterCollected field to UserProfile interface - Added new statistics card showing total litter collected in kg - Updated profile grid layout to accommodate 5 statistics cards - Displays litter collected with 1 decimal place precision
1.1 KiB
1.1 KiB
Starting the Application
Backend Server
Open a terminal and run:
cd server
npm run dev
The backend server should start on http://localhost:3005
You should see output like:
Server running on port 3005
Connected to database
Frontend Development Server
Open another terminal and run:
npm run dev
The frontend should start on http://localhost:5173
Troubleshooting
Backend won't start
- Check if port 3005 is already in use:
lsof -ti:3005 - Check database connection in
server/.env - Run
cd server && npm installto ensure dependencies are installed
Frontend won't start
- Check if port 5173 is already in use
- Run
npm installto ensure dependencies are installed - Check
.env.localfor correct API URL
"Server returned non-JSON response" error
- This means the backend server is not running
- Start the backend server first (see above)
- Check that
VITE_API_BASE_URLin.env.localmatches your backend URL
Quick Check
Test if backend is running:
curl http://localhost:3005/api/events
Should return JSON with events list.