docsfy 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. docsfy-1.0.0/.coderabbit.yaml +90 -0
  2. docsfy-1.0.0/.env.example +20 -0
  3. docsfy-1.0.0/.flake8 +11 -0
  4. docsfy-1.0.0/.git +1 -0
  5. docsfy-1.0.0/.gitignore +43 -0
  6. docsfy-1.0.0/.gitleaks.toml +7 -0
  7. docsfy-1.0.0/.pre-commit-config.yaml +60 -0
  8. docsfy-1.0.0/CLAUDE.md +91 -0
  9. docsfy-1.0.0/Dockerfile +122 -0
  10. docsfy-1.0.0/OWNERS +4 -0
  11. docsfy-1.0.0/PKG-INFO +25 -0
  12. docsfy-1.0.0/README.md +98 -0
  13. docsfy-1.0.0/config.toml.example +25 -0
  14. docsfy-1.0.0/docker-compose.yaml +22 -0
  15. docsfy-1.0.0/entrypoint.sh +21 -0
  16. docsfy-1.0.0/frontend/.gitignore +24 -0
  17. docsfy-1.0.0/frontend/README.md +47 -0
  18. docsfy-1.0.0/frontend/components.json +25 -0
  19. docsfy-1.0.0/frontend/eslint.config.js +23 -0
  20. docsfy-1.0.0/frontend/index.html +24 -0
  21. docsfy-1.0.0/frontend/package-lock.json +8032 -0
  22. docsfy-1.0.0/frontend/package.json +49 -0
  23. docsfy-1.0.0/frontend/public/favicon.svg +1 -0
  24. docsfy-1.0.0/frontend/public/icons.svg +24 -0
  25. docsfy-1.0.0/frontend/src/App.tsx +22 -0
  26. docsfy-1.0.0/frontend/src/components/admin/AccessPanel.tsx +237 -0
  27. docsfy-1.0.0/frontend/src/components/admin/UsersPanel.tsx +282 -0
  28. docsfy-1.0.0/frontend/src/components/layout/Layout.tsx +215 -0
  29. docsfy-1.0.0/frontend/src/components/shared/ActivityLog.tsx +98 -0
  30. docsfy-1.0.0/frontend/src/components/shared/ApiKeyDisplay.tsx +106 -0
  31. docsfy-1.0.0/frontend/src/components/shared/Combobox.tsx +147 -0
  32. docsfy-1.0.0/frontend/src/components/shared/GenerateForm.tsx +282 -0
  33. docsfy-1.0.0/frontend/src/components/shared/ModalProvider.tsx +270 -0
  34. docsfy-1.0.0/frontend/src/components/shared/ProjectTree.tsx +407 -0
  35. docsfy-1.0.0/frontend/src/components/shared/SearchInput.tsx +43 -0
  36. docsfy-1.0.0/frontend/src/components/shared/StatusDot.tsx +40 -0
  37. docsfy-1.0.0/frontend/src/components/shared/VariantDetail.tsx +665 -0
  38. docsfy-1.0.0/frontend/src/components/ui/badge.tsx +52 -0
  39. docsfy-1.0.0/frontend/src/components/ui/button.tsx +58 -0
  40. docsfy-1.0.0/frontend/src/components/ui/card.tsx +103 -0
  41. docsfy-1.0.0/frontend/src/components/ui/collapsible.tsx +21 -0
  42. docsfy-1.0.0/frontend/src/components/ui/dialog.tsx +160 -0
  43. docsfy-1.0.0/frontend/src/components/ui/input.tsx +20 -0
  44. docsfy-1.0.0/frontend/src/components/ui/label.tsx +20 -0
  45. docsfy-1.0.0/frontend/src/components/ui/progress.tsx +83 -0
  46. docsfy-1.0.0/frontend/src/components/ui/scroll-area.tsx +52 -0
  47. docsfy-1.0.0/frontend/src/components/ui/select.tsx +199 -0
  48. docsfy-1.0.0/frontend/src/components/ui/separator.tsx +23 -0
  49. docsfy-1.0.0/frontend/src/components/ui/sonner.tsx +48 -0
  50. docsfy-1.0.0/frontend/src/components/ui/table.tsx +114 -0
  51. docsfy-1.0.0/frontend/src/index.css +159 -0
  52. docsfy-1.0.0/frontend/src/lib/api.ts +60 -0
  53. docsfy-1.0.0/frontend/src/lib/constants.ts +15 -0
  54. docsfy-1.0.0/frontend/src/lib/useTheme.ts +34 -0
  55. docsfy-1.0.0/frontend/src/lib/utils.ts +6 -0
  56. docsfy-1.0.0/frontend/src/lib/websocket.ts +119 -0
  57. docsfy-1.0.0/frontend/src/main.tsx +10 -0
  58. docsfy-1.0.0/frontend/src/pages/DashboardPage.tsx +746 -0
  59. docsfy-1.0.0/frontend/src/pages/LoginPage.test.tsx +47 -0
  60. docsfy-1.0.0/frontend/src/pages/LoginPage.tsx +136 -0
  61. docsfy-1.0.0/frontend/src/test/setup.ts +1 -0
  62. docsfy-1.0.0/frontend/src/types/index.ts +141 -0
  63. docsfy-1.0.0/frontend/tsconfig.app.json +32 -0
  64. docsfy-1.0.0/frontend/tsconfig.json +13 -0
  65. docsfy-1.0.0/frontend/tsconfig.node.json +26 -0
  66. docsfy-1.0.0/frontend/vite.config.ts +34 -0
  67. docsfy-1.0.0/frontend/vitest.config.ts +15 -0
  68. docsfy-1.0.0/pypi-dist/.gitignore +1 -0
  69. docsfy-1.0.0/pyproject.toml +57 -0
  70. docsfy-1.0.0/src/docsfy/__init__.py +0 -0
  71. docsfy-1.0.0/src/docsfy/ai_client.py +21 -0
  72. docsfy-1.0.0/src/docsfy/api/__init__.py +0 -0
  73. docsfy-1.0.0/src/docsfy/api/admin.py +202 -0
  74. docsfy-1.0.0/src/docsfy/api/auth.py +167 -0
  75. docsfy-1.0.0/src/docsfy/api/projects.py +1651 -0
  76. docsfy-1.0.0/src/docsfy/api/websocket.py +320 -0
  77. docsfy-1.0.0/src/docsfy/cli/__init__.py +0 -0
  78. docsfy-1.0.0/src/docsfy/cli/admin.py +211 -0
  79. docsfy-1.0.0/src/docsfy/cli/client.py +82 -0
  80. docsfy-1.0.0/src/docsfy/cli/config_cmd.py +195 -0
  81. docsfy-1.0.0/src/docsfy/cli/formatting.py +25 -0
  82. docsfy-1.0.0/src/docsfy/cli/generate.py +241 -0
  83. docsfy-1.0.0/src/docsfy/cli/main.py +92 -0
  84. docsfy-1.0.0/src/docsfy/cli/projects.py +329 -0
  85. docsfy-1.0.0/src/docsfy/config.py +27 -0
  86. docsfy-1.0.0/src/docsfy/generator.py +479 -0
  87. docsfy-1.0.0/src/docsfy/json_parser.py +151 -0
  88. docsfy-1.0.0/src/docsfy/main.py +309 -0
  89. docsfy-1.0.0/src/docsfy/models.py +105 -0
  90. docsfy-1.0.0/src/docsfy/prompts.py +192 -0
  91. docsfy-1.0.0/src/docsfy/renderer.py +553 -0
  92. docsfy-1.0.0/src/docsfy/repository.py +219 -0
  93. docsfy-1.0.0/src/docsfy/static/callouts.js +26 -0
  94. docsfy-1.0.0/src/docsfy/static/codelabels.js +75 -0
  95. docsfy-1.0.0/src/docsfy/static/copy.js +41 -0
  96. docsfy-1.0.0/src/docsfy/static/github.js +38 -0
  97. docsfy-1.0.0/src/docsfy/static/scrollspy.js +49 -0
  98. docsfy-1.0.0/src/docsfy/static/search.js +125 -0
  99. docsfy-1.0.0/src/docsfy/static/style.css +1479 -0
  100. docsfy-1.0.0/src/docsfy/static/theme.js +22 -0
  101. docsfy-1.0.0/src/docsfy/storage.py +849 -0
  102. docsfy-1.0.0/src/docsfy/templates/_doc_base.html +100 -0
  103. docsfy-1.0.0/src/docsfy/templates/_sidebar.html +45 -0
  104. docsfy-1.0.0/src/docsfy/templates/_theme.html +28 -0
  105. docsfy-1.0.0/src/docsfy/templates/index.html +51 -0
  106. docsfy-1.0.0/src/docsfy/templates/page.html +41 -0
  107. docsfy-1.0.0/test-plans/e2e-01-auth-and-roles.md +905 -0
  108. docsfy-1.0.0/test-plans/e2e-02-generation-and-dashboard.md +640 -0
  109. docsfy-1.0.0/test-plans/e2e-03-docs-quality-and-ui.md +378 -0
  110. docsfy-1.0.0/test-plans/e2e-04-isolation-and-auth.md +401 -0
  111. docsfy-1.0.0/test-plans/e2e-05-incremental-updates.md +360 -0
  112. docsfy-1.0.0/test-plans/e2e-06-delete-and-owner.md +441 -0
  113. docsfy-1.0.0/test-plans/e2e-07-ui-components.md +519 -0
  114. docsfy-1.0.0/test-plans/e2e-08-cross-model-updates.md +340 -0
  115. docsfy-1.0.0/test-plans/e2e-09-cleanup.md +193 -0
  116. docsfy-1.0.0/test-plans/e2e-10-branch-support.md +222 -0
  117. docsfy-1.0.0/test-plans/e2e-11-websocket.md +155 -0
  118. docsfy-1.0.0/test-plans/e2e-12-cli.md +227 -0
  119. docsfy-1.0.0/test-plans/e2e-ui-test-plan.md +201 -0
  120. docsfy-1.0.0/tests/__init__.py +0 -0
  121. docsfy-1.0.0/tests/conftest.py +22 -0
  122. docsfy-1.0.0/tests/test_ai_client.py +30 -0
  123. docsfy-1.0.0/tests/test_api_admin.py +141 -0
  124. docsfy-1.0.0/tests/test_api_auth.py +373 -0
  125. docsfy-1.0.0/tests/test_api_projects.py +87 -0
  126. docsfy-1.0.0/tests/test_auth.py +938 -0
  127. docsfy-1.0.0/tests/test_cli_admin.py +291 -0
  128. docsfy-1.0.0/tests/test_cli_config.py +405 -0
  129. docsfy-1.0.0/tests/test_cli_projects.py +343 -0
  130. docsfy-1.0.0/tests/test_config.py +46 -0
  131. docsfy-1.0.0/tests/test_dashboard.py +93 -0
  132. docsfy-1.0.0/tests/test_generator.py +372 -0
  133. docsfy-1.0.0/tests/test_integration.py +249 -0
  134. docsfy-1.0.0/tests/test_json_parser.py +124 -0
  135. docsfy-1.0.0/tests/test_main.py +944 -0
  136. docsfy-1.0.0/tests/test_models.py +134 -0
  137. docsfy-1.0.0/tests/test_prompts.py +117 -0
  138. docsfy-1.0.0/tests/test_renderer.py +385 -0
  139. docsfy-1.0.0/tests/test_repository.py +420 -0
  140. docsfy-1.0.0/tests/test_storage.py +948 -0
  141. docsfy-1.0.0/tests/test_websocket.py +117 -0
  142. docsfy-1.0.0/tox.toml +7 -0
  143. docsfy-1.0.0/uv.lock +663 -0
@@ -0,0 +1,90 @@
1
+ # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2
+ # CodeRabbit AI Review Instructions
3
+ # Based on project-specific rules from CLAUDE.md
4
+
5
+ # Language for reviews
6
+ language: en-US
7
+
8
+ # Review tone and communication style (max 250 chars)
9
+ tone_instructions: "Be direct and specific. Explain WHY rules exist. Provide code examples. Distinguish critical violations from suggestions. Use severity levels: CRITICAL (blocking/security), HIGH (types/defensive), MEDIUM (style), LOW (suggestions)."
10
+
11
+ # Enable early access features
12
+ early_access: true
13
+
14
+ reviews:
15
+ # Review profile: assertive for strict enforcement
16
+ profile: assertive
17
+
18
+ # Request changes for critical violations
19
+ request_changes_workflow: true
20
+
21
+ # Review display settings
22
+ high_level_summary: true
23
+ poem: false
24
+ review_status: true
25
+ collapse_walkthrough: false
26
+
27
+ # Auto-review configuration
28
+ auto_review:
29
+ enabled: true
30
+ drafts: false
31
+ base_branches:
32
+ - main
33
+
34
+ # Enable relevant tools for Python/JavaScript project
35
+ tools:
36
+ # Python linting
37
+ ruff:
38
+ enabled: true
39
+ pylint:
40
+ enabled: true
41
+
42
+ # JavaScript linting
43
+ eslint:
44
+ enabled: true
45
+
46
+ # Shell script checking
47
+ shellcheck:
48
+ enabled: true
49
+
50
+ # YAML validation
51
+ yamllint:
52
+ enabled: true
53
+
54
+ # Security scanning
55
+ gitleaks:
56
+ enabled: true
57
+ semgrep:
58
+ enabled: true
59
+
60
+ # GitHub Actions workflow validation
61
+ actionlint:
62
+ enabled: true
63
+
64
+ # Dockerfile linting
65
+ hadolint:
66
+ enabled: true
67
+
68
+ # Knowledge base configuration
69
+ knowledge_base:
70
+ # Enable code guidelines enforcement from CLAUDE.md
71
+ code_guidelines:
72
+ enabled: true
73
+ filePatterns:
74
+ - "CLAUDE.md"
75
+
76
+ # Enable learning from repository patterns
77
+ learnings:
78
+ scope: auto
79
+
80
+ # Enable learning from issues
81
+ issues:
82
+ scope: auto
83
+
84
+ # Enable learning from pull requests
85
+ pull_requests:
86
+ scope: auto
87
+
88
+ # Chat settings
89
+ chat:
90
+ auto_reply: true
@@ -0,0 +1,20 @@
1
+ # Required: Admin password (minimum 16 characters)
2
+ ADMIN_KEY=
3
+
4
+ # AI provider and model defaults
5
+ # (pydantic_settings reads these case-insensitively)
6
+ AI_PROVIDER=cursor
7
+ AI_MODEL=gpt-5.4-xhigh-fast
8
+ AI_CLI_TIMEOUT=60
9
+
10
+ # Logging
11
+ LOG_LEVEL=INFO
12
+
13
+ # Data directory for database and generated docs
14
+ DATA_DIR=/data
15
+
16
+ # Cookie security (set to false for local HTTP development)
17
+ SECURE_COOKIES=true
18
+
19
+ # Development mode: starts Vite dev server on port 5173 alongside FastAPI
20
+ # DEV_MODE=true
docsfy-1.0.0/.flake8 ADDED
@@ -0,0 +1,11 @@
1
+ [flake8]
2
+ select=M511
3
+
4
+ exclude =
5
+ doc,
6
+ .tox,
7
+ .git,
8
+ *.yml,
9
+ Pipfile.*,
10
+ docs/*,
11
+ .cache/*
docsfy-1.0.0/.git ADDED
@@ -0,0 +1 @@
1
+ gitdir: /tmp/github-webhook-docsfy-wzaziokq/.git/worktrees/github-webhook-docsfy-wzaziokq-worktree-b648ccfc-c727-42e5-9ced-53b32db8489e
@@ -0,0 +1,43 @@
1
+ # Environment files with secrets
2
+ .env
3
+ .dev/.env
4
+ *.env.local
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.pyc
9
+ *.pyo
10
+ .venv/
11
+ *.egg-info/
12
+
13
+ # Tox
14
+ .tox/
15
+
16
+ # IDE
17
+ .idea/
18
+ .vscode/
19
+ *.swp
20
+ *.swo
21
+
22
+ # OS
23
+ .DS_Store
24
+ Thumbs.db
25
+
26
+ # Data
27
+ data/
28
+ .dev/data/
29
+
30
+ # pytest
31
+ .pytest_cache/
32
+ .coverage
33
+ htmlcov/
34
+
35
+ # Build
36
+ dist/
37
+ build/
38
+
39
+ # Frontend
40
+ frontend/node_modules/
41
+ frontend/dist/
42
+
43
+ UI-TESTS-RESULTS.md
@@ -0,0 +1,7 @@
1
+ [extend]
2
+ useDefault = true
3
+
4
+ [allowlist]
5
+ paths = [
6
+ '''tests/test_repository\.py''',
7
+ ]
@@ -0,0 +1,60 @@
1
+ ---
2
+ default_language_version:
3
+ python: python3
4
+
5
+ ci:
6
+ autofix_prs: false
7
+ autoupdate_commit_msg: "ci: [pre-commit.ci] pre-commit autoupdate"
8
+
9
+ repos:
10
+ - repo: https://github.com/pre-commit/pre-commit-hooks
11
+ rev: v6.0.0
12
+ hooks:
13
+ - id: check-added-large-files
14
+ - id: check-docstring-first
15
+ - id: check-executables-have-shebangs
16
+ - id: check-merge-conflict
17
+ - id: check-symlinks
18
+ - id: detect-private-key
19
+ - id: mixed-line-ending
20
+ - id: debug-statements
21
+ - id: trailing-whitespace
22
+ args: [--markdown-linebreak-ext=md]
23
+ - id: end-of-file-fixer
24
+ - id: check-ast
25
+ - id: check-builtin-literals
26
+ - id: check-toml
27
+
28
+ # flake8 retained for RedHatQE M511 plugin; ruff handles standard linting
29
+ - repo: https://github.com/PyCQA/flake8
30
+ rev: 7.3.0
31
+ hooks:
32
+ - id: flake8
33
+ args: [--config=.flake8]
34
+ additional_dependencies:
35
+ # Tracks main branch intentionally for latest RedHatQE flake8 plugins
36
+ [git+https://github.com/RedHatQE/flake8-plugins.git, flake8-mutable]
37
+
38
+ - repo: https://github.com/Yelp/detect-secrets
39
+ rev: v1.5.0
40
+ hooks:
41
+ - id: detect-secrets
42
+
43
+ - repo: https://github.com/astral-sh/ruff-pre-commit
44
+ rev: v0.15.6
45
+ hooks:
46
+ - id: ruff
47
+ - id: ruff-format
48
+
49
+ - repo: https://github.com/gitleaks/gitleaks
50
+ rev: v8.30.1
51
+ hooks:
52
+ - id: gitleaks
53
+
54
+ - repo: https://github.com/pre-commit/mirrors-mypy
55
+ rev: v1.19.1
56
+ hooks:
57
+ - id: mypy
58
+ exclude: (tests/)
59
+ additional_dependencies:
60
+ [types-requests, types-PyYAML, types-colorama, types-aiofiles, pydantic, types-Markdown]
docsfy-1.0.0/CLAUDE.md ADDED
@@ -0,0 +1,91 @@
1
+ # docsfy Project Rules
2
+
3
+ ## Private Data (HARD RULE)
4
+
5
+ **NEVER include private data in any file tracked by git.** This includes:
6
+ - API keys, passwords, tokens, credentials
7
+ - Internal URLs, IP addresses, hostnames
8
+ - User-specific configuration values
9
+
10
+ All secrets MUST be read from environment variables at runtime. Test plans use placeholders like `<ADMIN_KEY>`, `<TEST_USER_PASSWORD>` — never actual values.
11
+
12
+ ## Entry Points
13
+
14
+ - `docsfy` — CLI for managing projects, users, and config from the terminal
15
+ - `docsfy-server` — starts the FastAPI server (uvicorn)
16
+
17
+ ## Code Reusability (MANDATORY)
18
+
19
+ **Every element used more than once MUST be defined in ONE place and reused everywhere.**
20
+
21
+ When adding new code:
22
+ 1. Check if a shared constant, style, or function already exists (see inventory below)
23
+ 2. If it does, USE IT — do not redefine
24
+ 3. If it doesn't but will be used in 2+ places, CREATE it in the appropriate shared location
25
+ 4. Never duplicate CSS classes, constants, validators, or utility functions across files
26
+
27
+ ### Where Shared Resources Live
28
+
29
+ | Resource Type | Location | Examples |
30
+ |---|---|---|
31
+ | Python constants | `src/docsfy/models.py` | `VALID_PROVIDERS`, `DEFAULT_BRANCH`, `DOCSFY_DOCS_URL`, `DOCSFY_REPO_URL` |
32
+ | Data models | `src/docsfy/models.py` | `GenerateRequest`, `DocPlan`, `DocPage`, `NavGroup` |
33
+ | DB constants & validators | `src/docsfy/storage.py` | `VALID_STATUSES`, `VALID_ROLES`, `_validate_name()`, `_validate_owner()` |
34
+ | Git timeouts | `src/docsfy/repository.py` | `_CLONE_TIMEOUT`, `_FETCH_TIMEOUT`, `_DIFF_TIMEOUT` |
35
+ | Prompt constants | `src/docsfy/prompts.py` | `_MAX_DIFF_LENGTH`, `_PAGE_WRITING_RULES` |
36
+ | Frontend constants | `frontend/src/lib/constants.ts` | API base URL, poll intervals, toast durations |
37
+ | Frontend types | `frontend/src/types/index.ts` | `Project`, `User`, `Variant`, `AuthState` |
38
+ | Frontend API client | `frontend/src/lib/api.ts` | `fetchProjects()`, `login()`, `generateDocs()` |
39
+ | Frontend WebSocket | `frontend/src/lib/websocket.ts` | `useWebSocket()`, connection manager |
40
+ | Doc site base template | `src/docsfy/templates/_doc_base.html` | Sidebar, top bar, footer, script imports |
41
+ | CLI config | `~/.config/docsfy/config.toml` | Server URL, API key, default provider/model |
42
+
43
+ ### Rules for New CSS
44
+
45
+ - App UI styles are managed by Tailwind CSS in the React frontend (`frontend/`)
46
+ - The old `_app_styles.html` has been removed — do not recreate it
47
+ - Doc site templates (`_doc_base.html`, `index.html`, `page.html`) have their own self-contained CSS
48
+ - Use Tailwind utility classes and shadcn/ui components for all new app UI
49
+
50
+ ### Rules for New Constants
51
+
52
+ - If a value is used in 2+ files → define in `models.py` and import
53
+ - If a value is used in SQL → accepted exception (SQL DDL can't reference Python vars)
54
+ - Magic numbers → named constants in the file that owns them
55
+ - Frontend constants → define in `frontend/src/lib/constants.ts`
56
+
57
+ ### Rules for Templates
58
+
59
+ - Only doc site templates remain: `_doc_base.html`, `_sidebar.html`, `_theme.html`, `index.html`, `page.html`
60
+ - `index.html` and `page.html` extend `_doc_base.html`
61
+ - App UI (dashboard, admin, login, status) is now a React SPA in `frontend/`
62
+ - Template variables (provider list, branch, URLs) come from the backend — never hardcoded in HTML
63
+
64
+ ## Branch Support
65
+
66
+ - `branch` is a field on `GenerateRequest` (default: `"main"`)
67
+ - Branch is part of the DB primary key: `(name, branch, ai_provider, ai_model, owner)`
68
+ - URL pattern: `/{name}/{branch}/{provider}/{model}`
69
+ - Branch validation: `^[a-zA-Z0-9][a-zA-Z0-9._-]*$` — slashes are rejected because branch appears as a single FastAPI path segment and in JS split('/') parsing. Use hyphens instead (e.g., `release-1.x` instead of `release/1.x`).
70
+ - Disk path: `PROJECTS_DIR / owner / name / branch / provider / model`
71
+
72
+ ## Default AI Provider/Model
73
+
74
+ - Configured via environment variables (pydantic_settings loads environment variables which override config defaults)
75
+ - Currently: `cursor` / `gpt-5.4-xhigh-fast`
76
+ - The UI always uses server defaults for new repos — provider/model are NOT persisted in sessionStorage
77
+
78
+ ## Testing
79
+
80
+ - Run tests: `uv run pytest -v --tb=short`
81
+ - E2e test plans: `test-plans/e2e-*.md`
82
+ - Test repo: `https://github.com/myk-org/for-testing-only` (branches: `main`, `dev`)
83
+
84
+ ## E2E Test Plans
85
+
86
+ - E2e test plans live in `test-plans/e2e-*.md`
87
+ - **After ANY code change that affects the UI, API endpoints, or user-facing behavior, update or add e2e tests accordingly**
88
+ - When adding a new feature: add a new test section to the relevant e2e plan file (or create a new `e2e-XX-*.md` file)
89
+ - When modifying existing behavior: update the affected test steps, expected results, and URLs
90
+ - When changing URL patterns: update ALL e2e test files that reference those URLs
91
+ - The e2e test index is `test-plans/e2e-ui-test-plan.md` — update the Summary table when adding new tests
@@ -0,0 +1,122 @@
1
+ # Stage 1: Frontend Builder
2
+ FROM node:20-slim AS frontend-builder
3
+
4
+ WORKDIR /app/frontend
5
+
6
+ # Install dependencies first (better layer caching)
7
+ COPY frontend/package.json frontend/package-lock.json ./
8
+ RUN npm ci
9
+
10
+ # Copy full frontend directory and build
11
+ COPY frontend/ ./
12
+ RUN npm run build
13
+
14
+ # Stage 2: Python Builder
15
+ FROM python:3.12-slim AS builder
16
+
17
+ WORKDIR /app
18
+
19
+ # Install uv
20
+ COPY --from=ghcr.io/astral-sh/uv:0.5.14 /uv /usr/local/bin/uv
21
+
22
+ # Install git (needed for gitpython dependency)
23
+ RUN apt-get update && apt-get install -y --no-install-recommends \
24
+ git \
25
+ && rm -rf /var/lib/apt/lists/*
26
+
27
+ # Copy project files
28
+ COPY pyproject.toml uv.lock ./
29
+ COPY src/ src/
30
+
31
+ # Create venv and install dependencies
32
+ RUN uv sync --frozen --no-dev
33
+
34
+ # Stage 3: Runtime
35
+ FROM python:3.12-slim
36
+
37
+ WORKDIR /app
38
+
39
+ # Install bash (needed for CLI install scripts), git (required at runtime for gitpython), curl (for Claude CLI), and nodejs/npm (for Gemini CLI)
40
+ RUN apt-get update && apt-get install -y --no-install-recommends \
41
+ bash \
42
+ git \
43
+ curl \
44
+ nodejs \
45
+ npm \
46
+ && rm -rf /var/lib/apt/lists/*
47
+
48
+ # Create non-root user, data directory, and set permissions
49
+ # OpenShift runs containers as a random UID in the root group (GID 0)
50
+ RUN useradd --create-home --shell /bin/bash -g 0 appuser \
51
+ && mkdir -p /data \
52
+ && chown appuser:0 /data \
53
+ && chmod -R g+w /data
54
+
55
+ # Copy uv for runtime
56
+ COPY --from=ghcr.io/astral-sh/uv:0.5.14 /uv /usr/local/bin/uv
57
+
58
+ # Switch to non-root user for CLI installs
59
+ USER appuser
60
+
61
+ # Always fetch the latest versions of these CLI tools at build time.
62
+
63
+ # Install Claude Code CLI (installs to ~/.local/bin)
64
+ RUN /bin/bash -o pipefail -c "curl -fsSL https://claude.ai/install.sh | bash"
65
+
66
+ # Install Cursor Agent CLI (installs to ~/.local/bin)
67
+ RUN /bin/bash -o pipefail -c "curl -fsSL https://cursor.com/install | bash"
68
+
69
+ # Configure npm for non-root global installs and install Gemini CLI
70
+ RUN mkdir -p /home/appuser/.npm-global \
71
+ && npm config set prefix '/home/appuser/.npm-global' \
72
+ && npm install -g @google/gemini-cli
73
+
74
+ # Switch to root for file copies and permission fixes
75
+ USER root
76
+
77
+ # Copy the virtual environment from builder
78
+ COPY --chown=appuser:0 --from=builder /app/.venv /app/.venv
79
+
80
+ # Copy project files needed by uv
81
+ COPY --chown=appuser:0 --from=builder /app/pyproject.toml /app/uv.lock ./
82
+
83
+ # Copy source code
84
+ COPY --chown=appuser:0 --from=builder /app/src /app/src
85
+
86
+ # Copy frontend build output
87
+ COPY --chown=appuser:0 --from=frontend-builder /app/frontend/dist /app/frontend/dist
88
+
89
+ # Copy frontend package files for DEV_MODE (npm ci)
90
+ COPY --chown=appuser:0 frontend/package.json frontend/package-lock.json /app/frontend/
91
+
92
+ # Copy entrypoint script
93
+ COPY --chown=appuser:0 entrypoint.sh /app/entrypoint.sh
94
+ RUN chmod +x /app/entrypoint.sh
95
+
96
+ # Make /app group-writable for OpenShift compatibility
97
+ RUN chmod -R g+w /app
98
+
99
+ # Make appuser home accessible by OpenShift arbitrary UID
100
+ # Only chmod directories (not files) — files are already group-readable by default.
101
+ # Directories need group write+execute for OpenShift's arbitrary UID (in GID 0)
102
+ # to create config/cache files at runtime.
103
+ RUN find /home/appuser -type d -exec chmod g=u {} + \
104
+ && npm cache clean --force 2>/dev/null; \
105
+ rm -rf /home/appuser/.npm/_cacache
106
+
107
+ # Switch back to non-root user for runtime
108
+ USER appuser
109
+
110
+ # Ensure CLIs are in PATH
111
+ ENV PATH="/home/appuser/.local/bin:/home/appuser/.npm-global/bin:${PATH}"
112
+ # Set HOME for OpenShift compatibility (random UID has no passwd entry)
113
+ ENV HOME="/home/appuser"
114
+
115
+ EXPOSE 8000
116
+ # Vite dev server (DEV_MODE only)
117
+ EXPOSE 5173
118
+
119
+ HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
120
+ CMD curl -f http://localhost:8000/health || exit 1
121
+
122
+ ENTRYPOINT ["/app/entrypoint.sh"]
docsfy-1.0.0/OWNERS ADDED
@@ -0,0 +1,4 @@
1
+ approvers:
2
+ - myakove
3
+ reviewers:
4
+ - myakove
docsfy-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: docsfy
3
+ Version: 1.0.0
4
+ Summary: AI-powered documentation generator - generates polished static HTML docs from GitHub repos
5
+ Project-URL: Documentation, https://myk-org.github.io/docsfy-docs/
6
+ Project-URL: Repository, https://github.com/myk-org/docsfy
7
+ Requires-Python: >=3.12
8
+ Requires-Dist: ai-cli-runner
9
+ Requires-Dist: aiosqlite
10
+ Requires-Dist: fastapi
11
+ Requires-Dist: httpx
12
+ Requires-Dist: jinja2
13
+ Requires-Dist: markdown
14
+ Requires-Dist: pydantic-settings
15
+ Requires-Dist: pygments
16
+ Requires-Dist: python-multipart>=0.0.22
17
+ Requires-Dist: python-simple-logger
18
+ Requires-Dist: tomli-w
19
+ Requires-Dist: typer[all]
20
+ Requires-Dist: uvicorn
21
+ Requires-Dist: websockets
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest; extra == 'dev'
24
+ Requires-Dist: pytest-asyncio; extra == 'dev'
25
+ Requires-Dist: pytest-xdist; extra == 'dev'
docsfy-1.0.0/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # docsfy
2
+
3
+ AI-powered documentation generator that creates polished static HTML docs from GitHub repositories using Claude, Gemini, or Cursor CLI.
4
+
5
+ [**Documentation**](https://myk-org.github.io/docsfy-docs/) | [**GitHub**](https://github.com/myk-org/docsfy)
6
+
7
+ ## Architecture
8
+
9
+ - **React SPA** -- Single-page web UI with sidebar project tree, inline generation progress, and admin panels
10
+ - **WebSocket** -- Real-time generation progress streamed to the browser (no polling)
11
+ - **CLI** -- Full-featured `docsfy` command for scripting and terminal workflows
12
+ - **FastAPI backend** -- REST API with JWT authentication
13
+
14
+ Entry points:
15
+
16
+ | Command | Description |
17
+ |---|---|
18
+ | `docsfy` | CLI tool for generating docs, managing projects, and admin tasks |
19
+ | `docsfy-server` | Starts the FastAPI web server with the React UI |
20
+
21
+ ## Documentation
22
+
23
+ Full documentation is available at [https://myk-org.github.io/docsfy-docs/](https://myk-org.github.io/docsfy-docs/)
24
+
25
+ ## Quick Start
26
+
27
+ ### Web UI
28
+
29
+ ```bash
30
+ # Clone and configure
31
+ git clone https://github.com/myk-org/docsfy.git
32
+ cd docsfy
33
+ cp .env.example .env
34
+ # Edit .env -- set ADMIN_KEY (minimum 16 characters)
35
+
36
+ # Run
37
+ docker compose up
38
+
39
+ # Open the web UI
40
+ open http://localhost:8000 # macOS
41
+ # xdg-open http://localhost:8000 # Linux
42
+ # start http://localhost:8000 # Windows
43
+ ```
44
+
45
+ Log in with admin credentials, add a GitHub repository URL, and watch generation progress in real time via WebSocket.
46
+
47
+ ### CLI
48
+
49
+ ```bash
50
+ # Install
51
+ pip install docsfy
52
+
53
+ # Initialize CLI config
54
+ docsfy config init
55
+ # Edit ~/.config/docsfy/config.toml with server URL and credentials
56
+
57
+ # Generate docs for a repository
58
+ docsfy generate https://github.com/org/repo
59
+
60
+ # List projects
61
+ docsfy projects list
62
+
63
+ # View generation status
64
+ docsfy projects status org/repo
65
+ ```
66
+
67
+ ### API
68
+
69
+ ```bash
70
+ # Authenticate
71
+ TOKEN=$(curl -s -X POST http://localhost:8000/api/auth/login \
72
+ -H "Content-Type: application/json" \
73
+ -d '{"username": "admin", "password": "<ADMIN_KEY>"}' | jq -r .access_token)
74
+
75
+ # Generate docs
76
+ curl -X POST http://localhost:8000/api/projects \
77
+ -H "Authorization: Bearer $TOKEN" \
78
+ -H "Content-Type: application/json" \
79
+ -d '{"repo_url": "https://github.com/org/repo"}'
80
+
81
+ # List projects
82
+ curl http://localhost:8000/api/projects \
83
+ -H "Authorization: Bearer $TOKEN"
84
+ ```
85
+
86
+ ## Configuration
87
+
88
+ ### Server (.env)
89
+
90
+ See `.env.example` for all available environment variables.
91
+
92
+ ### CLI (~/.config/docsfy/config.toml)
93
+
94
+ See `config.toml.example` for the CLI configuration format.
95
+
96
+ ## License
97
+
98
+ Apache-2.0
@@ -0,0 +1,25 @@
1
+ # docsfy CLI configuration
2
+ # Copy to ~/.config/docsfy/config.toml or run: docsfy config init
3
+ #
4
+ # SECURITY: This file contains passwords. Keep it private:
5
+ # chmod 600 ~/.config/docsfy/config.toml
6
+
7
+ # Default server to use when --server is not specified
8
+ [default]
9
+ server = "dev"
10
+
11
+ # Server profiles -- add as many as you need
12
+ [servers.dev]
13
+ url = "http://localhost:8000"
14
+ username = "admin"
15
+ password = "<your-dev-key>"
16
+
17
+ [servers.prod]
18
+ url = "https://docsfy.example.com"
19
+ username = "admin"
20
+ password = "<your-prod-key>"
21
+
22
+ [servers.staging]
23
+ url = "https://staging.docsfy.example.com"
24
+ username = "deployer"
25
+ password = "<your-staging-key>"
@@ -0,0 +1,22 @@
1
+ services:
2
+ docsfy:
3
+ build:
4
+ context: .
5
+ dockerfile: Dockerfile
6
+ ports:
7
+ - "8000:8000"
8
+ # Uncomment for development (DEV_MODE=true)
9
+ # - "5173:5173"
10
+ volumes:
11
+ - ./data:/data
12
+ # Uncomment for development (hot reload)
13
+ # - ./frontend:/app/frontend
14
+ env_file:
15
+ - .env
16
+ environment:
17
+ # WARNING: ADMIN_KEY must be set in your .env file or shell environment.
18
+ # An empty ADMIN_KEY will cause the application to reject all admin requests.
19
+ - ADMIN_KEY=${ADMIN_KEY}
20
+ # Uncomment for development
21
+ # - DEV_MODE=true
22
+ restart: unless-stopped
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ if [ "$DEV_MODE" = "true" ]; then
5
+ echo "DEV_MODE enabled - installing frontend dependencies..."
6
+ cd /app/frontend || exit 1
7
+ npm ci
8
+ echo "Starting Vite dev server on port 5173..."
9
+ npm run dev &
10
+ VITE_PID=$!
11
+ # Forward signals to the background Vite process for clean shutdown
12
+ trap 'kill $VITE_PID 2>/dev/null; wait $VITE_PID 2>/dev/null' SIGTERM SIGINT
13
+ cd /app
14
+ echo "Starting FastAPI with hot reload on port 8000..."
15
+ uv run --no-sync uvicorn docsfy.main:app \
16
+ --host 0.0.0.0 --port 8000 \
17
+ --reload --reload-dir /app/src
18
+ else
19
+ exec uv run --no-sync uvicorn docsfy.main:app \
20
+ --host 0.0.0.0 --port 8000
21
+ fi
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?