A service that processes Marathon Match competition events to update member profiles and calculate ratings.
Round lookup for MM calculation follows the legacy mapping through project_info (project_info_type_id = 56): legacyId/projectId -> roundId.
-
Install dependencies
npm install
-
Start Kafka
docker-compose up
-
Setup database
npm run prisma:migrate npm run prisma:generate npm run db:seed
-
Start the service
npm run dev
Create a .env file:
DATABASE_URL=postgresql://postgres:password@localhost:5432/member_profile_processor
KAFKA_URL=localhost:9092
KAFKA_GROUP_ID=member-profile-processor-group-consumer
AUTH0_CLIENT_ID=your-client-id
AUTH0_CLIENT_SECRET=your-client-secret
V5_API_URL=http://localhost:3001# Start with hot reload
npm run dev
# Database operations
npm run prisma:studio
npm run db:seed
npm run db:check
# Prisma commands
npm run prisma:generate
npm run prisma:migrate# Test autopilot message (triggers calculate)
npm run kafka:autopilot
# Note: loadCoders/loadRatings are called directly after calculation (no Kafka chaining).
# The kafka:rating and kafka:coders messages are no longer required for the MM flow.
# Show help
npm run kafka:test helpkafka:autopilot sends projectId=40000001 by default (seeded in project_info).
For development testing, start the mock V5 API server:
# Start mock server
npm run mock:api
# Or run directly
node scripts/mock-v5-api-server.jsThe mock server runs on port 3001 and provides fake responses for:
- Challenge lookups
- Submission data
Set V5_API_URL=http://localhost:3001 in your .env file to use the mock server.
src/app.ts- Main application entry pointsrc/services/- Business logic servicessrc/common/- Shared utilities and database connectionprisma/- Database schema and migrationsscripts/- Utility scripts for testing and setup