Files
spotlightcam/backend/package.json
Radosław Gierwiało 0e62b12f5e feat: add PostgreSQL database with Prisma ORM
Phase 1 - Step 2: PostgreSQL Setup

**Infrastructure:**
- Add PostgreSQL 15 Alpine container to docker-compose.yml
- Configure persistent volume for database data
- Update backend Dockerfile with OpenSSL for Prisma compatibility

**Database Schema (Prisma):**
- 6 tables: users, events, chat_rooms, messages, matches, ratings
- Foreign key relationships and cascading deletes
- Performance indexes on frequently queried columns
- Unique constraints for data integrity

**Prisma Setup:**
- Prisma Client for database queries
- Migration system with initial migration
- Seed script with 4 test events and chat rooms
- Database connection utility with singleton pattern

**API Implementation:**
- GET /api/events - List all events (with filtering and sorting)
- GET /api/events/:id - Get single event with relations
- Database connection test on server startup
- Graceful database disconnect on shutdown

**Seed Data:**
- Warsaw Dance Festival 2025
- Swing Camp Barcelona 2025
- Blues Week Herräng 2025
- Krakow Swing Connection 2025

**Testing:**
- Database connection verified 
- API endpoints returning data from PostgreSQL 
- Migrations applied successfully 

All systems operational 🚀
2025-11-12 21:56:11 +01:00

41 lines
1.0 KiB
JSON

{
"name": "spotlightcam-backend",
"version": "1.0.0",
"description": "Backend API for spotlight.cam - P2P video exchange for dance events",
"main": "src/server.js",
"scripts": {
"start": "node src/server.js",
"dev": "nodemon src/server.js",
"test": "jest --coverage",
"test:watch": "jest --watch",
"prisma:generate": "prisma generate",
"prisma:migrate": "prisma migrate dev",
"prisma:seed": "node prisma/seed.js",
"prisma:studio": "prisma studio"
},
"keywords": ["webrtc", "p2p", "video", "dance", "matchmaking"],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"@prisma/client": "^5.8.0"
},
"devDependencies": {
"nodemon": "^3.0.2",
"jest": "^29.7.0",
"supertest": "^6.3.3",
"prisma": "^5.8.0"
},
"jest": {
"testEnvironment": "node",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"testMatch": [
"**/__tests__/**/*.test.js"
]
}
}