Set up backend API server with Express and Prisma

- Initialize Node.js/Express backend project structure
- Configure TypeScript for backend development
- Set up Prisma ORM with MySQL database schema
- Implement authentication middleware with Clerk
- Create photo upload endpoint with EXIF extraction
- Build report CRUD endpoints (create, read, delete)
- Add file upload handling with Multer
- Configure CORS and security middleware (helmet)
- Set up error handling and validation
- Create development environment configuration

Task 21 complete: Backend foundation ready for report submissions
This commit is contained in:
2025-11-16 17:29:26 +00:00
parent 7dc1ff740b
commit c0ec28c5c9
15 changed files with 3191 additions and 0 deletions

38
server/package.json Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "beach-litter-api",
"version": "1.0.0",
"description": "Backend API for Beach Litter Mapping Platform",
"main": "dist/index.js",
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"prisma:generate": "prisma generate",
"prisma:migrate": "prisma migrate dev",
"prisma:studio": "prisma studio"
},
"keywords": ["beach", "litter", "environment", "api"],
"author": "",
"license": "MIT",
"dependencies": {
"@clerk/clerk-sdk-node": "^5.0.0",
"@prisma/client": "^5.22.0",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.21.1",
"express-validator": "^7.2.0",
"exifr": "^7.1.3",
"helmet": "^8.0.0",
"multer": "^1.4.5-lts.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^5.0.0",
"@types/multer": "^1.4.12",
"@types/node": "^22.9.0",
"prisma": "^5.22.0",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
}
}