# Required
Node.js 20.8+
PostgreSQL 14+
Docker (optional)
# Check versions
node --version
npm --version
psql --versiongit clone <your-repo>
cd quest-service
npm install# Option A: Docker (Recommended)
docker-compose up -d postgres
# Option B: Local PostgreSQL
createdb quest_service# Copy example environment file
cp .env.example .env
# Edit with your settings
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_NAME=quest_service
DATABASE_USER=postgres
DATABASE_PASSWORD=your_password
JWT_SECRET=your-super-secret-keynpm run migration:runnpm run start:dev# Check health endpoint
curl http://localhost:3000/health
# Open API documentation
open http://localhost:3000/api# Quick test
npm run test:unit -- --testPathPattern=game-logic.controller.spec.ts
# All working tests
npm run test:unitcurl -X POST http://localhost:3000/puzzles \\
-H "Content-Type: application/json" \\
-d '{
"title": "My First Puzzle",
"description": "A simple logic puzzle to get started",
"category": "logic",
"difficulty": "easy",
"content": {
"type": "multiple-choice",
"question": "What comes next in the sequence: 2, 4, 6, ?",
"options": ["7", "8", "9", "10"],
"correctAnswer": "8"
},
"difficultyRating": 2,
"basePoints": 100,
"timeLimit": 300,
"maxHints": 2,
"tags": ["sequence", "math"]
}'- Explore the API at
/api - Check out
SYSTEM_OVERVIEW.mdfor detailed docs - Run more comprehensive tests
- Set up your production environment
- API Issues: Check
/healthendpoint - Database Issues: Verify connection string in
.env - Test Issues: Some tests need missing dependencies
- Build Issues: Run
npm run type-checkfirst
Happy coding! 馃帀