{"id":30160209,"url":"https://github.com/little-data/navsphere","last_synced_at":"2025-08-11T15:38:10.100Z","repository":{"id":307869559,"uuid":"1030951409","full_name":"Little-Data/navsphere","owner":"Little-Data","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-02T18:17:38.000Z","size":5305,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-02T19:31:50.715Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://navsphere-delta.vercel.app","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Little-Data.png","metadata":{"files":{"readme":"README-CN.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-08-02T17:23:30.000Z","updated_at":"2025-08-02T18:17:41.000Z","dependencies_parsed_at":"2025-08-02T19:32:40.087Z","dependency_job_id":"c1cdd585-c201-41b3-9941-d60558393c4b","html_url":"https://github.com/Little-Data/navsphere","commit_stats":null,"previous_names":["little-data/navsphere"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Little-Data/navsphere","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Little-Data%2Fnavsphere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Little-Data%2Fnavsphere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Little-Data%2Fnavsphere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Little-Data%2Fnavsphere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Little-Data","download_url":"https://codeload.github.com/Little-Data/navsphere/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Little-Data%2Fnavsphere/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269915010,"owners_count":24495636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"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":[],"created_at":"2025-08-11T15:38:09.585Z","updated_at":"2025-08-11T15:38:10.091Z","avatar_url":"https://github.com/Little-Data.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# NavSphere\n\n## Overview\nNavSphere is a web application designed for managing navigation items and categories. It provides an intuitive interface for adding, editing, and organizing navigation entries, including site icons and descriptions.\n\n## Features\n- **Add/Edit Navigation Items**: Easily add or modify navigation items with titles, links, icons, and descriptions.\n- **Icon Management**: Upload or fetch icons for each navigation item.\n- **Drag-and-Drop Interface**: Reorder navigation items and categories using drag-and-drop functionality.\n- **Responsive Design**: Works seamlessly on various devices and screen sizes.\n\n## Installation\n\n### Prerequisites\n- Node.js (version x.x.x)\n- npm or yarn\n\n### Steps\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/tianyaxiang/NavSphere.git\n\n```bash\nnpm run dev\n# or\nyarn dev\n# or\npnpm dev\n# or\nbun dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n\nYou can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.\n\nThis project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.\n\n## Learn More\n\nTo learn more about Next.js, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n\nYou can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!\n\n## Deploy on Vercel\n\nThe easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template\u0026filter=next.js\u0026utm_source=create-next-app\u0026utm_campaign=create-next-app-readme) from the creators of Next.js.\n\nCheck out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.\n\n## 本地开发配置\n\n### 1. GitHub OAuth App 配置\n\n1. 访问 [GitHub Developer Settings](https://github.com/settings/developers)\n   - 点击右上角头像\n   - Settings\n   - 左侧边栏底部 Developer settings\n   - OAuth Apps\n   - New OAuth App\n\n2. 填写应用信息：\n   ```\n   Application name: 你的应用名称\n   Homepage URL: http://localhost:3000\n   Authorization callback URL: http://localhost:3000/api/auth/callback/github\n   ```\n\n3. 创建后获取：\n   - Client ID: 显示在应用详情页\n   - Client Secret: 点击 \"Generate a new client secret\" 生成\n\n### 2. GitHub 仓库配置\n\n1. 创建用于存储数据的仓库：\n   - 访问 [GitHub New Repository](https://github.com/new)\n   - 填写仓库名\n   - 选择 Public 或 Private\n   - 创建仓库\n\n2. 获取仓库信息：\n   ```\n   GITHUB_OWNER: 你的 GitHub 用户名\n   GITHUB_REPO: 仓库名\n   ```\n\n3. 创建 GitHub 组织（可选）：\n   - 访问 [GitHub New Organization](https://github.com/organizations/new)\n   - 选择免费计划\n   - 填写组织名称\n   - 将需要访问的用户添加到组织\n\n### 3. 环境变量配置\n\n```env\n# GitHub OAuth App 配置\nGITHUB_ID=从 OAuth App 获取的 Client ID\nGITHUB_SECRET=从 OAuth App 获取的 Client Secret\n\n# GitHub 组织和仓库配置\nGITHUB_ORG=你的组织名称（如果使用组织）\nGITHUB_OWNER=你的 GitHub 用户名\nGITHUB_REPO=用于存储数据的仓库名\nGITHUB_BRANCH=main\n\n# NextAuth 配置\nNEXTAUTH_URL=http://localhost:3000\nNEXTAUTH_SECRET=使用以下命令生成:\n# openssl rand -base64 32\n```\n\n### 4. 权限配置\n\n1. OAuth App 权限：\n   - 在 OAuth App 设置页面\n   - 确保 `read:org` 和 `repo` 权限被勾选\n\n2. 仓库权限：\n   - 如果是私有仓库，确保 OAuth App 有访问权限\n   - 如果使用组织，确保 OAuth App 已在组织中安装\n\n### 5. 注意事项\n\n1. 本地开发和生产环境使用不同的 OAuth App\n2. 生产环境需要更新回调 URL 为实际域名\n3. 确保 `.env.local` 不被提交到 Git\n4. 生产环境使用 Cloudflare Pages 的环��\n5. 定期轮换 Client Secret 以提高安全性\n\n## Cloudflare Pages 部署\n\n1. 在 Cloudflare Pages 中创建新项目\n2. 连接 GitHub 仓库\n3. 设置构建命令：\n   ```bash\n   pnpm install \u0026\u0026 pnpm build\n   ```\n4. 设置环境变量：\n   - GITHUB_ID\n   - GITHUB_SECRET\n   - GITHUB_OWNER\n   - GITHUB_REPO\n   - GITHUB_BRANCH\n   - NEXTAUTH_URL (设置为你的域名)\n   - NEXTAUTH_SECRET\n5. 部署项目\n\n## 环境变量\n\n需要配置以下环境变量：\n\n```env\nNEXTAUTH_URL=http://localhost:3000\nNEXTAUTH_SECRET=your-secret-here\nGITHUB_ID=your-github-id\nGITHUB_SECRET=your-github-secret\nGITHUB_OWNER=your-github-username\nGITHUB_REPO=your-repo-name\nGITHUB_BRANCH=main\n```\n\n## 开发\n\n1. 安装依赖\n\n```bash\npnpm install\n```\n\n2. 配置环境变量\n\n```bash\ncp .env.example .env.local\n```\n\n3. 启动开发服务器\n\n```bash\npnpm dev\n```\n\n## 数据文件\n\n项目使用 GitHub 仓库存储数据，需要以下数据文件：\n\n1. `app/data/db/navigation.json` - 导航数据\n2. `app/data/db/resources.json` - 资源数据\n\n这些文件会在首次提交到仓库时自动创建。\n\n## 数据格式\n\n### navigation.json\n```json\n[\n  {\n    \"id\": \"string\",\n    \"title\": \"string\",\n    \"icon\": \"string\",\n    \"items\": [\n      {\n        \"title\": \"string\",\n        \"titleEn\": \"string\",\n        \"description\": \"string\",\n        \"descriptionEn\": \"string\",\n        \"icon\": \"string\",\n        \"href\": \"string\"\n      }\n    ],\n    \"subCategories\": [\n      {\n        \"id\": \"string\",\n        \"title\": \"string\",\n        \"items\": []\n      }\n    ]\n  }\n]\n```\n\n### resources.json\n```json\n[\n  {\n    \"id\": \"string\",\n    \"title\": \"string\",\n    \"items\": [\n      {\n        \"title\": \"string\",\n        \"description\": \"string\",\n        \"icon\": \"string\",\n        \"url\": \"string\"\n      }\n    ]\n  }\n]\n```\n\n## 故障排除\n\n### 导航数据加载失败\n\n1. 检查环境变量配置\n   - GITHUB_OWNER 是否正确\n   - GITHUB_REPO 是否正确\n   - GITHUB_BRANCH 是否正确\n\n2. 检查仓库权限\n   - 仓库是否公开\n   - OAuth App 是否有正确的权限\n   - Token 是否有效\n\n3. 检查数据文件\n   - navigation.json 是否存在\n   - 文件格式是否正确\n   - 文件路径是否正确\n\n4. 查看控制台日志\n   - 检查 API 请求是否成功\n   - 检查错误信息\n   - 检查返回的数据格式\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittle-data%2Fnavsphere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flittle-data%2Fnavsphere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittle-data%2Fnavsphere/lists"}