{"id":48630693,"url":"https://github.com/tubexchat/docs-private-frame","last_synced_at":"2026-04-09T05:02:00.813Z","repository":{"id":347773115,"uuid":"1195190863","full_name":"tubexchat/docs-private-frame","owner":"tubexchat","description":"A single-language private technical documentation framework with Cloudflare deployment support.","archived":false,"fork":false,"pushed_at":"2026-03-29T13:22:57.000Z","size":169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-29T15:28:57.432Z","etag":null,"topics":["docs-demo","docs-site"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/tubexchat.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":null,"dco":null,"cla":null}},"created_at":"2026-03-29T10:59:02.000Z","updated_at":"2026-03-29T13:23:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tubexchat/docs-private-frame","commit_stats":null,"previous_names":["tubexchat/docs-private-frame"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tubexchat/docs-private-frame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubexchat%2Fdocs-private-frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubexchat%2Fdocs-private-frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubexchat%2Fdocs-private-frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubexchat%2Fdocs-private-frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tubexchat","download_url":"https://codeload.github.com/tubexchat/docs-private-frame/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubexchat%2Fdocs-private-frame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31586410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"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":["docs-demo","docs-site"],"created_at":"2026-04-09T05:01:59.975Z","updated_at":"2026-04-09T05:02:00.801Z","avatar_url":"https://github.com/tubexchat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e🔒 Docs Private Frame\u003c/h1\u003e\n  \u003cp\u003e\u003cstrong\u003eA modern, privacy-first documentation framework built on top of Docusaurus 3.\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eSeamlessly deployable to Cloudflare Pages with built-in password protection via Pages Functions.\u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-00C087.svg?style=for-the-badge\" alt=\"License: MIT\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docusaurus.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Built_with-Docusaurus_3-2E8555?style=for-the-badge\u0026logo=docusaurus\" alt=\"Docusaurus 3\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://pages.cloudflare.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Deployed_on-Cloudflare_Pages-F38020?style=for-the-badge\u0026logo=cloudflare\" alt=\"Cloudflare Pages\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n## ✨ Features\n\n- **📝 Markdown / MDX First** — Write docs using standard Markdown or embed React components via MDX.\n- **🔒 Private By Default** — Secure Cloudflare Pages Functions middleware intercepts all requests; unauthenticated users are redirected cleanly to a beautiful login screen.\n- **🔑 Secure Sessions** — Built using HMAC-SHA256 signed HttpOnly + Secure cookies with a default 7-day expiration.\n- **🔍 Offline Local Search** — Integrated `@easyops-cn/docusaurus-search-local` for instant, privacy-respecting offline search without third-party services.\n- **🌗 Dark Mode Ready** — Native light/dark theme toggle out of the box.\n- **☁️ 1-Click Deployment** — Includes `deploy-cf.sh` to seamlessly build and deploy the framework.\n\n---\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/) \u003e= 18.0\n- [npm](https://www.npmjs.com/)\n- [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/) (Required for deployment)\n\n### Local Development\n\n```bash\n# 1. Install dependencies\nnpm install\n\n# 2. Start the local development server (No auth interception)\nnpm start\n```\n\n\u003e **Note:** Running `npm start` **does not** trigger the Cloudflare authentication middleware. You can access the site directly at `http://localhost:3000`.\n\u003e \n\u003e To test the complete login flow locally, run:\n\u003e ```bash\n\u003e npm run cf:preview   # Builds production static files \u0026 runs wrangler pages dev\n\u003e ```\n\n---\n\n## 📂 Project Structure\n\n```text\ndocs-private-frame/\n├── docs/                    # Markdown content (sidebar is auto-generated)\n├── src/\n│   ├── css/custom.css       # Global styles (Brand color: #00C087)\n│   └── theme/               # Docusaurus theme overrides\n├── static/                  # Static assets (images, favicon)\n├── functions/\n│   └── _middleware.js       # ⭐ Cloudflare Pages Authentication Middleware\n├── docusaurus.config.js     # Docusaurus core configuration\n├── sidebars.js              # Sidebar structure configuration\n├── wrangler.toml            # Cloudflare Pages configuration\n└── deploy-cf.sh             # 1-Click deployment script\n```\n\n---\n\n## 🔒 Authentication System\n\nThe entire login logic is handled natively by `functions/_middleware.js`. **No external database or services are required**.\n\n| Route | Behavior |\n|------|------|\n| `GET /__login` | Renders the beautiful auth screen. |\n| `POST /__login` | Validates the password and issues a secure session cookie. |\n| `GET /__login?logout=1` | Destroys the cookie and processes logout. |\n| All other paths | Validates the cookie payload. Redirects to `/__login` if missing or invalid. |\n\n### Environment Variables\n\n| Variable | Description |\n|------|------|\n| `AUTH_PASSWORD` | The master password to access your documentation. |\n| `AUTH_SECRET` | Secret key used to sign session cookies (Recommended: 48+ chars random string). |\n\n\u003e [!WARNING]\n\u003e **Never hardcode passwords in your source base!** Inject them securely via Cloudflare Secrets:\n\u003e\n\u003e ```bash\n\u003e wrangler pages secret put AUTH_PASSWORD --project-name=docs-private-frame\n\u003e wrangler pages secret put AUTH_SECRET   --project-name=docs-private-frame\n\u003e ```\n\u003e *(Tip: Generate a strong secret by running `openssl rand -base64 48`)*\n\n---\n\n## ☁️ Deployment (Cloudflare Pages)\n\n### Method 1: The Deployment Script\n\nWe've bundled a convenient bash script that handles building and uploading:\n\n```bash\nchmod +x deploy-cf.sh\n./deploy-cf.sh\n```\n\n### Method 2: Manual Deployment\n\n```bash\n# 1. Build the production static bundle\nnpm run build\n\n# 2. Deploy to Cloudflare Pages (Deploying the static bundle + Functions)\nwrangler pages deploy build --project-name=docs-private-frame\n```\n\n### Post-Deployment Checklist\n\nAfter your first successful deployment, you **must set your production `.env` variables** so the authentication middleware works properly.  \nYou can configure these directly in your Cloudflare dashboard:  \n**Cloudflare Dashboard → Pages → `docs-private-frame` → Settings → Environment variables**\n\n---\n\n## 🛠️ Common Commands\n\n| Command | Description |\n|------|------|\n| `npm start` | Local development server (No login interception). |\n| `npm run build` | Builds the static site for production. |\n| `npm run cf:preview` | Local preview simulating the full Cloudflare Pages environment (includes auth). |\n| `npm run serve` | Serves the built static files locally. |\n| `./deploy-cf.sh` | Compiles and deploys the project to Cloudflare. |\n\n---\n\n## 📄 License\n\nThis framework is open-sourced under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftubexchat%2Fdocs-private-frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftubexchat%2Fdocs-private-frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftubexchat%2Fdocs-private-frame/lists"}