You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
4 weeks ago | |
|---|---|---|
| .github/workflows | 1 month ago | |
| backend | 4 weeks ago | |
| docs | 1 month ago | |
| frontend | 4 weeks ago | |
| infrastructure | 1 month ago | |
| tasks | 1 month ago | |
| tests/load/k6 | 1 month ago | |
| .dockerignore | 1 month ago | |
| .editorconfig | 1 month ago | |
| .gitignore | 1 month ago | |
| AGENTS.md | 1 month ago | |
| CLAUDE.md | 1 month ago | |
| GEMINI.md | 1 month ago | |
| Makefile | 4 weeks ago | |
| README.md | 1 month ago | |
| Taskfile.yml | 1 month ago | |
README.md
Know Foolery
Overview
Know Foolery is a quiz game inspired by the French game "Déconnaissance" (https://escaleajeux.fr/jeu/decon.0.1). It's a web-based quiz platform with plans for cross-platform expansion to mobile and desktop applications.
Game Concept
Core Gameplay
- Objective: Players answer randomly selected questions to score points
- Question Format: Each question belongs to a theme, displayed above the question
- Scoring System:
- 2 points for correct answer without hint
- 1 point for correct answer with hint
- 0 points for incorrect answer or timeout
- Attempts: Players have exactly 3 attempts per question
- Time Limit: Each game session is limited to 30 minutes maximum
- Hints: Players can request one hint per question, but this reduces their score
Player Experience
- Registration: Players must enter their name before starting a game
- Session Management: Game tracks progress, attempts, and time remaining
- Leaderboard: Display top 10 scores accessible to all players
- Themes: Questions are categorized by themes (Geography, History, Science, etc.)
Documentation
Detailed requirements
Architecture
Guidelines
Infrastructure
Directory Layout
infrastructure/dev: local development compose stack and configsinfrastructure/prod: production compose stack, nginx, and prometheus configinfrastructure/services: Dockerfiles for each backend servicetasks: Go Task CI/CD workflows.github/workflows: thin GitHub Actions wrappers that trigger Task workflows
Production Compose Usage
- Copy
infrastructure/prod/.env.prod.exampletoinfrastructure/prod/.env.prodand fill secrets. - Validate config:
docker compose -f infrastructure/prod/docker-compose.yml --env-file infrastructure/prod/.env.prod config
- Build and start:
docker compose -f infrastructure/prod/docker-compose.yml --env-file infrastructure/prod/.env.prod up -d --build
Task Workflows
task ci:security-scan: lint, unit/integration tests, backend coverage gate (>=80%), docker build validation, k6 smoke (when configured), gosec, trivy scanstask cd:deploy-dev: deploy to dev host over SSH + compose build/up + smoke checkstask cd:deploy-prod: deploy release tag to prod host over SSH + rollback on failuretask ci:k6-smoke: run smoke load profile against gateway critical pathstask ci:k6-load: run local load profile against gateway critical paths
Make wrappers:
make task-security-scanmake task-deploy-devmake task-deploy-prodmake task-k6-smokemake task-k6-loadmake infra-build-imagesmake infra-up-prod
Backend Testing Strategy Implementation (6.1)
- Backend coverage gate uses stepwise thresholds from
BACKEND_COVERAGE_THRESHOLDS(default:60 70 80), summary written toreports/tests/backend-coverage-summary.txt - Coverage gate aggregation targets backend service
internal/application,internal/domain, andinternal/interfaces/httppackages from service profiles (services-*) with deduplicated unit/integration blocks - Coverage profiles: generated in
reports/tests/coverage/*.outand merged intoreports/tests/coverage/backend-combined.out - DB integration tests: question-bank repository integration now uses a disposable Postgres Testcontainers instance
- API route coverage: admin service integration tests now validate
/admin/auth,/admin/dashboard,/admin/auditsuccess and error paths - Load tests: k6 gateway critical-path scripts located in
tests/load/k6
Frontend Testing Strategy Implementation (6.2)
- Unit and component tests run with Solid Testing Library in
frontend/apps/web/src/**/*.test.ts(x)andfrontend/shared/ui-components/src/**/*.test.ts(x). - Hooks and utility coverage includes
useAuth,useTimer, validation, session storage, and timer helpers. - Component coverage includes shared UI components and route-level tests for
Home,Game,Results,Leaderboard,Profile, and admin question management. - Playwright critical-flow E2E tests live in
frontend/apps/web/e2e/critical-flows.spec.ts:- Player registration + demo login
- Complete game session (start → answer → results)
- Leaderboard viewing
- Admin question management (
/admin/questions)
- Run locally:
cd frontend && yarn testcd frontend && yarn test:e2e
- CI execution:
task ci:frontend-e2e-tests- Included in
task ci:security-scan
k6 Prerequisites and Environment
- Install k6 locally to run load tests from Task/Make commands.
- Required env var:
K6_BASE_URL(example:http://localhost:8086) - Optional env vars:
K6_AUTH_TOKENfor protected routesK6_VUS,K6_DURATION,K6_SLEEP_SECONDSto tune profile execution
GitHub Actions Secrets
- Shared:
SSH_PRIVATE_KEY - Dev deploy:
DEV_DEPLOY_HOST,DEV_DEPLOY_USER,DEV_DEPLOY_PATH - Prod deploy:
PROD_DEPLOY_HOST,PROD_DEPLOY_USER,PROD_DEPLOY_PATH
Deployment Host Prerequisites
- Linux host with Docker Engine + Docker Compose v2
gitandcurlinstalled- persistent repository checkout at the configured deploy path
- populated
infrastructure/prod/.env.prodon target host
Future Enhancements
Planned Features
- Question Categories: Filter questions by subject
- Difficulty Progression: Adaptive difficulty based on performance
- Multiplayer Mode: Real-time competition between players
- Daily Challenges: Special themed question sets
- Achievement System: Badges and milestones
- Question Contributions: Player-submitted questions
Scoring Enhancements
- Time Bonus: Extra points for quick correct answers
- Streak Bonus: Consecutive correct answers bonus
- Difficulty Multiplier: Higher points for harder questions
- Perfect Game Bonus: Bonus for 100% correct rate
Success Metrics
User Engagement
- Daily Active Users: Track player engagement
- Session Duration: Average time spent playing
- Question Accuracy: Player success rates by theme
- Hint Usage: Frequency and effectiveness of hints
Technical Performance
- Response Times: API and database performance metrics
- Error Rates: Application stability and reliability
- Uptime: System availability and reliability
- Security Events: Monitoring for security incidents
Business Metrics
- Player Retention: User return rates and engagement
- Content Quality: Question difficulty and engagement
- Platform Usage: Cross-platform adoption rates
- Admin Efficiency: Content management effectiveness
Project Roadmap
Phase 1: Core Platform (Weeks 1-6)
- Basic web application with core game mechanics
- Essential microservices and database setup
- Admin panel for question management
Phase 2: Enhanced Features (Weeks 7-12)
- Complete security implementation
- Comprehensive observability and monitoring
- Production-ready deployment
Phase 3: Mobile Expansion (Weeks 13-18)
- Cross-platform mobile applications
- Cross-platform component optimization
- Mobile app store deployment
Phase 4: Advanced Features (Weeks 19-24)
- Desktop applications
- Advanced analytics and reporting
- Enhanced security and compliance features