Files
ocean-cleanup/server
Paul Bailey f82de3621f docs: update Mailgun configuration with correct sandbox domain
- Update domain to sandbox1835a1917b07443f8c1ca858689c42ea.mailgun.org
- Set test email to psbailey31@gmail.com
- Add comprehensive Mailgun setup guide
- Document sandbox authorization requirements
- Create email testing script
- Update troubleshooting documentation

Note: Sandbox domains require recipient authorization in Mailgun dashboard
2025-11-17 00:34:21 +00:00
..

Beach Litter Mapping API

Backend API server for the Beach Litter Mapping Platform.

Setup

  1. Install dependencies:
cd server
npm install
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your configuration
  1. Set up the database:
npm run prisma:generate
npm run prisma:migrate
  1. Start the development server:
npm run dev

The API will be available at http://localhost:3000

API Endpoints

Reports

  • POST /api/reports/upload - Upload a photo (requires auth)
  • POST /api/reports - Create a new report (requires auth)
  • GET /api/reports - Get all reports (with optional filters)
  • GET /api/reports/:id - Get a single report
  • DELETE /api/reports/:id - Delete a report (requires auth, owner only)

Health Check

  • GET /health - Server health status

Environment Variables

See .env.example for required environment variables.

Database

The API uses MySQL 8.0+ with Prisma ORM. Connection details are configured in the .env file.

Authentication

Authentication is handled by Clerk. Protected endpoints require a Bearer token in the Authorization header.