Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions microservices/skill-assessment-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
.git
.env
coverage
*.log
29 changes: 29 additions & 0 deletions microservices/skill-assessment-service/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Service Configuration
SERVICE_NAME=skill-assessment-service
SERVICE_HOST=localhost
SERVICE_PORT=3015
NODE_ENV=development

# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=skill_assessment_db
DB_USER=postgres
DB_PASSWORD=password
DB_SYNC=true

# Assessment Configuration
INITIAL_DIFFICULTY=1
MAX_DIFFICULTY=10
MIN_DIFFICULTY=1
DIFFICULTY_ADJUSTMENT_THRESHOLD=0.7
REASSESSMENT_INTERVAL_DAYS=30

# Tier Configuration
TIER_BRONZE_THRESHOLD=30
TIER_SILVER_THRESHOLD=50
TIER_GOLD_THRESHOLD=70
TIER_PLATINUM_THRESHOLD=85
TIER_DIAMOND_THRESHOLD=95

LOG_LEVEL=log
35 changes: 35 additions & 0 deletions microservices/skill-assessment-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# compiled output
/dist
/node_modules

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
4 changes: 4 additions & 0 deletions microservices/skill-assessment-service/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
13 changes: 13 additions & 0 deletions microservices/skill-assessment-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:18-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY . .
RUN npm run build

EXPOSE 3015

CMD ["npm", "run", "start:prod"]
55 changes: 55 additions & 0 deletions microservices/skill-assessment-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Skill Assessment Service

A microservice for evaluating player abilities and placing them in appropriate difficulty tiers.

## Features

- **Skill Assessment System**: Comprehensive evaluation of player abilities through adaptive testing
- **Adaptive Difficulty**: Dynamic difficulty adjustment based on player performance
- **Skill Tier Assignment**: Automatic placement into appropriate difficulty tiers (Bronze, Silver, Gold, Platinum, Diamond)
- **Periodic Reassessment**: Scheduled re-evaluation of player skills
- **Skill Trajectory Analysis**: Tracking and analyzing skill progression over time
- **Assessment Analytics**: Detailed analytics and reporting on assessment data
- **Skill Gap Identification**: Identification of areas where players need improvement

## Installation

```bash
npm install
```

## Running the Service

```bash
# Development
npm run start:dev

# Production
npm run build
npm run start:prod
```

## API Documentation

Swagger documentation is available at `http://localhost:3015/api` when running the service.

## Environment Variables

See `.env.example` for the required environment variables.

## Database

The service uses PostgreSQL. Ensure the database is running before starting the service.

## Docker

```bash
docker-compose up
```

## Testing

```bash
npm run test
npm run test:cov
```
39 changes: 39 additions & 0 deletions microservices/skill-assessment-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: '3.8'

services:
skill-assessment-service:
build: .
ports:
- '3015:3015'
environment:
NODE_ENV: development
DB_HOST: postgres
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: password
DB_NAME: skill_assessment_db
DB_SYNC: true
SERVICE_PORT: 3015
INITIAL_DIFFICULTY: 1
MAX_DIFFICULTY: 10
MIN_DIFFICULTY: 1
DIFFICULTY_ADJUSTMENT_THRESHOLD: 0.7
REASSESSMENT_INTERVAL_DAYS: 30
TIER_BRONZE_THRESHOLD: 30
TIER_SILVER_THRESHOLD: 50
TIER_GOLD_THRESHOLD: 70
TIER_PLATINUM_THRESHOLD: 85
TIER_DIAMOND_THRESHOLD: 95
depends_on:
- postgres
volumes:
- .:/app
- /app/node_modules
command: npm run start:dev

postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: skill_assessment_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
27 changes: 27 additions & 0 deletions microservices/skill-assessment-service/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';

export default [
js.configs.recommended,
{
files: ['**/*.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'@typescript-eslint': tseslint,
prettier,
},
rules: {
...prettier.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
];
8 changes: 8 additions & 0 deletions microservices/skill-assessment-service/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading
Loading