Skip to content

Commit 7aa1470

Browse files
M0NsTeRRR0xSysR3llgauthier-th
authored
docs: add REST API documentation (#2981)
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr> Co-authored-by: 0xsysr3ll <0xsysr3ll@pm.me> Co-authored-by: Gauthier <mail@gauthierth.fr>
1 parent cf87205 commit 7aa1470

11 files changed

Lines changed: 1750 additions & 478 deletions

File tree

.github/workflows/docs-deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
paths:
1111
- 'docs/**'
1212
- 'gen-docs/**'
13+
- 'seerr-api.yml'
1314

1415
permissions:
1516
contents: read
@@ -57,7 +58,7 @@ jobs:
5758
5859
- name: Build website
5960
working-directory: gen-docs
60-
run: pnpm build
61+
run: pnpm gen-api-docs all && pnpm build
6162

6263
- name: Upload Build Artifact
6364
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b6 # v4.0.0
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: Test Docs deployment
3+
name: Test Docs
44

55
on:
66
pull_request:
@@ -18,8 +18,8 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
test-deploy:
22-
name: Test deployment
21+
test-build:
22+
name: Test build
2323
runs-on: ubuntu-24.04
2424
permissions:
2525
contents: read

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ lcov.info
1414
# production
1515
/build
1616

17+
# ignore REST API documentation
18+
docs/api/*
19+
!docs/api/_category_.json
20+
1721
# misc
1822
.DS_Store
1923
*.pem

bin/duplicate-detector/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"type": "module",
6-
"packageManager": "pnpm@10.17.1",
6+
"packageManager": "pnpm@10.24.0",
77
"scripts": {
88
"build-index": "node build-index.mjs",
99
"detect": "node detect.mjs"

docs/api/_category_.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"label": "REST API documentation",
3+
"position": 4,
4+
"link": {
5+
"type": "generated-index",
6+
"title": "REST API documentation",
7+
"description": "Create integrations with the Seerr REST API."
8+
}
9+
}

docs/troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ If you can't change your DNS servers or force IPV4 resolution, you can use Seerr
103103

104104
In some places (like China), the ISP blocks not only the DNS resolution but also the connection to the TMDB API.
105105

106-
You can configure Seerr to use a proxy with the [HTTP(S) Proxy](/using-seerr/settings/general#enable-proxy-support) setting.
106+
You can configure Seerr to use a proxy with the [HTTP(S) Proxy](/using-seerr/settings/network#enable-proxy-support) setting.
107107

108108
### Option 3: Force IPV4 resolution first
109109

gen-docs/README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,39 @@ Seerr docs will be available at [docs.seerr.dev](https://docs.seerr.dev).
66

77
### Installation
88

9-
```
10-
$ pnpm install
9+
```bash
10+
pnpm install
1111
```
1212

1313
### Local Development
1414

15-
```
16-
$ pnpm start
15+
```bash
16+
pnpm start
1717
```
1818

1919
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
2020

2121
### Build
2222

23+
```bash
24+
pnpm build
25+
```
26+
27+
This command generates static content in the `build` directory, which can then be served using any static content hosting service.
28+
29+
### Test API Rest documentation
30+
31+
This command generates REST API documentation.
32+
33+
```bash
34+
pnpm gen-api-docs all
2335
```
24-
$ pnpm build
36+
37+
This command cleans REST API documentation.
38+
39+
```bash
40+
pnpm clean-api-docs all
2541
```
2642

27-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
43+
See [docusaurus-openapi-docs](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/tree/main#cli-usage) for more information.
44+

gen-docs/docusaurus.config.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type * as Preset from '@docusaurus/preset-classic';
22
import type { Config } from '@docusaurus/types';
3+
import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs';
34
import { themes as prismThemes } from 'prism-react-renderer';
45

56
const config: Config = {
@@ -37,6 +38,7 @@ const config: Config = {
3738
routeBasePath: '/',
3839
path: '../docs',
3940
editUrl: 'https://github.com/seerr-team/seerr/edit/develop/docs/',
41+
docItemComponent: '@theme/ApiItem',
4042
},
4143
pages: false,
4244
theme: {
@@ -46,6 +48,28 @@ const config: Config = {
4648
],
4749
],
4850

51+
plugins: [
52+
[
53+
'docusaurus-plugin-openapi-docs',
54+
{
55+
id: 'api',
56+
docsPluginId: 'classic',
57+
config: {
58+
seerr: {
59+
specPath: '../seerr-api.yml',
60+
outputDir: '../docs/api',
61+
sidebarOptions: {
62+
groupPathsBy: 'tag',
63+
},
64+
downloadUrl:
65+
'https://raw.githubusercontent.com/seerr-team/seerr/refs/heads/develop/seerr-api.yml',
66+
hideSendButton: true,
67+
} satisfies OpenApiPlugin.Options,
68+
},
69+
},
70+
],
71+
],
72+
4973
themes: [
5074
[
5175
'@easyops-cn/docusaurus-search-local',
@@ -58,6 +82,7 @@ const config: Config = {
5882
explicitSearchResultPath: true,
5983
},
6084
],
85+
'docusaurus-theme-openapi-docs',
6186
],
6287

6388
themeConfig: {

gen-docs/package.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
"name": "gen-docs",
33
"version": "0.0.0",
44
"private": true,
5-
"packageManager": "pnpm@10.17.1",
5+
"packageManager": "pnpm@10.24.0",
66
"scripts": {
77
"docusaurus": "docusaurus",
88
"start": "docusaurus start",
99
"build": "docusaurus build",
10+
"gen-api-docs": "docusaurus gen-api-docs",
11+
"clean-api-docs": "node ./scripts/clean-api-docs.cjs",
1012
"swizzle": "docusaurus swizzle",
1113
"deploy": "docusaurus deploy",
1214
"clear": "docusaurus clear",
@@ -16,21 +18,23 @@
1618
"typecheck": "tsc"
1719
},
1820
"dependencies": {
19-
"@docusaurus/core": "3.9.1",
20-
"@docusaurus/preset-classic": "3.9.1",
21-
"@easyops-cn/docusaurus-search-local": "^0.52.1",
21+
"@docusaurus/core": "3.10.1",
22+
"@docusaurus/preset-classic": "3.10.1",
23+
"@easyops-cn/docusaurus-search-local": "^0.55.1",
2224
"@mdx-js/react": "^3.0.0",
23-
"clsx": "^2.0.0",
24-
"prism-react-renderer": "^2.3.0",
25+
"clsx": "^2.1.1",
26+
"docusaurus-plugin-openapi-docs": "^5.0.1",
27+
"docusaurus-theme-openapi-docs": "^5.0.1",
28+
"prism-react-renderer": "^2.4.1",
2529
"react": "^18.0.0",
2630
"react-dom": "^18.0.0",
27-
"tailwindcss": "^3.4.4"
31+
"tailwindcss": "^3.4.19"
2832
},
2933
"devDependencies": {
30-
"@docusaurus/module-type-aliases": "3.9.1",
31-
"@docusaurus/tsconfig": "3.9.1",
32-
"@docusaurus/types": "3.9.1",
33-
"typescript": "~5.2.2"
34+
"@docusaurus/module-type-aliases": "3.10.1",
35+
"@docusaurus/tsconfig": "3.10.1",
36+
"@docusaurus/types": "3.10.1",
37+
"typescript": "~6.0.3"
3438
},
3539
"browserslist": {
3640
"production": [

0 commit comments

Comments
 (0)