NestJS backend for managing games and players (CRUD-style). Provides REST endpoints under /games and /players.
- Node 18+ (or LTS)
- pnpm
- MongoDB (if using mongoose schemas in src/*/schemas)
pnpm installStart in development (watch):
pnpm run start:devStart production:
pnpm run build
pnpm run start:prodRun tests:
pnpm test - Environment and DB connection are read from your NestJS configuration (check
src/app.module.tsand schema files). - Ensure MongoDB is running.
Base URL: http://localhost:3000
Games
-
Get a game byplayer id
curl --location 'localhost:3000/game?id=1' -
Create a game
curl --location 'localhost:3000/game' \ --header 'Content-Type: application/json' \ --data '{ "players": [1, 2], "winnerPlayerId": 1, "totalSets": 4 }'
Players
- Create a player
curl --location 'localhost:3000/player' \ --header 'Content-Type: application/json' \ --data-raw '{"email": "miguel@gmail.com"}'