Files
ocean-cleanup/START_SERVERS.md
Paul Bailey 3a6db92699 Add total litter collected display to user profile
- 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
2025-11-18 19:03:43 +00:00

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 install to ensure dependencies are installed

Frontend won't start

  • Check if port 5173 is already in use
  • Run npm install to ensure dependencies are installed
  • Check .env.local for 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_URL in .env.local matches your backend URL

Quick Check

Test if backend is running:

curl http://localhost:3005/api/events

Should return JSON with events list.