|
1 | | -# stack-docs |
| 1 | +# Stack Auth Documentation |
2 | 2 |
|
3 | | -This is a Next.js application generated with |
4 | | -[Create Fumadocs](https://github.com/fuma-nama/fumadocs). |
| 3 | +This is the documentation site for Stack Auth, built with [Next.js](https://nextjs.org) and [Fumadocs](https://fumadocs.dev). |
5 | 4 |
|
6 | | -Run development server: |
| 5 | +## Development |
7 | 6 |
|
8 | 7 | ```bash |
9 | | -npm run dev |
10 | | -# or |
11 | 8 | pnpm dev |
12 | | -# or |
13 | | -yarn dev |
14 | 9 | ``` |
15 | 10 |
|
16 | | -Open http://localhost:3000 with your browser to see the result. |
| 11 | +The docs server runs on port `8104` by default (or `${NEXT_PUBLIC_STACK_PORT_PREFIX}04`). |
17 | 12 |
|
18 | | -## Explore |
| 13 | +## Project Structure |
19 | 14 |
|
20 | | -In the project, you can see: |
| 15 | +### Content (`/content`) |
21 | 16 |
|
22 | | -- `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content. |
23 | | -- `app/layout.config.tsx`: Shared options for layouts, optional but preferred to keep. |
| 17 | +| Directory | Description | |
| 18 | +|-----------|-------------| |
| 19 | +| `content/docs/` | Main documentation (guides, SDK reference, components) | |
| 20 | +| `content/api/` | REST API reference documentation | |
24 | 21 |
|
25 | | -| Route | Description | |
26 | | -| ------------------------- | ------------------------------------------------------ | |
27 | | -| `app/(home)` | The route group for your landing page and other pages. | |
28 | | -| `app/docs` | The documentation layout and pages. | |
29 | | -| `app/api` | The documentation for API pages. | |
30 | | -| `app/api/search/route.ts` | The Route Handler for search. | |
| 22 | +### App Routes (`/src/app`) |
31 | 23 |
|
32 | | -### Fumadocs MDX |
| 24 | +| Route | Description | |
| 25 | +|-------|-------------| |
| 26 | +| `/docs` | Main documentation pages | |
| 27 | +| `/api` | API reference pages (rendered from OpenAPI specs) | |
| 28 | +| `/docs-embed` | Embedded docs for dashboard companion widget | |
| 29 | +| `/api-embed` | Embedded API docs for dashboard companion widget | |
| 30 | +| `/mcp-browser` | MCP documentation browser | |
| 31 | +| `/handler/[...stack]` | Stack Auth handler route | |
| 32 | +| `/api/search` | Search API endpoint | |
| 33 | +| `/api/chat` | AI documentation chat endpoint | |
| 34 | +| `/llms.txt` | LLM-friendly documentation (plain text) | |
| 35 | +| `/llms.mdx` | LLM-friendly documentation (MDX format) | |
33 | 36 |
|
34 | | -A `source.config.ts` config file has been included, you can customise different options like frontmatter schema. |
| 37 | +### SDK Route Handlers |
35 | 38 |
|
36 | | -Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details. |
| 39 | +These routes serve SDK-specific documentation: |
37 | 40 |
|
38 | | -## Learn More |
| 41 | +- `/js/[...path]` - JavaScript SDK |
| 42 | +- `/next/[...path]` - Next.js SDK |
| 43 | +- `/react/[...path]` - React SDK |
| 44 | +- `/python/[...path]` - Python SDK |
| 45 | +- `/rest-api/[...path]` - REST API |
| 46 | + |
| 47 | +### Key Files |
| 48 | + |
| 49 | +| File | Description | |
| 50 | +|------|-------------| |
| 51 | +| `lib/source.ts` | Content source adapter using Fumadocs `loader()` | |
| 52 | +| `source.config.ts` | Fumadocs MDX configuration (frontmatter schema, etc.) | |
| 53 | +| `app/layout.config.tsx` | Shared layout options | |
| 54 | +| `lib/platform-config.ts` | Platform/framework configuration for code examples | |
| 55 | + |
| 56 | +### Components (`/src/components`) |
| 57 | + |
| 58 | +| Directory | Description | |
| 59 | +|-----------|-------------| |
| 60 | +| `api/` | API playground components | |
| 61 | +| `chat/` | AI chat interface | |
| 62 | +| `layout/` | Layout UI components (search, navigation) | |
| 63 | +| `layouts/` | Page layouts (docs, API) | |
| 64 | +| `mdx/` | Custom MDX components | |
| 65 | +| `stack-auth/` | Stack Auth demo components | |
| 66 | +| `ui/` | Base UI components (button, etc.) | |
| 67 | + |
| 68 | +### OpenAPI Specs (`/openapi`) |
| 69 | + |
| 70 | +Contains OpenAPI JSON specifications organized by access level: |
| 71 | +- `client-*.json` - Client-side API endpoints |
| 72 | +- `server-*.json` - Server-side API endpoints |
| 73 | +- `admin-*.json` - Admin API endpoints |
| 74 | +- `webhooks-*.json` - Webhook event schemas |
39 | 75 |
|
40 | | -To learn more about Next.js and Fumadocs, take a look at the following |
41 | | -resources: |
| 76 | +## Scripts |
| 77 | + |
| 78 | +```bash |
| 79 | +# Generate API docs from OpenAPI specs |
| 80 | +pnpm generate-openapi-docs |
| 81 | + |
| 82 | +# Clear generated docs |
| 83 | +pnpm clear-docs |
| 84 | +``` |
| 85 | + |
| 86 | +## Learn More |
42 | 87 |
|
43 | | -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js |
44 | | - features and API. |
45 | | -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
46 | | -- [Fumadocs](https://fumadocs.dev) - learn about Fumadocs |
| 88 | +- [Fumadocs Documentation](https://fumadocs.dev) |
| 89 | +- [Next.js Documentation](https://nextjs.org/docs) |
| 90 | +- [Stack Auth Documentation](https://docs.stack-auth.com) |
0 commit comments