Skip to content

Commit 57c22c9

Browse files
authored
Merge pull request #350 from nnennaokoye/nnennaokoye/quest-service
Nnennaokoye/quest service
2 parents 44a6bf9 + 348d7c0 commit 57c22c9

38 files changed

Lines changed: 12107 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
.git
4+
.env
5+
coverage
6+
*.log
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Service Configuration
2+
SERVICE_NAME=skill-assessment-service
3+
SERVICE_HOST=localhost
4+
SERVICE_PORT=3015
5+
NODE_ENV=development
6+
7+
# Database Configuration
8+
DB_HOST=localhost
9+
DB_PORT=5432
10+
DB_NAME=skill_assessment_db
11+
DB_USER=postgres
12+
DB_PASSWORD=password
13+
DB_SYNC=true
14+
15+
# Assessment Configuration
16+
INITIAL_DIFFICULTY=1
17+
MAX_DIFFICULTY=10
18+
MIN_DIFFICULTY=1
19+
DIFFICULTY_ADJUSTMENT_THRESHOLD=0.7
20+
REASSESSMENT_INTERVAL_DAYS=30
21+
22+
# Tier Configuration
23+
TIER_BRONZE_THRESHOLD=30
24+
TIER_SILVER_THRESHOLD=50
25+
TIER_GOLD_THRESHOLD=70
26+
TIER_PLATINUM_THRESHOLD=85
27+
TIER_DIAMOND_THRESHOLD=95
28+
29+
LOG_LEVEL=log
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
pnpm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# OS
15+
.DS_Store
16+
17+
# Tests
18+
/coverage
19+
/.nyc_output
20+
21+
# IDEs and editors
22+
/.idea
23+
.project
24+
.classpath
25+
.c9/
26+
*.launch
27+
.settings/
28+
*.sublime-workspace
29+
30+
# IDE - VSCode
31+
.vscode/*
32+
!.vscode/settings.json
33+
!.vscode/tasks.json
34+
!.vscode/launch.json
35+
!.vscode/extensions.json
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:18-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
RUN npm ci
7+
8+
COPY . .
9+
RUN npm run build
10+
11+
EXPOSE 3015
12+
13+
CMD ["npm", "run", "start:prod"]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Skill Assessment Service
2+
3+
A microservice for evaluating player abilities and placing them in appropriate difficulty tiers.
4+
5+
## Features
6+
7+
- **Skill Assessment System**: Comprehensive evaluation of player abilities through adaptive testing
8+
- **Adaptive Difficulty**: Dynamic difficulty adjustment based on player performance
9+
- **Skill Tier Assignment**: Automatic placement into appropriate difficulty tiers (Bronze, Silver, Gold, Platinum, Diamond)
10+
- **Periodic Reassessment**: Scheduled re-evaluation of player skills
11+
- **Skill Trajectory Analysis**: Tracking and analyzing skill progression over time
12+
- **Assessment Analytics**: Detailed analytics and reporting on assessment data
13+
- **Skill Gap Identification**: Identification of areas where players need improvement
14+
15+
## Installation
16+
17+
```bash
18+
npm install
19+
```
20+
21+
## Running the Service
22+
23+
```bash
24+
# Development
25+
npm run start:dev
26+
27+
# Production
28+
npm run build
29+
npm run start:prod
30+
```
31+
32+
## API Documentation
33+
34+
Swagger documentation is available at `http://localhost:3015/api` when running the service.
35+
36+
## Environment Variables
37+
38+
See `.env.example` for the required environment variables.
39+
40+
## Database
41+
42+
The service uses PostgreSQL. Ensure the database is running before starting the service.
43+
44+
## Docker
45+
46+
```bash
47+
docker-compose up
48+
```
49+
50+
## Testing
51+
52+
```bash
53+
npm run test
54+
npm run test:cov
55+
```
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: '3.8'
2+
3+
services:
4+
skill-assessment-service:
5+
build: .
6+
ports:
7+
- '3015:3015'
8+
environment:
9+
NODE_ENV: development
10+
DB_HOST: postgres
11+
DB_PORT: 5432
12+
DB_USER: postgres
13+
DB_PASSWORD: password
14+
DB_NAME: skill_assessment_db
15+
DB_SYNC: true
16+
SERVICE_PORT: 3015
17+
INITIAL_DIFFICULTY: 1
18+
MAX_DIFFICULTY: 10
19+
MIN_DIFFICULTY: 1
20+
DIFFICULTY_ADJUSTMENT_THRESHOLD: 0.7
21+
REASSESSMENT_INTERVAL_DAYS: 30
22+
TIER_BRONZE_THRESHOLD: 30
23+
TIER_SILVER_THRESHOLD: 50
24+
TIER_GOLD_THRESHOLD: 70
25+
TIER_PLATINUM_THRESHOLD: 85
26+
TIER_DIAMOND_THRESHOLD: 95
27+
depends_on:
28+
- postgres
29+
volumes:
30+
- .:/app
31+
- /app/node_modules
32+
command: npm run start:dev
33+
34+
postgres:
35+
image: postgres:15-alpine
36+
environment:
37+
POSTGRES_DB: skill_assessment_db
38+
POSTGRES_USER: postgres
39+
POSTGRES_PASSWORD: password
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import js from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import tsparser from '@typescript-eslint/parser';
4+
import prettier from 'eslint-plugin-prettier';
5+
6+
export default [
7+
js.configs.recommended,
8+
{
9+
files: ['**/*.ts'],
10+
languageOptions: {
11+
parser: tsparser,
12+
parserOptions: {
13+
project: './tsconfig.json',
14+
tsconfigRootDir: import.meta.dirname,
15+
},
16+
},
17+
plugins: {
18+
'@typescript-eslint': tseslint,
19+
prettier,
20+
},
21+
rules: {
22+
...prettier.configs.recommended.rules,
23+
'@typescript-eslint/no-unused-vars': 'warn',
24+
'@typescript-eslint/explicit-function-return-type': 'off',
25+
},
26+
},
27+
];
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"compilerOptions": {
6+
"deleteOutDir": true
7+
}
8+
}

0 commit comments

Comments
 (0)