{"id":51531608,"url":"https://github.com/nishanthcs/code-bro","last_synced_at":"2026-07-09T03:00:56.091Z","repository":{"id":366445811,"uuid":"1275663403","full_name":"nishanthcs/code-bro","owner":"nishanthcs","description":"Local-first Python playground for coding interview prep, data structures, algorithms, and LeetCode-style practice without autocomplete or AI.. Let the code brew, Bruh.","archived":false,"fork":false,"pushed_at":"2026-06-29T01:25:12.000Z","size":521,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-29T03:11:52.597Z","etag":null,"topics":["algorithm-practice","algorithms","codemirror","coding","coding-interviews","cross-platform","data-structures","dsa","interview-preparation","leetcode","linux","local-first","offline-first","practice-programming","pyodide","python","python-playground","windows"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nishanthcs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-21T01:49:29.000Z","updated_at":"2026-06-29T01:25:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nishanthcs/code-bro","commit_stats":null,"previous_names":["nishanthcs/code-bro"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nishanthcs/code-bro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanthcs%2Fcode-bro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanthcs%2Fcode-bro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanthcs%2Fcode-bro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanthcs%2Fcode-bro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nishanthcs","download_url":"https://codeload.github.com/nishanthcs/code-bro/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanthcs%2Fcode-bro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35284880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["algorithm-practice","algorithms","codemirror","coding","coding-interviews","cross-platform","data-structures","dsa","interview-preparation","leetcode","linux","local-first","offline-first","practice-programming","pyodide","python","python-playground","windows"],"created_at":"2026-07-09T03:00:55.105Z","updated_at":"2026-07-09T03:00:56.085Z","avatar_url":"https://github.com/nishanthcs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeBro — Local Python Playground for Coding Interview Practice\n\n\u003e Let the code brew, bruh.\n\n[![Cross-platform](https://img.shields.io/badge/source-cross--platform-2563eb)](#getting-started)\n[![Python](https://img.shields.io/badge/Python-3.12%2B-3776AB?logo=python\u0026logoColor=white)](https://www.python.org/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![Local First](https://img.shields.io/badge/local--first-private-6f42c1)](#privacy-and-security)\n\nCodeBro is a free, open-source, local-first Python playground for practicing\ndata structures and algorithms, working through LeetCode-style coding problems,\nand preparing for Python technical interviews without autocomplete, AI\nsuggestions, or browser tabs full of distractions.\n\nWrite Python, provide custom stdin, run it locally with bundled Pyodide, inspect\nstdout and stderr, and save each solution as a searchable session with tags,\nreference links, and Markdown notes. Your code and interview-preparation notes\nstay in a local SQLite database.\n\n## Why use CodeBro for coding interview preparation?\n\nCoding interviews often require writing correct code without relying on an\nIDE's autocomplete, Copilot-style assistance, automatic imports, or hidden\npackage installation. CodeBro provides a deliberately focused environment for\nthat workflow.\n\n- Practice arrays, strings, hash maps, linked lists, stacks, queues, trees,\n  graphs, heaps, recursion, backtracking, dynamic programming, and other DSA\n  topics in Python.\n- Paste or write a problem prompt in Markdown Notes and keep a link to the\n  original challenge.\n- Test solutions with your own stdin and inspect ordered stdout and stderr.\n- Organize attempts by tags such as `Graph`, `Binary Search`, or `DP`.\n- Revisit previous solutions through name-or-tag search.\n- Work offline after installation with no runtime CDN or package downloads.\n- Practice without autocomplete, code completion, snippets, lint popovers,\n  automatic imports, or AI-generated code.\n\nCodeBro does not bundle or scrape problems from LeetCode or other interview\nplatforms. Bring your own problem statement and test cases. CodeBro is not\naffiliated with or endorsed by LeetCode.\n\n## At a glance\n\n| Capability | CodeBro |\n| --- | --- |\n| Primary use | Python coding interview and algorithm practice |\n| Platform | Cross-platform when run from source |\n| Execution | Local Pyodide in a fresh disposable Web Worker |\n| Persistence | Local SQLite with autosave and revision protection |\n| Problem input | Custom multiline stdin |\n| Organization | Session names, tags, search, reference URLs, and Markdown Notes |\n| Assistance | No autocomplete, AI suggestions, snippets, or automatic imports |\n| Network requirement | None at runtime |\n\n## Features\n\n### Python editor and code runner\n\n- Python syntax highlighting without autocomplete or completion UI.\n- Python-aware indentation, code folding, search, and comment toggling.\n- Custom stdin for testing interview examples and edge cases.\n- Ordered stdout and stderr output rendered as plain text.\n- A fresh Worker for every run, plus Stop, a 10-second timeout, and output\n  limits that prevent runaway programs from freezing the interface.\n- Resizable editor, stdin, output, and Session Notes panels.\n- Keyboard-first workflow with `Cmd/Ctrl+Enter` to run and `Cmd/Ctrl+S` to\n  save.\n\n### Saved coding-practice sessions\n\n- Compact list view with session name, tags, code preview, optional shortened\n  Reference link, updated date, and created date.\n- Server-backed name-or-tag search, recency/name ordering, and updated-date\n  filters.\n- Autosaved Python source, Reference URL, and Markdown Notes in SQLite.\n- Optimistic revisions and idempotent retries protect against accidental\n  overwrites after a lost response.\n- Deterministic local tag suggestions based on the code, capped at two tags.\n- Soft deletion so sessions are not immediately destroyed.\n- Read-only Settings panel showing the active SQLite database path.\n- Press `/` to focus search and `N` to create a session when focus is not in a\n  form control.\n\n### Focused, distraction-free practice\n\n- No autocomplete, completion popovers, snippets, lint suggestions, ghost\n  text, parameter hints, automatic imports, or AI code assistance.\n- Browser spellcheck, autocorrect, autocapitalization, and grammar assistance\n  are disabled on the code editor.\n- No format-on-save or automatic mutation of your solution.\n- Light and dark themes with adjustable editor font size.\n- New sessions focus and select the session name. Press `F2` to return to the\n  name field or `Ctrl+Shift+T` to expand metadata and focus the tag editor.\n- `Ctrl+Shift+M` toggles the metadata drawer. Its disclosure preference is\n  UI-only and restored locally.\n- Sessions may store one absolute HTTP(S) Reference URL and up to 128 KiB of\n  raw UTF-8 Markdown Notes. Notes preview supports common Markdown and GFM,\n  does not render raw HTML, and never loads remote images.\n- Press `Escape`, then `Tab`, to move keyboard focus out of the code editor.\n- The stdin panel can be closed so the console occupies the full runner column.\n- Editor/runner sizing, stdin and Notes sizing and visibility, and each\n  session's cursor selection are restored from browser-local preferences.\n- The UI detects failed API requests, shows a recovery banner, and periodically\n  retries only while the local server is unavailable.\n\n## Getting started\n\nCodeBro's development environment runs cross-platform from source. There is not\nyet a published binary release.\n\nPrerequisites:\n\n- Node.js 24.16.0\n- Python 3.12 or newer\n- [uv](https://docs.astral.sh/uv/)\n\n### Unix-like shells\n\n```bash\ngit clone https://github.com/nishanthcs/code-bro.git\ncd code-bro\nuv venv .venv --python 3.12\nuv pip install --python .venv/bin/python \\\n  -c backend/constraints.txt \\\n  -e './backend[dev,package]'\nnpm ci\nnpm run dev\n```\n\n### Windows PowerShell\n\n```powershell\ngit clone https://github.com/nishanthcs/code-bro.git\ncd code-bro\nuv venv .venv --python 3.12\nuv pip install --python .venv/Scripts/python.exe `\n  -c backend/constraints.txt `\n  -e \"./backend[dev,package]\"\nnpm ci\nnpm run dev\n```\n\nCodeBro opens in your browser and stores sessions in a local SQLite database.\nThe packaged `.app` and DMG currently target macOS 14+ on Apple silicon, while\nthe source-based development environment is cross-platform.\n\n## Example interview-practice workflow\n\n1. Create a session named after the problem, such as `Two Sum`.\n2. Add topic tags such as `Array` and `Hash Map`.\n3. Save the problem URL in Reference URL.\n4. Put constraints, complexity notes, and follow-up ideas in Session Notes.\n5. Write the solution without autocomplete or AI assistance.\n6. Add sample and edge-case values to stdin.\n7. Run with `Cmd/Ctrl+Enter`, inspect the output, and iterate.\n8. Search by problem name or topic later for spaced repetition.\n\n## Repository layout\n\n- `frontend/` React, TypeScript, CodeMirror, and the Pyodide execution bridge.\n- `backend/` FastAPI, SQLite, API tests, and the local controller.\n- `scripts/` development and production-build helpers.\n- `docs/` architecture and release notes.\n\n## Development\n\n### Install dependencies\n\nPrerequisites:\n\n- Node.js 24.16.0 (exactly; use `.node-version` or `.nvmrc`)\n- Python 3.12+\n- [uv](https://docs.astral.sh/uv/)\n\n```bash\nuv venv .venv --python 3.12\nuv pip install --python .venv/bin/python \\\n  -c backend/constraints.txt \\\n  -e './backend[dev,package]'\nnpm ci\n```\n\nThis installs the backend runtime, test, development, and macOS packaging\ndependencies into `.venv`.\n\n### Run locally\n\n#### Development servers\n\nStart the full development environment from the repository root:\n\n```bash\nnpm run dev\n```\n\nOpen `http://127.0.0.1:5173`. The development controller starts:\n\n- Vite UI: `127.0.0.1:5173`\n- FastAPI persistence API: `127.0.0.1:8765`\n- Isolated execution origin: `127.0.0.1:8766`\n\n#### Production build and servers\n\nTo create a production build and launch the application and execution servers\nwith one command:\n\n```bash\nnpm start\n```\n\nThe controller selects two available loopback ports, generates a per-launch API\ntoken, opens CodeBro in the default browser, and stores sessions under\n`~/Library/Application Support/CodeBro`.\n\n#### Backend only\n\nTo run only the FastAPI persistence backend:\n\n```bash\nCODEBRO_DATA_DIR=\"$PWD/.local-data\" \\\n  .venv/bin/python -m uvicorn app.main:app \\\n  --app-dir backend \\\n  --host 127.0.0.1 \\\n  --port 8765\n```\n\nThe standalone backend uses the development API token `dev-token`. Its strict\nHost validation expects requests to arrive through the Vite development proxy\nat `http://127.0.0.1:5173`.\n\n### Verification\n\n```bash\nnpm test\nnpm run lint\nnpm run typecheck\nnpm run build\n.venv/bin/pytest backend/tests\nnpm run smoke:python\n```\n\nThe browser smoke harness uses an existing local Chrome installation:\n\n```bash\nnpm run dev\nnpm run smoke:ui\n```\n\n## Packaged macOS distribution\n\nCodeBro supports macOS 14 or newer on Apple silicon. The packaged application\nincludes its Python runtime and other dependencies; the destination Mac does\nnot need Python, Node.js, uv, or npm.\n\n### Build the app and DMG\n\nIf you installed the `package` extra during development setup, build the\napplication and DMG with:\n\n```bash\nscripts/package-macos.sh\n```\n\n`CODEBRO_SIGNING_IDENTITY` may be set to a Developer ID Application identity.\nSet `CODEBRO_NOTARY_PROFILE` to an `xcrun notarytool` keychain profile to\nnotarize and staple both the application and DMG. Without release credentials,\nthe script generates a validated unsigned development bundle at\n`release/CodeBro.app`.\n\n### Install from the DMG\n\n1. Copy `release/CodeBro.dmg` to the destination Mac.\n2. Double-click `CodeBro.dmg` to mount it.\n3. Drag `CodeBro.app` into the Applications folder.\n4. Eject the CodeBro disk image.\n5. Open CodeBro from Applications.\n\nIf you received `CodeBro.app` directly instead of the DMG, copy it into the\nApplications folder and open it from there.\n\n### Open an unsigned development build\n\nA build created without signing and notarization credentials may be blocked by\nGatekeeper. Only bypass this protection for a build from a source you trust:\n\n1. Control-click `CodeBro.app` in Applications and select **Open**.\n2. Select **Open** in the confirmation dialog.\n3. If macOS still blocks the app, open **System Settings → Privacy \u0026 Security**\n   and select **Open Anyway** for CodeBro.\n\nA signed and notarized build opens normally without these additional steps.\n\n## Privacy and security\n\nPython executes with Pyodide in a disposable Web Worker on a separate loopback\norigin. The persistence API requires a per-launch capability token that is\nnever sent to the execution origin. This protects CodeBro data and keeps\nrunaway code off the UI thread, but it is not a certified hostile-code sandbox.\n\nCodeBro does not include analytics, telemetry, remote fonts, third-party\nscripts, runtime CDN dependencies, or cloud synchronization. Session names,\nPython source, stdin, output, tags, links, and Notes are not logged or sent to a\nremote service.\n\n## Contributing\n\nIssues and pull requests are welcome. Before submitting a broad change, run:\n\n```bash\n.venv/bin/pytest backend/tests\nnpm test\nnpm run lint\nnpm run typecheck\nnpm run build\nnpm run smoke:python\n```\n\nFor UI or integration changes, also run `npm run dev` followed by\n`npm run smoke:ui`.\n\n## License\n\nCodeBro is available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishanthcs%2Fcode-bro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnishanthcs%2Fcode-bro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishanthcs%2Fcode-bro/lists"}