NavSphere 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.
git clone https://github.com/tianyaxiang/NavSphere.git
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
填写应用信息:
Application name: 你的应用名称
Homepage URL: http://localhost:3000
Authorization callback URL: http://localhost:3000/api/auth/callback/github
创建后获取:
创建用于存储数据的仓库:
获取仓库信息:
GITHUB_OWNER: 你的 GitHub 用户名
GITHUB_REPO: 仓库名
创建 GitHub 组织(可选):
# GitHub OAuth App 配置
GITHUB_ID=从 OAuth App 获取的 Client ID
GITHUB_SECRET=从 OAuth App 获取的 Client Secret
# GitHub 组织和仓库配置
GITHUB_ORG=你的组织名称(如果使用组织)
GITHUB_OWNER=你的 GitHub 用户名
GITHUB_REPO=用于存储数据的仓库名
GITHUB_BRANCH=main
# NextAuth 配置
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=使用以下命令生成:
# openssl rand -base64 32
OAuth App 权限:
read:org 和 repo 权限被勾选仓库权限:
.env.local 不被提交到 Gitpnpm install && pnpm build
需要配置以下环境变量:
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-here
GITHUB_ID=your-github-id
GITHUB_SECRET=your-github-secret
GITHUB_OWNER=your-github-username
GITHUB_REPO=your-repo-name
GITHUB_BRANCH=main
pnpm install
cp .env.example .env.local
pnpm dev
项目使用 GitHub 仓库存储数据,需要以下数据文件:
app/data/db/navigation.json - 导航数据app/data/db/resources.json - 资源数据这些文件会在首次提交到仓库时自动创建。
[
{
"id": "string",
"title": "string",
"icon": "string",
"items": [
{
"title": "string",
"titleEn": "string",
"description": "string",
"descriptionEn": "string",
"icon": "string",
"href": "string"
}
],
"subCategories": [
{
"id": "string",
"title": "string",
"items": []
}
]
}
]
[
{
"id": "string",
"title": "string",
"items": [
{
"title": "string",
"description": "string",
"icon": "string",
"url": "string"
}
]
}
]
检查环境变量配置
检查仓库权限
检查数据文件
查看控制台日志