- character-builder/: Vue 3 + NestJS + Valkey app for planning house, class, character XP, 5 spec tracks, faction standing, and skill trees. Shareable via short link (POST /api/builds → 8-char nanoid). - character-builder/data/: parsed JSON tables (character XP through L200, 5 specs to L100, 2 faction standing tables, 5 class skill trees). - character-builder/scripts/extract.py: parser that regenerates data/*.json from the gitignored sample-data/*.html snapshots. - Dockerfile + docker-compose.yml: two-container deploy (app + Valkey). - specialization-calculator/: pre-existing single-file XP/quest calculator, carried into the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
19 lines
581 B
TypeScript
19 lines
581 B
TypeScript
import { Logger, Provider } from '@nestjs/common';
|
|
import Redis from 'ioredis';
|
|
|
|
export const VALKEY = Symbol('VALKEY');
|
|
|
|
export const ValkeyProvider: Provider = {
|
|
provide: VALKEY,
|
|
useFactory: (): Redis => {
|
|
const url = process.env.VALKEY_URL || 'redis://valkey:6379';
|
|
const logger = new Logger('Valkey');
|
|
const client = new Redis(url, {
|
|
lazyConnect: false,
|
|
maxRetriesPerRequest: 3,
|
|
});
|
|
client.on('connect', () => logger.log(`connected ${url}`));
|
|
client.on('error', (err) => logger.warn(`error: ${err.message}`));
|
|
return client;
|
|
},
|
|
};
|