[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81611":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":10,"openIssues":12,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":13,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":15,"fork":15,"defaultBranch":16,"hasWiki":15,"hasPages":15,"topics":17,"createdAt":8,"pushedAt":8,"updatedAt":18,"readmeContent":19,"aiSummary":20,"trendingCount":13,"starSnapshotCount":13,"syncStatus":21,"lastSyncTime":22,"discoverSource":23},81611,"PracDaGo","cneuralnetwork\u002FPracDaGo","cneuralnetwork",null,"TypeScript",23,8,1,0,36.86,false,"main",[],"2026-06-12 04:01:34","\u003Cp align=\"center\">\n  \u003Cimg src=\".\u002Fassets\u002Fgoprac-banner.png\" alt=\"PracDaGo project banner\" \u002F>\n\u003C\u002Fp>\n\n# PracDaGo\n\nPracDaGo is a local-first Go practice app that turns studying into a fast feedback loop: read the idea, understand the shape of the problem, write Go in the browser, run or submit, and keep your progress moving.\n\nIt is built for learning Go by doing. The exercises follow a book-like topic progression, but the lessons, explanations, problem statements, hints, and tests are original\u002Frephrased content.\n\n## Why This Exists\n\nReading Go helps. Writing Go is where the ideas become yours.\n\nPracDaGo is designed around a simple practice rhythm:\n\n1. Read an intuitive explanation.\n2. Build a mental model for the Go concept.\n3. Solve in the Monaco editor.\n4. Run code or submit against local tests.\n5. Track progress in the browser.\n\nThe goal is not to dump reference material into a UI. The goal is to make each exercise feel like a small, understandable rep in Go thinking.\n\n## Features\n\n- Browser-based Go practice workspace\n- Dark-first UI with light mode toggle\n- Monaco editor for Go code\n- Study flow with explanation, how-it-works, syntax, problem, and solve tabs\n- Lesson outline for longer explanations\n- Better sectioned lesson layout for beginner-friendly reading\n- Chapter filtering and full exercise search\n- Judge-style exercises with per-problem local tests\n- Project-style exercises for open-ended book tasks\n- Run mode for quick compile\u002Foutput checks\n- Submit mode for `Solve` function tests\n- Expected-vs-actual comparison for judged output\n- File upload workspace for file-oriented exercises\n- Browser-local draft saving per problem\n- Browser-local solved-progress tracking\n- JSON-backed problem catalog\n- No login, no hosted database, no account system\n\n## Tech Stack\n\n| Layer | Tech |\n| --- | --- |\n| Frontend | React, Vite, TypeScript |\n| Editor | Monaco Editor |\n| Styling | Tailwind CSS plus custom CSS |\n| Markdown | react-markdown, remark-gfm |\n| Icons | lucide-react |\n| Backend | Go standard library HTTP server |\n| Data | `data\u002Fproblems.json` |\n| Runner | Docker\u002FPodman sandbox running Go code |\n\n## Project Structure\n\n```txt\nGoPrac\u002F\n├── assets\u002F\n│   └── goprac-banner.png\n├── backend\u002F\n│   ├── go.mod\n│   ├── main.go\n│   ├── main_test.go\n│   └── README.md\n├── data\u002F\n│   └── problems.json\n├── frontend\u002F\n│   ├── public\u002F\n│   ├── src\u002F\n│   │   ├── components\u002F\n│   │   ├── App.tsx\n│   │   ├── appState.ts\n│   │   ├── index.css\n│   │   ├── main.tsx\n│   │   ├── problemContent.ts\n│   │   └── types.ts\n│   ├── tests\u002F\n│   ├── package.json\n│   └── vite.config.ts\n├── scripts\u002F\n│   └── expand_learning_content.mjs\n└── README.md\n```\n\n## Run Locally\n\nYou need:\n\n- Node.js\n- npm\n- Go\n- Docker or Podman for sandboxed Run\u002FSubmit\n\n### 1. Start The Backend\n\nFrom the project root:\n\n```bash\ncd backend\ngo run .\n```\n\nThe backend runs on:\n\n```txt\nhttp:\u002F\u002Flocalhost:8080\n```\n\nBy default, the backend binds to `127.0.0.1`, allows browser requests from the local Vite origins, and runs submitted code inside Docker or Podman with no network, a read-only root filesystem, CPU\u002Fmemory\u002Fprocess limits, an execution timeout, request-size limits, and output-size limits.\n\nUseful backend environment variables:\n\n```txt\nPORT=8080\nGOPRAC_BIND_ADDR=127.0.0.1\nGOPRAC_ALLOWED_ORIGINS=http:\u002F\u002Flocalhost:5173,http:\u002F\u002F127.0.0.1:5173\nGOPRAC_SANDBOX_BIN=docker\nGOPRAC_SANDBOX_IMAGE=golang:1.24-alpine\nGOPRAC_SANDBOX_MEMORY=256m\nGOPRAC_SANDBOX_CPUS=1\nGOPRAC_SANDBOX_PIDS=64\nGOPRAC_MAX_BODY_BYTES=131072\nGOPRAC_MAX_CODE_BYTES=65536\nGOPRAC_MAX_CONCURRENT_RUNS=2\nGOPRAC_RUN_TIMEOUT=3s\nGOPRAC_OUTPUT_LIMIT_BYTES=65536\n```\n\n### 2. Start The Frontend\n\nOpen another terminal:\n\n```bash\ncd frontend\nnpm install\nnpm run dev\n```\n\nThe frontend runs on:\n\n```txt\nhttp:\u002F\u002Flocalhost:5173\n```\n\nBy default, the frontend calls:\n\n```txt\nhttp:\u002F\u002Flocalhost:8080\n```\n\nTo point the frontend at another backend:\n\n```bash\nVITE_API_URL=https:\u002F\u002Fyour-backend-url npm run dev\n```\n\n## How The App Works\n\n### Learning Panel\n\nThe learning panel is the reading side of the app. It gives the concept before the exercise and splits longer content into navigable sections.\n\nThe current learning flow includes:\n\n- Explanation\n- How it works\n- Syntax\n- Problem\n- Solve\n\n### Editor Panel\n\nThe editor panel is where you write Go. Drafts are saved to browser `localStorage` per problem, so you can leave and come back without losing code on the same browser.\n\n### Run\n\nRun compiles and executes your code in the sandbox.\n\nIf your code includes a `main` function, that function runs. If it does not, the backend adds an empty `main` so the file can still compile.\n\nUse Run for quick syntax checks, `fmt.Println` debugging, and project-style exercises where there is not a single hidden-test answer.\n\n### Submit\n\nSubmit injects the exercise's local judge tests and runs your `Solve` function against them in the same sandbox.\n\nIf the tests pass, the backend returns `Accepted`, and the problem is marked solved in browser storage.\n\n## Local Storage\n\nPracDaGo stores user state in the browser, not in a database.\n\n| Key | Purpose |\n| --- | --- |\n| `theme` | Light\u002Fdark theme preference |\n| `solved` | List of solved problem IDs |\n| `draft:\u003Cproblem-id>` | Saved editor draft for one problem |\n| `files:\u003Cproblem-id>` | Uploaded sample files for one file-based exercise |\n\nThis means progress is local to one browser profile. Clearing browser data, switching browsers, or using another machine will not carry progress over.\n\n## API\n\nBackend base URL:\n\n```txt\nhttp:\u002F\u002Flocalhost:8080\n```\n\n### Health\n\n```txt\nGET \u002Fapi\u002Fhealth\n```\n\n### Problems\n\n```txt\nGET \u002Fapi\u002Fproblems\n```\n\nReturns all chapters and problems.\n\n### Single Problem\n\n```txt\nGET \u002Fapi\u002Fproblems\u002F:id\n```\n\nReturns one problem by ID.\n\n### Run Code\n\n```txt\nPOST \u002Fapi\u002Frun\n```\n\nExample body:\n\n```json\n{\n  \"problemId\": \"hello-gopher\",\n  \"code\": \"package main\\nfunc Solve(name string) string { return \\\"Hello, \\\" + name + \\\"!\\\" }\",\n  \"mode\": \"submit\"\n}\n```\n\nModes:\n\n- `run`\n- `submit`\n\n## Render Deployment\n\nThe frontend can deploy as a Render Static Site. The backend can deploy as a Render Web Service for API\u002Fproblem browsing, but the Run\u002FSubmit sandbox needs a host where Docker\u002FPodman execution is available and allowed.\n\n### Frontend Static Site\n\nCreate a Render Static Site:\n\n```txt\nRoot directory: frontend\nBuild command: npm install && npm run build\nPublish directory: dist\n```\n\nSet:\n\n```txt\nVITE_API_URL=https:\u002F\u002Fyour-backend.onrender.com\n```\n\n### Backend Web Service\n\nCreate a Render Web Service:\n\n```txt\nRoot directory: .\nBuild command: cd backend && go build -tags netgo -ldflags '-s -w' -o app\nStart command: cd backend && .\u002Fapp\n```\n\nSet:\n\n```txt\nGOPRAC_BIND_ADDR=0.0.0.0\nGOPRAC_ALLOWED_ORIGINS=https:\u002F\u002Fyour-frontend.onrender.com\n```\n\nRender provides `PORT`, and the backend already reads it.\n\nImportant: if Docker\u002FPodman is unavailable in the deployed service, `\u002Fapi\u002Frun` will return a sandbox runtime error. Problem browsing and lesson reading can still work as long as the backend is reachable.\n\n## Security Notes\n\nThe current runner is intentionally sandboxed, but public code execution is still serious infrastructure.\n\nBefore opening Run\u002FSubmit to untrusted users, verify the deployed runner has:\n\n- No network access for submitted code\n- Read-only root filesystem\n- Small writable tmpfs only\n- CPU, memory, process, timeout, request-size, and output-size limits\n- Low concurrency\n- No host Docker socket exposure to user code\n\nIf the deployment target cannot provide that isolation, disable Run\u002FSubmit publicly and keep the site as a learning\u002Fproblem browser.\n\n## Adding Problems\n\nEdit:\n\n```txt\ndata\u002Fproblems.json\n```\n\nEach problem should include:\n\n- `id`\n- `number`\n- `title`\n- `chapter`\n- `difficulty`\n- `tags`\n- `statement`\n- `problemText`\n- `lessonTitle`\n- `lesson`\n- `howItWorks`\n- `syntax`\n- `solve`\n- `approach`\n- `pitfalls`\n- `hints`\n- `starterCode`\n- `solutionCode`\n- `testCode`\n- `examples`\n\nRestart the backend after changing the data file.\n\n## Regenerating Learning Content\n\nThe helper script can expand the learning fields in `data\u002Fproblems.json`:\n\n```bash\nnode scripts\u002Fexpand_learning_content.mjs\n```\n\nReview the diff after running it. The script is useful for broad consistency passes, but the best lessons still deserve human cleanup.\n\n## Verify Before Pushing\n\nFrontend:\n\n```bash\ncd frontend\nnpm run build\nnpm run lint\nnpm test\n```\n\nBackend:\n\n```bash\ncd backend\nCGO_ENABLED=0 GOCACHE=\u002Ftmp\u002Fgoprac-go-cache go test .\u002F...\nCGO_ENABLED=0 GOCACHE=\u002Ftmp\u002Fgoprac-go-cache go build .\u002F...\n```\n\n## Roadmap\n\n- More polished beginner explanations\n- More book-flavored original exercises\n- Safer hosted judge story\n- Export\u002Fimport progress from localStorage\n- Better progress stats by chapter and topic\n- Optional account-backed sync later\n\n## Content Note\n\nThe topic flow is inspired by *The Go Programming Language*, but the lessons, explanations, problem statements, hints, and tests in this repo should be original or rephrased. Keep source material as a reference, not as copied content.\n","PracDaGo是一个基于浏览器的Go语言学习应用，旨在通过实践来加深对Go语言的理解。它提供了一个包含解释、示例代码和即时反馈的练习环境，用户可以在其中编写Go代码并直接在浏览器中运行或提交以测试代码正确性。该项目采用了React与TypeScript构建前端界面，并使用Monaco Editor作为代码编辑器，支持暗黑模式切换，同时利用Docker或Podman为Go代码执行提供安全的沙箱环境。非常适合初学者按部就班地掌握Go语言基础知识，以及有一定基础的学习者通过实战项目进一步提升技能。此外，PracDaGo强调本地优先的设计理念，无需登录账号即可保存进度，使得学习过程更加流畅便捷。",2,"2026-06-11 04:05:41","CREATED_QUERY"]