AI Land is an HR AI community platform for the HRAS team. It brings together the scenario library, AI war report, courses, AI competitions, and recommended AI applications in one place.
- Framework: Next.js 16 (App Router)
- UI: React 19 + Ant Design 6 + Tailwind CSS 4
- Backend: Supabase (PostgreSQL + RLS)
- Authentication: Feishu OAuth
- Deployment: Vercel
npm install
npm run devOpen http://localhost:3000.
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase anon key |
SUPABASE_SERVICE_ROLE_KEY |
Supabase service role key, used by API routes |
Feishu app credentials are stored in the feishu_apps table and managed through the admin UI. They are not stored in environment variables. See CONTRIBUTING.md for details.
src/
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ ├── admin/ # Admin console
│ ├── wish-pool/ # Scenario library with three tab views
│ ├── war-report/ # Admin-only AI adoption war report
│ ├── resources/ # Courses and resources, including courses and tools
│ ├── competitions/ # AI competitions
│ └── page.tsx # Home page with centered hero and 5-item glass metrics strip
├── components/ # Shared components: Navigation, ChoDashboard, resource cards, EntryCard, etc.
└── lib/ # Utilities: Supabase, Feishu, auth, bitable mapping, resource normalization, export-image styles
- The admin console uses lightweight RBAC through the
rolesanduser_rolestables.role_permissionsis a legacy table and is not read at runtime. Permission points and role rules are declared insrc/lib/permissions/registry.ts. - The visible admin console entry is an admin-only top navigation module. Its menu currently contains Content Review, User Permissions, Bitable Field Mapping, and Feishu App Configuration.
/war-reportis an admin-only main navigation module. Its data API isGET /api/admin/war-report; the Feishu sync button on that page reusesPOST /api/admin/competition-syncand remains guarded bycompetition.sync.- User permission management is available at
/admin/roles, withRole ListandUser Assignmentviews. Role permissions are maintained in code, not configured through an admin matrix. - The legacy
/admin/usersroute is kept for compatibility and redirects to/admin/roles?tab=users. - The
adminrole has all permissions by default. Reviewer role assignment is a legacy flow and is no longer shown or maintained in the user authorization UI. - The
userrole hascase.submit,resource.submit, andresource.generate-feishu-cardby default.
- The tools page can generate a visual Feishu card for a single tool and send it to the currently logged-in user.
- API:
POST /api/resources/card-to-me, with body{ "resourceId": "<apps.id>" }. - The server reads the current user from the
feishu_user_idcookie, looks up that user'sfeishu_open_id, and sends withreceive_id_type=open_id. It does not broadcast to group chats. - The card template reuses
src/lib/feishu-cards.ts#buildResourceCard. The tools entry point is/resources?tab=apps.
- Scenario library, AI competition progress, and CHO dashboard pages read
competition_submissionssnapshots from Supabase by default. Foreground page refreshes do not pull Feishu directly. - AI war report also reads the same
competition_submissionssnapshots. It defaults to all review periods, aggregates team performance, and keeps committee operation sections inwar_report_manual_sections. - Full Feishu bitable sync is centralized in the admin field-map page:
/admin/bitable-field-map->全量同步飞书场景数据->POST /api/admin/competition-sync, guarded by thecompetition.syncpermission. - The Vercel cron route
GET /api/cron/sync-competitionsuses the same sync service. - Sync status is stored in
platform_settingsthrough migration074_competition_sync_status.sql, including the latest attempt time, latest successful sync time, status, and result counts such as synced and changed rows. - Sync code preserves historical submission IDs that already have review records, then writes the latest Feishu fields onto that ID and removes duplicate shadow rows.
See CONTRIBUTING.md, AGENTS.md, docs/operator-runbook.md, and docs/war-report.md.
AI Land 是面向 HRAS 团队的 HR AI 社区平台,集成场景大全、AI 战报、课程、AI 大赛、应用推荐等模块。
- 框架: Next.js 16 (App Router)
- UI: React 19 + Ant Design 6 + Tailwind CSS 4
- 后端: Supabase (PostgreSQL + RLS)
- 认证: 飞书 OAuth
- 部署: Vercel
npm install
npm run dev访问 http://localhost:3000。
| 变量 | 说明 |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase 项目 URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase anon key |
SUPABASE_SERVICE_ROLE_KEY |
Supabase service role key,供 API 路由使用 |
飞书应用凭证存于 feishu_apps 表,并通过 admin UI 管理,不放在环境变量中。详见 CONTRIBUTING.md。
src/
├── app/ # Next.js App Router 页面
│ ├── api/ # API 路由
│ ├── admin/ # 管理后台
│ ├── wish-pool/ # 场景大全(三 Tab 视图)
│ ├── war-report/ # 管理员专属 AI 应用推广战报
│ ├── resources/ # 课程与资源(课程 + 工具)
│ ├── competitions/ # AI 大赛
│ └── page.tsx # 首页(居中 Hero + 5 项 glass 指标带)
├── components/ # 共享组件:Navigation、ChoDashboard、资源卡片、EntryCard 等
└── lib/ # 工具函数:Supabase、飞书、认证、bitable 映射、资源字段归一化、导出图片样式
- 管理后台权限使用轻量 RBAC:运行时读取
roles/user_roles,role_permissions是历史遗留表不再读取;权限点和角色规则在src/lib/permissions/registry.ts声明。 - 管理后台入口是顶部导航里的管理员专属模块,当前菜单只包含:内容审核、用户权限、字段映射配置、飞书应用配置、操作日志。
/war-report是管理员专属主导航模块,数据 API 为GET /api/admin/war-report;页面上的飞书同步按钮复用POST /api/admin/competition-sync,继续由competition.sync权限控制。- 用户权限入口为
/admin/roles,包含角色列表、用户授权两个视图。角色权限在代码规则中维护,不再通过后台权限矩阵配置。 - 旧
/admin/users保留为兼容跳转,自动重定向到/admin/roles?tab=users。 admin角色默认拥有全部权限;评委角色授权是历史流程,用户授权页不再展示或维护。user角色默认拥有case.submit、resource.submit、resource.generate-feishu-card。
- 工具页支持把单个工具生成飞书可视化卡片并发送给当前登录用户本人。
- API:
POST /api/resources/card-to-me,body 为{ "resourceId": "<apps.id>" }。 - 服务端按
feishu_user_idcookie 查询当前用户的feishu_open_id,使用receive_id_type=open_id发送,不会群发到群聊。 - 卡片模板复用
src/lib/feishu-cards.ts#buildResourceCard,工具列表入口为/resources?tab=apps。
- 场景大全、AI 大赛进展和成效看板页面默认读取 Supabase 的
competition_submissions快照,前台页面刷新不直接拉取飞书。 - AI 战报也读取同一份
competition_submissions快照,默认展示全部评审周期,按团队聚合业务表现;组委会运营层的人工维护事项保存在war_report_manual_sections。 - 飞书多维表全量同步统一收口到管理后台字段映射页:
/admin/bitable-field-map->全量同步飞书场景数据->POST /api/admin/competition-sync,由competition.sync权限控制。 - Vercel 定时任务
GET /api/cron/sync-competitions复用同一套同步服务。 - 同步状态通过
074_competition_sync_status.sql写入platform_settings,记录最近尝试时间、最近成功同步时间、状态,以及成功/变化等结果数量;前台展示文案为「数据最近更新时间:...」。 - 同步审计通过
075_operation_logs.sql写入operation_logs:后台手动同步记录source=admin、操作者和结果,Vercel cron 记录source=cron,后台/admin/operation-logs为查看入口。 - 同步逻辑会保留已有评审记录关联的历史方案 ID,把最新飞书字段写回该 ID,并清理重复影子行。
- 场景大全列表的落地计划字段依赖
073_competition_landing_plan_fields.sql写入competition_submissions:进展备注、计划启动日期、试点上线日期、推广上线日期、全面上线日期、业务对接人、AI 对接人。 - 业务/AI 对接人详情依赖
076_competition_owner_profiles.sql的biz_owner_profiles、ai_owner_profiles快照列。前台统一用src/components/PersonContactDisplay.tsx展示姓名、飞书头像、工号/岗位 hover 信息和飞书跳转;部门不展示,缺失工号/岗位时显示「无权限/暂无资料」。
见 CONTRIBUTING.md、AGENTS.md、docs/operator-runbook.md 和 docs/war-report.md。