Codebreaker is a tactical logic-warfare platform engineered for high-performance, real-time competition. By reimagining the classic 'Cows & Bulls' (Mastermind) mechanic through a "military-intelligence" lens, it transforms a simple puzzle into a high-pressure strategic operation.
The engine utilizes an asynchronous FastAPI backend and a low-latency Socket.IO bridge to synchronize global multiplayer states with millisecond precision. Every guess is more than a move—it's a calculated maneuver executed within a high-fidelity, responsive UI designed for the modern logical operative. Whether engaging in classified single-player missions or escalating to global multiplayer operations, Codebreaker delivers a premium, immersive experience where every byte counts.
| Layer | Technologies | Role |
|---|---|---|
| Frontend | Next.js 15 (React 19, TypeScript) | Core application logic and responsive UI |
| Styling | Tailwind CSS 4, Framer Motion | Design system and micro-animations |
| Backend | FastAPI, Python 3.11+ | Asynchronous service architecture |
| Real-time | Socket.IO, WebSockets | Bi-directional game state synchronization |
| State/Storage | Redis, Zustand, TanStack Query | Persistence and local state management |
| Security | Slowapi, Pydantic v2 | Rate limiting and robust data validation |
- Progressive single-player campaign with adaptive difficulty.
- Dynamic code lengths and limited survival attempts.
- Strategic level constraints designed to test analytical edge.
- Real-time head-to-head combat via global matchmaking.
- Low-latency Socket.IO bridge for instantaneous synchronization.
- Live opponent tracking to monitor competitive maneuvers.
- Instantaneous hit/miss calculations and visual guidance.
- Persistent mission history via an interactive grid system.
- Real-time clue distribution for rapid strategic pivots.
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.pycd frontend
pnpm install
pnpm dev- Redis: Mandatory for multiplayer session handling.
- Node.js Runtime: Version 20+ required for the field interface.
- Python Engine: Version 3.11+ required for intelligence services.
The frontend can be tested without a running backend or Neon database:
cd frontend
pnpm install
pnpm dev -- -p 13000Create an account from the entry page. On localhost, Codebreaker uses the browser-local account path for testing and assigns a unique four-digit discriminator, shown as CALLSIGN#1234; the full handle is used for login when display names overlap and for friend requests. Local sessions, local friend requests, local notifications, offline missions, and the local leaderboard remain until the site's storage is cleared. NEXT_PUBLIC_ENABLE_LOCAL_FALLBACK=false can disable it locally. Hosted builds disable this browser-local account/social fallback; hosted friend requests require an online account service. Multiplayer still requires the backend and its realtime service.
To reset local accounts, use the browser's site-data controls for localhost:13000, or run this in DevTools:
localStorage.removeItem("codebreaker_local_accounts_v1");
localStorage.removeItem("codebreaker_local_session_v1");
localStorage.removeItem("codebreaker_local_friendships_v1");
localStorage.removeItem("codebreaker_local_notifications_v1");Neon is the production source of truth when DATABASE_URL and SESSION_SECRET are configured. The optional server fallback file stores only account records (id, callsign, scrypt password hash, creation time) and hashed session records (token_hash, user id, expiry); it does not store friends, notifications, push subscriptions, or game data.
For the free-tier-compatible setup, do not attach a Render persistent disk. Leave FALLBACK_ACCOUNT_STORE unset or empty and keep Neon configured. Neon-backed account, friendship, notification, and push data then survives Render restarts. During a Neon outage, server-side fallback data is memory-only and can disappear if the instance restarts, while browser-local accounts remain on the user's device.
If a server-side outage fallback must survive restarts, attach a Render persistent disk mounted at /var/data and set:
FALLBACK_ACCOUNT_STORE=/var/data/accounts.jsonWithout that disk, only data created in the temporary server fallback during an outage can be lost; data already stored in Neon is not lost.
© 2026 Kalash Pratap Gaur. All Rights Reserved.
Released under the MIT License.












