Skip to content

Commit d95060f

Browse files
authored
docs: add generated project wiki (#158)
1 parent 2365e3a commit d95060f

20 files changed

Lines changed: 2437 additions & 0 deletions

docs/wiki/_meta/manifest.json

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
{
2+
"generated_at": "2026-04-02T02:16:55Z",
3+
"wiki_root": "docs/wiki",
4+
"router_mode": "app",
5+
"pages": [
6+
{
7+
"path": "docs/wiki/index.md",
8+
"sources": [
9+
"package.json",
10+
"app",
11+
"lib/platform/readme.md",
12+
"prisma/schema.prisma"
13+
]
14+
},
15+
{
16+
"path": "docs/wiki/architecture.md",
17+
"sources": [
18+
"app/layout.tsx",
19+
"instrumentation.ts",
20+
"lib/startup/index.ts",
21+
"lib/platform/readme.md",
22+
"lib/platform/control/readme.md",
23+
"lib/platform/control/commands/readme.md",
24+
"lib/actions",
25+
"lib/repo",
26+
"lib/jobs",
27+
"lib/events"
28+
]
29+
},
30+
{
31+
"path": "docs/wiki/routing.md",
32+
"sources": [
33+
"app",
34+
"components/sidebar.tsx",
35+
"components/sidebars/project-sidebar.tsx",
36+
"components/layout/project-content-wrapper.tsx",
37+
"app/(dashboard)/settings/_components/settings-sidebar.tsx"
38+
]
39+
},
40+
{
41+
"path": "docs/wiki/rendering-and-data-flow.md",
42+
"sources": [
43+
"app/layout.tsx",
44+
"app/(landing)/page.tsx",
45+
"provider/providers.tsx",
46+
"hooks/use-project.ts",
47+
"hooks/use-environment-variables.ts",
48+
"components/layout/project-content-wrapper.tsx",
49+
"lib/fetch-client.ts",
50+
"lib/data/project.ts"
51+
]
52+
},
53+
{
54+
"path": "docs/wiki/auth-and-state.md",
55+
"sources": [
56+
"lib/auth.ts",
57+
"lib/api-auth.ts",
58+
"provider/sealos.tsx",
59+
"lib/actions/sealos-auth.ts",
60+
"app/(auth)/login/page.tsx"
61+
]
62+
},
63+
{
64+
"path": "docs/wiki/config-and-env.md",
65+
"sources": [
66+
"next.config.ts",
67+
"package.json",
68+
"lib/env.ts",
69+
"instrumentation.ts",
70+
"lib/startup/index.ts",
71+
"lib/const.ts"
72+
]
73+
},
74+
{
75+
"path": "docs/wiki/data-models.md",
76+
"sources": [
77+
"prisma/schema.prisma",
78+
"lib/repo/project.ts"
79+
]
80+
},
81+
{
82+
"path": "docs/wiki/integrations.md",
83+
"sources": [
84+
"lib/k8s/k8s-service-helper.ts",
85+
"lib/services/github-app.ts",
86+
"lib/services/aiproxy.ts",
87+
"lib/util/ttyd-context.ts",
88+
"provider/sealos.tsx",
89+
"lib/platform/integrations/README.md"
90+
]
91+
},
92+
{
93+
"path": "docs/wiki/background-jobs.md",
94+
"sources": [
95+
"instrumentation.ts",
96+
"lib/startup/index.ts",
97+
"lib/jobs/sandbox/sandboxReconcile.ts",
98+
"lib/jobs/database/databaseReconcile.ts",
99+
"lib/jobs/project-task/projectTaskReconcile.ts",
100+
"lib/events/sandbox/sandboxListener.ts",
101+
"lib/events/database/databaseListener.ts"
102+
]
103+
},
104+
{
105+
"path": "docs/wiki/todo.md",
106+
"sources": [
107+
"components/sidebar.tsx",
108+
"app/(dashboard)/settings/_components/settings-sidebar.tsx",
109+
"app/(dashboard)/projects/(list)/_components/project-actions-menu.tsx",
110+
"app/(dashboard)/projects/[id]/exec-test/page.tsx",
111+
"lib/actions/sandbox.ts",
112+
"lib/platform/readme.md",
113+
"app/api"
114+
]
115+
},
116+
{
117+
"path": "docs/wiki/api/index.md",
118+
"sources": [
119+
"app/api",
120+
"lib/api-auth.ts"
121+
]
122+
},
123+
{
124+
"path": "docs/wiki/api/auth-and-github.md",
125+
"sources": [
126+
"app/api/auth/[...nextauth]/route.ts",
127+
"app/api/github/app/callback/route.ts",
128+
"app/api/github/app/webhook/route.ts",
129+
"lib/auth.ts",
130+
"lib/services/github-app.ts",
131+
"app/github/app/callback/page.tsx"
132+
]
133+
},
134+
{
135+
"path": "docs/wiki/api/projects-and-runtime.md",
136+
"sources": [
137+
"app/api/projects/[id]/route.ts",
138+
"app/api/projects/[id]/start/route.ts",
139+
"app/api/projects/[id]/stop/route.ts",
140+
"app/api/projects/[id]/delete/route.ts",
141+
"app/api/projects/[id]/environment/route.ts",
142+
"app/api/projects/[id]/environment/[envId]/route.ts",
143+
"app/api/sandbox/[id]/cwd/route.ts",
144+
"app/api/sandbox/[id]/exec/route.ts",
145+
"app/api/sandbox/[id]/app-status/route.ts",
146+
"hooks/use-project.ts",
147+
"hooks/use-project-operations.ts",
148+
"hooks/use-environment-variables.ts",
149+
"hooks/use-app-runner.ts",
150+
"components/terminal/xterm-terminal.tsx"
151+
]
152+
},
153+
{
154+
"path": "docs/wiki/api/user-config.md",
155+
"sources": [
156+
"app/api/user/config/route.ts",
157+
"app/api/user/config/anthropic/route.ts",
158+
"app/api/user/config/kc/route.ts",
159+
"app/api/user/config/system-prompt/route.ts",
160+
"components/dialog/settings-dialog.tsx",
161+
"lib/k8s/k8s-service-helper.ts"
162+
]
163+
},
164+
{
165+
"path": "docs/wiki/features/auth-and-identity.md",
166+
"sources": [
167+
"app/(auth)/login/page.tsx",
168+
"app/(auth)/auth-error/page.tsx",
169+
"app/github/app/callback/page.tsx",
170+
"lib/auth.ts",
171+
"provider/sealos.tsx",
172+
"lib/actions/sealos-auth.ts"
173+
]
174+
},
175+
{
176+
"path": "docs/wiki/features/project-workspace.md",
177+
"sources": [
178+
"app/(dashboard)/projects/(list)/page.tsx",
179+
"app/(dashboard)/projects/[id]/layout.tsx",
180+
"app/(dashboard)/projects/[id]/database/page.tsx",
181+
"app/(dashboard)/projects/[id]/environment/page.tsx",
182+
"app/(dashboard)/projects/[id]/secrets/page.tsx",
183+
"app/(dashboard)/projects/[id]/auth/page.tsx",
184+
"app/(dashboard)/projects/[id]/payment/page.tsx",
185+
"components/layout/project-content-wrapper.tsx",
186+
"hooks/use-project.ts",
187+
"hooks/use-project-operations.ts",
188+
"hooks/use-environment-variables.ts",
189+
"lib/actions/project.ts",
190+
"lib/actions/database.ts"
191+
]
192+
},
193+
{
194+
"path": "docs/wiki/features/github-and-import.md",
195+
"sources": [
196+
"app/(dashboard)/projects/_components/import-github-dialog.tsx",
197+
"app/(dashboard)/projects/[id]/github/page.tsx",
198+
"app/github/app/callback/page.tsx",
199+
"lib/actions/github.ts",
200+
"lib/actions/project.ts",
201+
"lib/services/github-app.ts",
202+
"lib/services/repoService.ts",
203+
"lib/platform/control/commands/project/create-project-from-github.ts",
204+
"lib/jobs/project-task/executors/clone-repository.ts"
205+
]
206+
},
207+
{
208+
"path": "docs/wiki/features/user-settings.md",
209+
"sources": [
210+
"app/(dashboard)/settings/page.tsx",
211+
"app/(dashboard)/settings/integrations/page.tsx",
212+
"app/(dashboard)/settings/_components/github-status-card.tsx",
213+
"app/(dashboard)/settings/_components/settings-sidebar.tsx",
214+
"components/dialog/settings-dialog.tsx",
215+
"provider/sealos.tsx"
216+
]
217+
},
218+
{
219+
"path": "docs/wiki/features/global-skills.md",
220+
"sources": [
221+
"app/(dashboard)/skills/page.tsx",
222+
"app/(dashboard)/skills/_components/skills-library.tsx",
223+
"lib/actions/skill.ts",
224+
"lib/skills/catalog.ts",
225+
"lib/platform/control/commands/skill/enable-global-skill.ts",
226+
"lib/platform/control/commands/skill/uninstall-global-skill.ts",
227+
"lib/jobs/project-task/executors/install-skill.ts",
228+
"lib/jobs/project-task/executors/uninstall-skill.ts"
229+
]
230+
}
231+
]
232+
}

docs/wiki/api/auth-and-github.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Auth and GitHub API
2+
3+
## Domain Summary
4+
5+
This domain covers identity exchange, GitHub App installation binding, and GitHub webhook lifecycle updates.
6+
7+
## Public Endpoints
8+
9+
### `GET | POST /api/auth/[...nextauth]`
10+
11+
Type: `public`
12+
13+
Source:
14+
15+
- `app/api/auth/[...nextauth]/route.ts` - route entry
16+
- `lib/auth.ts` - provider and callback configuration
17+
18+
Auth:
19+
20+
- Owned by NextAuth
21+
- Provider-specific auth happens inside the NextAuth handler
22+
23+
Request:
24+
25+
- Params: dynamic catch-all segment used by NextAuth
26+
- Query: NextAuth-managed
27+
- Body: provider-specific, including credentials or OAuth callback payloads
28+
- Headers: browser session and CSRF cookies as required by NextAuth
29+
30+
Response:
31+
32+
- Success: NextAuth-managed redirects, session cookies, or JSON depending on the auth sub-route
33+
- Failure: NextAuth error responses or redirect to `/auth-error`
34+
35+
Side effects:
36+
37+
- creates or updates `User`
38+
- creates or updates `UserIdentity`
39+
- stores JWT-backed session state
40+
- sets cross-site-friendly auth cookies
41+
42+
Main callers:
43+
44+
- `app/(auth)/login/page.tsx` - credentials and GitHub sign-in UI
45+
- `lib/actions/sealos-auth.ts` - Sealos server-side sign-in helper
46+
47+
### `GET /api/github/app/callback`
48+
49+
Type: `public`
50+
51+
Source:
52+
53+
- `app/api/github/app/callback/route.ts` - route entry
54+
- `lib/services/github-app.ts` - OAuth exchange and installation lookup
55+
- `lib/repo/github.ts` - installation persistence
56+
57+
Auth:
58+
59+
- Requires an authenticated Fulling session
60+
- Verifies installation ownership unless OAuth exchange already established that link
61+
62+
Request:
63+
64+
- Params: none
65+
- Query:
66+
- `installation_id` required
67+
- `setup_action` optional
68+
- `code` optional
69+
- Body: none
70+
- Headers: session cookies
71+
72+
Response:
73+
74+
- Success: small HTML page that posts a success message to the opener and closes itself
75+
- Failure: JSON error for missing auth or invalid install context, or failure HTML page
76+
77+
Side effects:
78+
79+
- may exchange GitHub OAuth code for user tokens
80+
- upserts `GITHUB` `UserIdentity`
81+
- creates or updates `GitHubAppInstallation`
82+
83+
Main callers:
84+
85+
- `app/github/app/callback/page.tsx` - popup completion page that forwards query params here
86+
- GitHub App installation redirect flow
87+
88+
### `POST /api/github/app/webhook`
89+
90+
Type: `public`
91+
92+
Source:
93+
94+
- `app/api/github/app/webhook/route.ts` - route entry
95+
- `lib/services/github-app.ts` - webhook signature verification
96+
- `lib/repo/github.ts` - installation status updates
97+
98+
Auth:
99+
100+
- No session auth
101+
- Requires valid `x-hub-signature-256` verification
102+
103+
Request:
104+
105+
- Params: none
106+
- Query: none
107+
- Body: GitHub webhook JSON payload
108+
- Headers:
109+
- `x-hub-signature-256`
110+
- `x-github-event`
111+
112+
Response:
113+
114+
- Success: `{ "ok": true }`
115+
- Failure: `401` for invalid signature, `500` for processing failures
116+
117+
Side effects:
118+
119+
- updates GitHub installation status for `deleted`, `suspend`, and `unsuspend`
120+
121+
Main callers:
122+
123+
- GitHub webhook delivery
124+
125+
## Shared Dependencies
126+
127+
- `lib/auth.ts`
128+
- `lib/services/github-app.ts`
129+
- `lib/repo/github.ts`
130+
- Prisma models `UserIdentity` and `GitHubAppInstallation`
131+
132+
## Main Callers
133+
134+
- login page
135+
- Sealos auth server action
136+
- popup callback page
137+
- GitHub App install popup flows from settings and import dialogs
138+

0 commit comments

Comments
 (0)