{"id":32329913,"url":"https://github.com/olemak/puzloc","last_synced_at":"2026-04-13T19:32:49.590Z","repository":{"id":319113808,"uuid":"1077642266","full_name":"olemak/puzloc","owner":"olemak","description":"Multi-game puzzle platform: NumLock \u0026 PhraseLock. Learning .NET, PostgreSQL, SvelteKit in an Nx monorepo.","archived":false,"fork":false,"pushed_at":"2025-10-16T14:32:03.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-17T17:33:04.957Z","etag":null,"topics":["csharp","docker","dotnet","hangman","learning-project","monorepo","nx","postgresql","puzzle-game","svelte","sveltekit","typescript","wordle"],"latest_commit_sha":null,"homepage":null,"language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olemak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-16T14:30:18.000Z","updated_at":"2025-10-16T14:32:07.000Z","dependencies_parsed_at":"2025-10-18T05:17:13.794Z","dependency_job_id":"42073948-d7cc-43bd-baae-3b18148e6ca9","html_url":"https://github.com/olemak/puzloc","commit_stats":null,"previous_names":["olemak/puzloc"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/olemak/puzloc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemak%2Fpuzloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemak%2Fpuzloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemak%2Fpuzloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemak%2Fpuzloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olemak","download_url":"https://codeload.github.com/olemak/puzloc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemak%2Fpuzloc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31768638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","docker","dotnet","hangman","learning-project","monorepo","nx","postgresql","puzzle-game","svelte","sveltekit","typescript","wordle"],"created_at":"2025-10-23T18:20:11.964Z","updated_at":"2026-04-13T19:32:49.583Z","avatar_url":"https://github.com/olemak.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎮 Puzloc - Multi-Game Puzzle Platform\n\n[![GitHub repo](https://img.shields.io/badge/GitHub-puzloc-blue?logo=github)](https://github.com/olemak/puzloc)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![.NET](https://img.shields.io/badge/.NET-8.0-512BD4?logo=dotnet)](https://dotnet.microsoft.com/)\n[![Svelte](https://img.shields.io/badge/Svelte-Kit-FF3E00?logo=svelte)](https://kit.svelte.dev/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16-336791?logo=postgresql)](https://www.postgresql.org/)\n\nA monorepo project for exploring modern full-stack technologies through building an engaging puzzle game platform.\n\n## 🎯 Concept\n\n**Puzloc** (Puzzle Lock) is a collection of puzzle games where players attempt to \"unlock\" challenges through logic and deduction.\n\n### Game 1: NumLock 🔢\nA Wordle-inspired number guessing game with a keypad interface.\n\n**How it works:**\n- Players have to guess a 4-digit code\n- Each guess provides feedback:\n  - ❌ **Gray**: Digit not in the code\n  - 🟡 **Yellow**: Digit in code but wrong position\n  - 🟢 **Green**: Digit correct and in right position\n- Limited attempts to crack the code\n- Daily challenges with leaderboards\n\n### Game 2: PhraseLock 📝\nA Hangman/Countdown-style phrase guessing game.\n\n**How it works:**\n- Players see a masked phrase: `*** **** ***** ***`\n- Can guess individual letters or the whole phrase\n- Optional: Unlock letters using \"coins\" or attempts\n- Daily phrases with varying difficulty\n- Category hints available\n\n## ⚡ Quick Start\n\n**Just want to start coding?**\n\n```bash\n# 1. Clone and setup\ngit clone https://github.com/olemak/puzloc.git\ncd puzloc\nnpm install\n\n# 2. Start development environment\nnpm run dev\n\n# 3. Create backend (automated)\nnpm run setup:backend\n\n# 4. Start coding!\ncd apps/backend\ndotnet watch run\n```\n\n**OR** follow the detailed guide: **[START_HERE.md](START_HERE.md)** 📖\n\n### Helpful Commands\n\n```bash\nnpm run dev              # Start Docker services\nnpm run setup:backend    # Auto-create backend project\nnpm run docker:start     # Start Docker only\nnpm run docker:stop      # Stop Docker services\nnpm run db               # Open PostgreSQL CLI\n```\n\n## 🏗️ Architecture\n\n### Monorepo Structure\n```\npuzloc/\n├── apps/\n│   ├── backend/              # .NET Web API\n│   │   ├── src/\n│   │   │   ├── Api/          # API controllers \u0026 endpoints\n│   │   │   ├── Core/         # Domain models \u0026 business logic\n│   │   │   ├── Infrastructure/ # Database, auth, external services\n│   │   │   └── Services/     # Game logic services\n│   │   └── tests/\n│   ├── frontend-svelte/      # Svelte web application\n│   │   ├── src/\n│   │   │   ├── lib/\n│   │   │   │   ├── components/ # Shared UI components\n│   │   │   │   ├── games/     # Game-specific components\n│   │   │   │   └── services/  # API client, state management\n│   │   │   └── routes/        # SvelteKit routes\n│   │   └── tests/\n│   └── frontend-native/      # React Native app (future)\n├── packages/\n│   ├── shared-types/         # Shared TypeScript types\n│   ├── game-engine/          # Shared game logic\n│   └── api-client/           # Typed API client\n├── infrastructure/\n│   └── docker/\n│       ├── docker-compose.yml\n│       └── postgres/\n└── docs/\n    ├── api/                  # API documentation\n    └── architecture/         # Architecture decisions\n```\n\n### Technology Stack\n\n#### Backend\n- **Framework**: .NET 8 Web API\n- **Database**: PostgreSQL\n- **ORM**: Entity Framework Core\n- **Authentication**: JWT tokens\n- **Testing**: xUnit\n\n#### Frontend (Web)\n- **Framework**: SvelteKit\n- **Language**: TypeScript\n- **Styling**: TailwindCSS\n- **State**: Svelte stores\n- **API Client**: Custom typed client\n\n#### Infrastructure\n- **Database**: PostgreSQL (Docker)\n- **Caching**: Redis (optional, future)\n- **Containerization**: Docker \u0026 Docker Compose\n\n#### Monorepo\n- **Tool**: Nx\n- **Package Manager**: npm\n\n## 🗄️ Database Schema (Initial)\n\n```sql\n-- Users\nCREATE TABLE users (\n    id UUID PRIMARY KEY,\n    username VARCHAR(50) UNIQUE NOT NULL,\n    email VARCHAR(255) UNIQUE NOT NULL,\n    password_hash VARCHAR(255) NOT NULL,\n    created_at TIMESTAMP DEFAULT NOW(),\n    updated_at TIMESTAMP DEFAULT NOW()\n);\n\n-- Daily Challenges\nCREATE TABLE challenges (\n    id UUID PRIMARY KEY,\n    game_type VARCHAR(20) NOT NULL, -- 'numlock' or 'phraselock'\n    challenge_date DATE NOT NULL,\n    solution TEXT NOT NULL, -- encrypted/hashed\n    difficulty VARCHAR(20),\n    created_at TIMESTAMP DEFAULT NOW(),\n    UNIQUE(game_type, challenge_date)\n);\n\n-- Game Attempts\nCREATE TABLE attempts (\n    id UUID PRIMARY KEY,\n    user_id UUID REFERENCES users(id),\n    challenge_id UUID REFERENCES challenges(id),\n    guess TEXT NOT NULL,\n    result JSONB NOT NULL, -- Feedback data\n    attempt_number INT NOT NULL,\n    created_at TIMESTAMP DEFAULT NOW()\n);\n\n-- User Stats\nCREATE TABLE user_stats (\n    user_id UUID PRIMARY KEY REFERENCES users(id),\n    game_type VARCHAR(20) NOT NULL,\n    games_played INT DEFAULT 0,\n    games_won INT DEFAULT 0,\n    current_streak INT DEFAULT 0,\n    max_streak INT DEFAULT 0,\n    average_attempts DECIMAL(4,2),\n    updated_at TIMESTAMP DEFAULT NOW(),\n    UNIQUE(user_id, game_type)\n);\n\n-- Leaderboards (computed view or materialized)\nCREATE TABLE leaderboard_entries (\n    id UUID PRIMARY KEY,\n    user_id UUID REFERENCES users(id),\n    game_type VARCHAR(20) NOT NULL,\n    period VARCHAR(20) NOT NULL, -- 'daily', 'weekly', 'all_time'\n    score INT NOT NULL,\n    rank INT,\n    calculated_at TIMESTAMP DEFAULT NOW()\n);\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n- Node.js 20+ (for frontend \u0026 tooling)\n- .NET 8 SDK\n- Docker \u0026 Docker Compose\n- PostgreSQL (via Docker)\n\n### Setup\n\n1. **Clone and install dependencies:**\n```bash\ngit clone \u003crepo-url\u003e\ncd puzloc\nnpm install\n```\n\n2. **Start PostgreSQL:**\n```bash\ncd infrastructure/docker\ndocker-compose up -d postgres\n```\n\n3. **Run backend:**\n```bash\ncd apps/backend\ndotnet restore\ndotnet run\n```\n\n4. **Run frontend:**\n```bash\ncd apps/frontend-svelte\nnpm install\nnpm run dev\n```\n\n## 🎮 Game Logic\n\n### NumLock Algorithm\n```typescript\nfunction checkGuess(guess: string, solution: string): Feedback[] {\n  // Compare each digit\n  // Return array of: 'correct' | 'wrong-position' | 'not-in-answer'\n}\n```\n\n### PhraseLock Algorithm\n```typescript\nfunction revealLetter(phrase: string, guessedLetters: Set\u003cstring\u003e): string {\n  // Reveal guessed letters, keep rest masked\n}\n```\n\n## 📈 Future Features\n\n- [ ] **More Games**: Add Sudoku, Crossword, Logic puzzles\n- [ ] **Social Features**: Friends, challenges, shared scores\n- [ ] **Achievements**: Badges, milestones, rewards\n- [ ] **Multiplayer**: Head-to-head challenges\n- [ ] **Mobile App**: React Native or Flutter\n- [ ] **Analytics**: Game difficulty balancing, player insights\n- [ ] **Observability**: Structured logging, metrics (Serilog + Seq?)\n\n## 🧪 Learning Goals\n\nThis project is designed to explore:\n- ✅ .NET backend development\n- ✅ PostgreSQL database design\n- ✅ JWT authentication\n- ✅ SvelteKit frontend\n- ✅ Nx monorepo management\n- ✅ Docker containerization\n- ✅ RESTful API design\n- ✅ TypeScript type safety across stack\n\n## 📝 License\n\nMIT\n\n## 👤 Author\n\nBuilt as a learning project to explore modern full-stack technologies.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folemak%2Fpuzloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folemak%2Fpuzloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folemak%2Fpuzloc/lists"}