@ripla/godd-mcp 1.0.4-canary.9 → 1.0.4

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 (348) hide show
  1. package/README.md +89 -94
  2. package/dist/godd.cjs +349 -233
  3. package/dist/godd.js +2193 -838
  4. package/dist/index.js +152 -122
  5. package/{notes-api → notes/api}/.env.example +6 -1
  6. package/{notes-api → notes/api}/README.md +6 -5
  7. package/{notes-api → notes/api}/app/main.py +29 -2
  8. package/{notes-api → notes/api}/app/routers/auth.py +6 -1
  9. package/{notes-api → notes/api}/app/routers/issues.py +157 -1
  10. package/{notes-api → notes/api}/app/routers/pr.py +2 -2
  11. package/{notes-api → notes/api}/app/services/github_app_token.py +32 -1
  12. package/{notes-api → notes/api}/app/services/github_issues.py +101 -11
  13. package/{notes-api → notes/api}/app/services/github_pr.py +6 -1
  14. package/{notes-api → notes/api}/tests/test_github_app_token.py +49 -1
  15. package/{notes-api → notes/api}/tests/test_github_service.py +42 -0
  16. package/notes/api/tests/test_health.py +52 -0
  17. package/{notes-api → notes/api}/tests/test_issues.py +216 -0
  18. package/{notes-api → notes/api}/tests/test_pr.py +24 -0
  19. package/{notes-api → notes/api}/tests/test_pr_chain.py +19 -0
  20. package/{notes-api → notes/api}/uv.lock +178 -2
  21. package/notes/app/DESIGN.md +273 -0
  22. package/{notes-app → notes/app}/README.md +4 -1
  23. package/notes/app/docker/Dockerfile.e2e +19 -0
  24. package/notes/app/docker/Dockerfile.prod +15 -0
  25. package/notes/app/docker/Dockerfile.test +17 -0
  26. package/notes/app/e2e/file-tree.spec.ts +26 -0
  27. package/notes/app/e2e/file-view.spec.ts +25 -0
  28. package/notes/app/e2e/fixtures.ts +28 -0
  29. package/{notes-app → notes/app}/e2e/global-setup.ts +5 -7
  30. package/notes/app/e2e/login.spec.ts +25 -0
  31. package/notes/app/e2e/pages/login-page.ts +29 -0
  32. package/notes/app/e2e/pages/main-page.ts +29 -0
  33. package/notes/app/e2e/panel-resize-handle.spec.ts +213 -0
  34. package/{notes-app → notes/app}/eslint.config.js +9 -0
  35. package/{notes-app → notes/app}/package.json +0 -3
  36. package/{notes-app → notes/app}/pnpm-workspace.yaml +1 -0
  37. package/notes/app/src/components/CommentPanel.test.tsx +194 -0
  38. package/{notes-app → notes/app}/src/components/CommentPanel.tsx +119 -10
  39. package/notes/app/src/components/CommentSelectionPopover.tsx +26 -0
  40. package/notes/app/src/components/EditToolbar.test.tsx +102 -0
  41. package/{notes-app → notes/app}/src/components/EditToolbar.tsx +5 -54
  42. package/notes/app/src/components/FileInfoPanel.branch-tab.test.tsx +250 -0
  43. package/notes/app/src/components/FileInfoPanel.history-tab.test.tsx +146 -0
  44. package/notes/app/src/components/FileInfoPanel.test.tsx +101 -0
  45. package/{notes-app → notes/app}/src/components/FileInfoPanel.tsx +135 -20
  46. package/notes/app/src/components/IssueCommentThread.test.tsx +93 -0
  47. package/notes/app/src/components/IssueCommentThread.tsx +156 -0
  48. package/notes/app/src/components/IssueDetailView.test.tsx +1118 -0
  49. package/notes/app/src/components/IssueDetailView.tsx +476 -0
  50. package/notes/app/src/components/IssueList.test.tsx +545 -0
  51. package/notes/app/src/components/IssueList.tsx +374 -0
  52. package/{notes-app → notes/app}/src/components/LabelSelector.test.tsx +94 -8
  53. package/notes/app/src/components/LabelSelector.tsx +452 -0
  54. package/{notes-app → notes/app}/src/components/MarkdownEditor.tsx +140 -2
  55. package/notes/app/src/components/PanelResizeHandle.test.tsx +481 -0
  56. package/notes/app/src/components/PanelResizeHandle.tsx +96 -0
  57. package/{notes-app → notes/app}/src/hooks/useEditSession.test.ts +171 -23
  58. package/{notes-app → notes/app}/src/hooks/useEditSession.ts +49 -62
  59. package/notes/app/src/hooks/useMdUpLayout.test.ts +10 -0
  60. package/notes/app/src/hooks/useMdUpLayout.ts +27 -0
  61. package/notes/app/src/hooks/usePeriodicSync.test.ts +244 -0
  62. package/notes/app/src/hooks/usePeriodicSync.ts +83 -0
  63. package/notes/app/src/hooks/useResizablePanelWidth.test.ts +251 -0
  64. package/notes/app/src/hooks/useResizablePanelWidth.ts +167 -0
  65. package/{notes-app → notes/app}/src/lib/api.test.ts +81 -1
  66. package/{notes-app → notes/app}/src/lib/api.ts +98 -4
  67. package/notes/app/src/lib/commentAnchor.test.ts +22 -0
  68. package/notes/app/src/lib/commentAnchor.ts +28 -0
  69. package/notes/app/src/lib/commentHighlight.test.ts +110 -0
  70. package/notes/app/src/lib/commentHighlight.ts +44 -0
  71. package/notes/app/src/lib/github-sync.test.ts +126 -0
  72. package/notes/app/src/lib/github-sync.ts +89 -0
  73. package/notes/app/src/lib/issue-list-utils.test.ts +275 -0
  74. package/notes/app/src/lib/issue-list-utils.ts +135 -0
  75. package/notes/app/src/lib/issue-mobile-layout.test.ts +17 -0
  76. package/notes/app/src/lib/issue-mobile-layout.ts +20 -0
  77. package/notes/app/src/lib/issue-url-sync.test.ts +73 -0
  78. package/notes/app/src/lib/issue-url-sync.ts +43 -0
  79. package/notes/app/src/lib/main-page-default-view.test.ts +37 -0
  80. package/notes/app/src/lib/main-page-default-view.ts +15 -0
  81. package/notes/app/src/lib/resizable-panel.test.ts +199 -0
  82. package/notes/app/src/lib/resizable-panel.ts +136 -0
  83. package/notes/app/src/pages/LoginPage.test.tsx +17 -0
  84. package/notes/app/src/pages/MainPage.branch-modal.test.tsx +226 -0
  85. package/notes/app/src/pages/MainPage.issue-sync.test.tsx +145 -0
  86. package/notes/app/src/pages/MainPage.sidebar.test.tsx +361 -0
  87. package/{notes-app → notes/app}/src/pages/MainPage.tsx +406 -61
  88. package/{notes-app → notes/app}/src/pages/SettingsPage.test.tsx +32 -23
  89. package/{notes-app → notes/app}/src/pages/UserManagementPage.test.tsx +8 -18
  90. package/notes/app/src/test/mocks.ts +156 -0
  91. package/notes/app/src/test/render.tsx +27 -0
  92. package/package.json +3 -5
  93. package/notes-api/tests/test_health.py +0 -11
  94. package/notes-app/docker/Dockerfile.e2e +0 -14
  95. package/notes-app/docker/Dockerfile.prod +0 -12
  96. package/notes-app/docker/Dockerfile.test +0 -12
  97. package/notes-app/e2e/file-tree.spec.ts +0 -29
  98. package/notes-app/e2e/file-view.spec.ts +0 -24
  99. package/notes-app/e2e/login.spec.ts +0 -32
  100. package/notes-app/src/components/IssueDetailView.test.tsx +0 -201
  101. package/notes-app/src/components/IssueDetailView.tsx +0 -318
  102. package/notes-app/src/components/IssueList.test.tsx +0 -93
  103. package/notes-app/src/components/IssueList.tsx +0 -169
  104. package/notes-app/src/components/LabelSelector.tsx +0 -276
  105. package/notes-app/src/pages/LoginPage.test.tsx +0 -29
  106. package/stacks/django-vue.yaml +0 -33
  107. package/stacks/fastapi-react.yaml +0 -160
  108. package/stacks/flutter-firebase.yaml +0 -58
  109. package/stacks/nextjs-prisma.yaml +0 -33
  110. package/stacks/schema.json +0 -144
  111. package/templates/agents/architect.hbs +0 -183
  112. package/templates/agents/auto-documenter.hbs +0 -36
  113. package/templates/agents/backend-developer.hbs +0 -175
  114. package/templates/agents/code-reviewer.hbs +0 -29
  115. package/templates/agents/database-developer.hbs +0 -52
  116. package/templates/agents/debug-specialist.hbs +0 -39
  117. package/templates/agents/environment-setup.hbs +0 -41
  118. package/templates/agents/frontend-developer.hbs +0 -45
  119. package/templates/agents/integration-qa.hbs +0 -26
  120. package/templates/agents/performance-qa.hbs +0 -24
  121. package/templates/agents/pr-writer.hbs +0 -53
  122. package/templates/agents/quality-lead.hbs +0 -26
  123. package/templates/agents/requirements-analyst.hbs +0 -26
  124. package/templates/agents/security-analyst.hbs +0 -21
  125. package/templates/agents/security-reviewer.hbs +0 -20
  126. package/templates/agents/ssot-updater.hbs +0 -45
  127. package/templates/agents/technical-writer.hbs +0 -28
  128. package/templates/agents/unit-test-engineer.hbs +0 -19
  129. package/templates/agents/user-clone.hbs +0 -49
  130. package/templates/github-actions/aws/deploy-notes.yml.hbs +0 -117
  131. package/templates/github-actions/azure/deploy-notes.yml.hbs +0 -78
  132. package/templates/github-actions/gcp/deploy-notes.yml.hbs +0 -76
  133. package/templates/github-actions/vercel-railway/deploy-notes.yml.hbs +0 -49
  134. package/templates/mindsets/agent-stdio.hbs +0 -51
  135. package/templates/mindsets/dart.hbs +0 -39
  136. package/templates/mindsets/ddd-clean-architecture.hbs +0 -52
  137. package/templates/mindsets/electron.hbs +0 -41
  138. package/templates/mindsets/fastapi.hbs +0 -40
  139. package/templates/mindsets/flutter.hbs +0 -56
  140. package/templates/mindsets/kotlin.hbs +0 -46
  141. package/templates/mindsets/postgresql.hbs +0 -39
  142. package/templates/mindsets/python.hbs +0 -39
  143. package/templates/mindsets/react.hbs +0 -51
  144. package/templates/mindsets/swift.hbs +0 -46
  145. package/templates/mindsets/terraform.hbs +0 -53
  146. package/templates/mindsets/typescript.hbs +0 -34
  147. package/templates/mindsets/vite.hbs +0 -37
  148. package/templates/notes-compose.yml +0 -82
  149. package/templates/partials/cogito-geo.hbs +0 -84
  150. package/templates/partials/cogito-godd.hbs +0 -22
  151. package/templates/partials/cogito-grammar.hbs +0 -105
  152. package/templates/partials/cogito-particle.hbs +0 -76
  153. package/templates/partials/cogito-root-ai.hbs +0 -79
  154. package/templates/partials/cogito-root-arch.hbs +0 -75
  155. package/templates/partials/cogito-root-core.hbs +0 -75
  156. package/templates/partials/cogito-root-daily.hbs +0 -58
  157. package/templates/partials/cogito-root-dev.hbs +0 -71
  158. package/templates/partials/cogito-root-devops.hbs +0 -71
  159. package/templates/partials/cogito-root-framework.hbs +0 -80
  160. package/templates/partials/cogito-root-lang.hbs +0 -74
  161. package/templates/partials/godd-core.hbs +0 -50
  162. package/templates/partials/project-context.hbs +0 -52
  163. package/templates/partials/ssot-header.hbs +0 -40
  164. package/templates/partials/ssot-rules.hbs +0 -30
  165. package/templates/prompts/adr.hbs +0 -39
  166. package/templates/prompts/agent-dev-workflow.hbs +0 -34
  167. package/templates/prompts/analyze-report.hbs +0 -36
  168. package/templates/prompts/auto-documentation.hbs +0 -37
  169. package/templates/prompts/check.hbs +0 -52
  170. package/templates/prompts/commit.hbs +0 -96
  171. package/templates/prompts/dev.hbs +0 -127
  172. package/templates/prompts/docs-init.hbs +0 -101
  173. package/templates/prompts/docs-update.hbs +0 -51
  174. package/templates/prompts/git-workflow.hbs +0 -125
  175. package/templates/prompts/impact-analysis.hbs +0 -43
  176. package/templates/prompts/install.hbs +0 -40
  177. package/templates/prompts/new-branch.hbs +0 -61
  178. package/templates/prompts/notes-deploy.hbs +0 -138
  179. package/templates/prompts/pr-analyze.hbs +0 -44
  180. package/templates/prompts/pr-create.hbs +0 -125
  181. package/templates/prompts/push-execute.hbs +0 -83
  182. package/templates/prompts/push.hbs +0 -24
  183. package/templates/prompts/release-notes.hbs +0 -38
  184. package/templates/prompts/requirements-to-business-flow.hbs +0 -29
  185. package/templates/prompts/requirements-to-tickets.hbs +0 -26
  186. package/templates/prompts/review.hbs +0 -126
  187. package/templates/prompts/setup.hbs +0 -247
  188. package/templates/prompts/spec.hbs +0 -35
  189. package/templates/prompts/specification-to-tickets.hbs +0 -24
  190. package/templates/prompts/submit.hbs +0 -143
  191. package/templates/prompts/sync.hbs +0 -63
  192. package/templates/prompts/test-plan.hbs +0 -56
  193. package/templates/scripts/aws/terraform-backend-setup.sh.hbs +0 -149
  194. package/templates/terraform/aws/alb.tf.hbs +0 -58
  195. package/templates/terraform/aws/backend.tf.hbs +0 -10
  196. package/templates/terraform/aws/cloudfront.tf.hbs +0 -96
  197. package/templates/terraform/aws/ecr.tf.hbs +0 -30
  198. package/templates/terraform/aws/ecs.tf.hbs +0 -142
  199. package/templates/terraform/aws/iam.tf.hbs +0 -88
  200. package/templates/terraform/aws/local.tf.hbs +0 -34
  201. package/templates/terraform/aws/output.tf.hbs +0 -49
  202. package/templates/terraform/aws/provider.tf.hbs +0 -26
  203. package/templates/terraform/aws/rds.tf.hbs +0 -38
  204. package/templates/terraform/aws/s3.tf.hbs +0 -34
  205. package/templates/terraform/aws/secrets.tf.hbs +0 -53
  206. package/templates/terraform/aws/security_groups.tf.hbs +0 -81
  207. package/templates/terraform/aws/vpc.tf.hbs +0 -63
  208. package/templates/terraform/azure/backend.tf.hbs +0 -8
  209. package/templates/terraform/azure/iam.tf.hbs +0 -36
  210. package/templates/terraform/azure/main.tf.hbs +0 -203
  211. package/templates/terraform/azure/output.tf.hbs +0 -19
  212. package/templates/terraform/azure/provider.tf.hbs +0 -19
  213. package/templates/terraform/gcp/backend.tf.hbs +0 -6
  214. package/templates/terraform/gcp/iam.tf.hbs +0 -47
  215. package/templates/terraform/gcp/main.tf.hbs +0 -175
  216. package/templates/terraform/gcp/output.tf.hbs +0 -15
  217. package/templates/terraform/gcp/provider.tf.hbs +0 -19
  218. package/templates/terraform/vercel-railway/main.tf.hbs +0 -64
  219. package/templates/terraform/vercel-railway/output.tf.hbs +0 -11
  220. /package/{notes-api → notes/api}/.dockerignore +0 -0
  221. /package/{notes-api → notes/api}/alembic/README +0 -0
  222. /package/{notes-api → notes/api}/alembic/env.py +0 -0
  223. /package/{notes-api → notes/api}/alembic/script.py.mako +0 -0
  224. /package/{notes-api → notes/api}/alembic/versions/001_initial_notes_tables.py +0 -0
  225. /package/{notes-api → notes/api}/alembic/versions/002_add_performance_indexes.py +0 -0
  226. /package/{notes-api → notes/api}/alembic/versions/003_add_yjs_documents.py +0 -0
  227. /package/{notes-api → notes/api}/alembic/versions/004_add_comments.py +0 -0
  228. /package/{notes-api → notes/api}/alembic/versions/005_add_github_username.py +0 -0
  229. /package/{notes-api → notes/api}/alembic/versions/006_add_check_constraints.py +0 -0
  230. /package/{notes-api → notes/api}/alembic.ini +0 -0
  231. /package/{notes-api → notes/api}/app/__init__.py +0 -0
  232. /package/{notes-api → notes/api}/app/config.py +0 -0
  233. /package/{notes-api → notes/api}/app/database.py +0 -0
  234. /package/{notes-api → notes/api}/app/http_client.py +0 -0
  235. /package/{notes-api → notes/api}/app/models/__init__.py +0 -0
  236. /package/{notes-api → notes/api}/app/models/audit.py +0 -0
  237. /package/{notes-api → notes/api}/app/models/base.py +0 -0
  238. /package/{notes-api → notes/api}/app/models/collab.py +0 -0
  239. /package/{notes-api → notes/api}/app/models/comment.py +0 -0
  240. /package/{notes-api → notes/api}/app/models/session.py +0 -0
  241. /package/{notes-api → notes/api}/app/models/setting.py +0 -0
  242. /package/{notes-api → notes/api}/app/models/user.py +0 -0
  243. /package/{notes-api → notes/api}/app/path_validation.py +0 -0
  244. /package/{notes-api → notes/api}/app/routers/__init__.py +0 -0
  245. /package/{notes-api → notes/api}/app/routers/collab.py +0 -0
  246. /package/{notes-api → notes/api}/app/routers/comments.py +0 -0
  247. /package/{notes-api → notes/api}/app/routers/files.py +0 -0
  248. /package/{notes-api → notes/api}/app/routers/settings.py +0 -0
  249. /package/{notes-api → notes/api}/app/routers/tree.py +0 -0
  250. /package/{notes-api → notes/api}/app/routers/upload.py +0 -0
  251. /package/{notes-api → notes/api}/app/routers/users.py +0 -0
  252. /package/{notes-api → notes/api}/app/schemas/__init__.py +0 -0
  253. /package/{notes-api → notes/api}/app/schemas/auth.py +0 -0
  254. /package/{notes-api → notes/api}/app/schemas/user.py +0 -0
  255. /package/{notes-api → notes/api}/app/security.py +0 -0
  256. /package/{notes-api → notes/api}/app/services/__init__.py +0 -0
  257. /package/{notes-api → notes/api}/app/services/audit.py +0 -0
  258. /package/{notes-api → notes/api}/app/services/business_date.py +0 -0
  259. /package/{notes-api → notes/api}/app/services/collab.py +0 -0
  260. /package/{notes-api → notes/api}/app/services/github.py +0 -0
  261. /package/{notes-api → notes/api}/app/services/pr_chain.py +0 -0
  262. /package/{notes-api → notes/api}/app/startup.py +0 -0
  263. /package/{notes-api → notes/api}/docker/Dockerfile +0 -0
  264. /package/{notes-api → notes/api}/docker/Dockerfile.test +0 -0
  265. /package/{notes-api → notes/api}/pyproject.toml +0 -0
  266. /package/{notes-api → notes/api}/tests/conftest.py +0 -0
  267. /package/{notes-api → notes/api}/tests/test_audit.py +0 -0
  268. /package/{notes-api → notes/api}/tests/test_auth.py +0 -0
  269. /package/{notes-api → notes/api}/tests/test_business_date.py +0 -0
  270. /package/{notes-api → notes/api}/tests/test_collab.py +0 -0
  271. /package/{notes-api → notes/api}/tests/test_comments.py +0 -0
  272. /package/{notes-api → notes/api}/tests/test_config_ssl.py +0 -0
  273. /package/{notes-api → notes/api}/tests/test_config_warnings.py +0 -0
  274. /package/{notes-api → notes/api}/tests/test_files.py +0 -0
  275. /package/{notes-api → notes/api}/tests/test_path_validation.py +0 -0
  276. /package/{notes-api → notes/api}/tests/test_security.py +0 -0
  277. /package/{notes-api → notes/api}/tests/test_settings.py +0 -0
  278. /package/{notes-api → notes/api}/tests/test_tree.py +0 -0
  279. /package/{notes-api → notes/api}/tests/test_upload.py +0 -0
  280. /package/{notes-api → notes/api}/tests/test_users.py +0 -0
  281. /package/{notes-app → notes/app}/.dockerignore +0 -0
  282. /package/{notes-app → notes/app}/index.html +0 -0
  283. /package/{notes-app → notes/app}/nginx.conf +0 -0
  284. /package/{notes-app → notes/app}/package-lock.json +0 -0
  285. /package/{notes-app → notes/app}/playwright.config.ts +0 -0
  286. /package/{notes-app → notes/app}/pnpm-lock.yaml +0 -0
  287. /package/{notes-app → notes/app}/src/App.tsx +0 -0
  288. /package/{notes-app → notes/app}/src/components/BranchSelectorModal.tsx +0 -0
  289. /package/{notes-app → notes/app}/src/components/CodeBlockView.test.tsx +0 -0
  290. /package/{notes-app → notes/app}/src/components/CodeBlockView.tsx +0 -0
  291. /package/{notes-app → notes/app}/src/components/CollabStatus.tsx +0 -0
  292. /package/{notes-app → notes/app}/src/components/DiffPreview.tsx +0 -0
  293. /package/{notes-app → notes/app}/src/components/DrawioEditor.tsx +0 -0
  294. /package/{notes-app → notes/app}/src/components/DrawioViewer.tsx +0 -0
  295. /package/{notes-app → notes/app}/src/components/ErrorBoundary.test.tsx +0 -0
  296. /package/{notes-app → notes/app}/src/components/ErrorBoundary.tsx +0 -0
  297. /package/{notes-app → notes/app}/src/components/FileContentView.tsx +0 -0
  298. /package/{notes-app → notes/app}/src/components/FileContextMenu.test.tsx +0 -0
  299. /package/{notes-app → notes/app}/src/components/FileContextMenu.tsx +0 -0
  300. /package/{notes-app → notes/app}/src/components/FileDialogs.test.tsx +0 -0
  301. /package/{notes-app → notes/app}/src/components/FileDialogs.tsx +0 -0
  302. /package/{notes-app → notes/app}/src/components/SaveStatusIndicator.test.tsx +0 -0
  303. /package/{notes-app → notes/app}/src/components/SaveStatusIndicator.tsx +0 -0
  304. /package/{notes-app → notes/app}/src/components/Skeleton.tsx +0 -0
  305. /package/{notes-app → notes/app}/src/components/SpreadsheetEditor.test.tsx +0 -0
  306. /package/{notes-app → notes/app}/src/components/SpreadsheetEditor.tsx +0 -0
  307. /package/{notes-app → notes/app}/src/components/TextEditor.tsx +0 -0
  308. /package/{notes-app → notes/app}/src/components/ToastContainer.tsx +0 -0
  309. /package/{notes-app → notes/app}/src/components/TreeNode.tsx +0 -0
  310. /package/{notes-app → notes/app}/src/contexts/AuthContext.test.tsx +0 -0
  311. /package/{notes-app → notes/app}/src/contexts/AuthContext.tsx +0 -0
  312. /package/{notes-app → notes/app}/src/contexts/ToastContext.test.ts +0 -0
  313. /package/{notes-app → notes/app}/src/contexts/ToastContext.tsx +0 -0
  314. /package/{notes-app → notes/app}/src/hooks/useAutoSave.test.ts +0 -0
  315. /package/{notes-app → notes/app}/src/hooks/useAutoSave.ts +0 -0
  316. /package/{notes-app → notes/app}/src/hooks/useCollaboration.ts +0 -0
  317. /package/{notes-app → notes/app}/src/hooks/useComments.ts +0 -0
  318. /package/{notes-app → notes/app}/src/hooks/useYText.ts +0 -0
  319. /package/{notes-app → notes/app}/src/lib/branch-diff.test.ts +0 -0
  320. /package/{notes-app → notes/app}/src/lib/branch-diff.ts +0 -0
  321. /package/{notes-app → notes/app}/src/lib/created-file.test.ts +0 -0
  322. /package/{notes-app → notes/app}/src/lib/created-file.ts +0 -0
  323. /package/{notes-app → notes/app}/src/lib/csv-utils.test.ts +0 -0
  324. /package/{notes-app → notes/app}/src/lib/csv-utils.ts +0 -0
  325. /package/{notes-app → notes/app}/src/lib/deepLinkPathToSearch.test.ts +0 -0
  326. /package/{notes-app → notes/app}/src/lib/deepLinkPathToSearch.ts +0 -0
  327. /package/{notes-app → notes/app}/src/lib/draft-storage.test.ts +0 -0
  328. /package/{notes-app → notes/app}/src/lib/draft-storage.ts +0 -0
  329. /package/{notes-app → notes/app}/src/lib/mermaid-render.ts +0 -0
  330. /package/{notes-app → notes/app}/src/lib/postLoginRedirect.test.ts +0 -0
  331. /package/{notes-app → notes/app}/src/lib/postLoginRedirect.ts +0 -0
  332. /package/{notes-app → notes/app}/src/lib/tree-utils.ts +0 -0
  333. /package/{notes-app → notes/app}/src/lib/user-colors.ts +0 -0
  334. /package/{notes-app → notes/app}/src/lib/xlsx-utils.test.ts +0 -0
  335. /package/{notes-app → notes/app}/src/lib/xlsx-utils.ts +0 -0
  336. /package/{notes-app → notes/app}/src/main.tsx +0 -0
  337. /package/{notes-app → notes/app}/src/pages/LoginPage.tsx +0 -0
  338. /package/{notes-app → notes/app}/src/pages/MainPage.insertChildEntry.test.ts +0 -0
  339. /package/{notes-app → notes/app}/src/pages/SettingsPage.tsx +0 -0
  340. /package/{notes-app → notes/app}/src/pages/UserManagementPage.tsx +0 -0
  341. /package/{notes-app → notes/app}/src/styles/globals.css +0 -0
  342. /package/{notes-app → notes/app}/src/types.ts +0 -0
  343. /package/{notes-app → notes/app}/src/vite-env.d.ts +0 -0
  344. /package/{notes-app → notes/app}/tsconfig.json +0 -0
  345. /package/{notes-app → notes/app}/tsconfig.node.json +0 -0
  346. /package/{notes-app → notes/app}/vite.config.js +0 -0
  347. /package/{notes-app → notes/app}/vite.config.ts +0 -0
  348. /package/{notes-app → notes/app}/vitest.config.ts +0 -0
@@ -1,63 +0,0 @@
1
- {{> ssot-header }}
2
-
3
- {{> godd-core }}
4
-
5
- {{> ssot-rules }}
6
-
7
- {{> project-context }}
8
-
9
- {{> cogito-grammar }}
10
- {{> cogito-root-core }}
11
- {{> cogito-particle }}
12
- {{> cogito-godd }}
13
- {{> cogito-root-dev }}
14
-
15
- ## Purpose
16
- Sync the current working branch with the latest changes from the default branch (main). Resolve merge conflicts if they occur — the Agent handles everything up to and including conflict resolution.
17
-
18
- ## Prerequisites
19
- - Default branch: `main` (`origin/main`)
20
- - Sync method: **merge** (preserves history so conflict resolution context is visible during review)
21
-
22
- ## Agent Steps (MUST)
23
-
24
- ### Step 1: Pre-check
25
- 1. Run `git status` to check for uncommitted changes
26
- - **If uncommitted changes exist**: Run `git stash --include-untracked` to stash them (restore in Step 5)
27
- - **If clean**: Proceed
28
- 2. Record the current branch name via `git branch --show-current`
29
-
30
- ### Step 2: Fetch Remote Latest
31
- 1. Run `git fetch origin main`
32
- 2. Check diff with `git log --oneline HEAD..origin/main`
33
- - **If no diff**: Report "Already up to date" and exit (restore stash if applicable)
34
-
35
- ### Step 3: Merge
36
- 1. Run `git merge origin/main`
37
- 2. Check result:
38
- - **Success (Fast-forward / Auto-merge)**: Go to Step 5
39
- - **Conflict**: Go to Step 4
40
-
41
- ### Step 4: Conflict Resolution (only if conflicts occur)
42
- 1. List conflicted files with `git diff --name-only --diff-filter=U`
43
- 2. Read each conflicted file and identify conflict markers (`<<<<<<<` / `=======` / `>>>>>>>`)
44
- 3. **Resolution policy (priority order)**:
45
- 1. **Keep the SSOT-compliant side**: If one side adheres to SSOT (`docs/003_requirements/spec/`, `.github/agents/user-clone.agent.md`, etc.) and the other diverges, **adopt the compliant side**
46
- 2. **Both SSOT-compliant and integrable**: If both sides comply with SSOT and can be functionally integrated, **integrate both**
47
- 3. **Both compliant but integration difficult / uncertain**: If safe integration is not possible, **ask the user** (never guess)
48
- 4. After resolving all conflicts:
49
- - `git add <resolved files>` to stage
50
- - `git commit` to complete the merge commit (use Git's default message)
51
- 5. Report resolution details (which files, what was chosen)
52
-
53
- ### Step 5: Restore Stash (only if stashed)
54
- 1. Run `git stash pop` to restore stashed changes
55
- 2. If stash pop causes conflicts:
56
- - Resolve using the same policy and report
57
-
58
- ## Output
59
- - **Sync result**: Success / Conflicts resolved / Already up to date
60
- - **Commits synced**: Number of commits from `origin/main`
61
- - **Conflict resolution details** (if applicable): File names and resolution policy applied
62
- - **Stash restore result** (if applicable): Success / Conflicts
63
- - **Current branch state**: `git log --oneline -5`
@@ -1,56 +0,0 @@
1
- {{> ssot-header }}
2
-
3
- {{> godd-core }}
4
-
5
- {{> ssot-rules }}
6
-
7
- {{> project-context }}
8
-
9
- {{> cogito-grammar }}
10
- {{> cogito-root-core }}
11
- {{> cogito-particle }}
12
- {{> cogito-godd }}
13
- {{> cogito-root-dev }}
14
-
15
- ## Purpose
16
- Create a test plan that keeps implementation and verification in sync.
17
- Follow ATDD principles: define what "done" looks like through tests before implementation.
18
-
19
- ## Input
20
- - Change details (spec / implementation diff)
21
- - Likely failure points (boundary values / error cases)
22
-
23
- ## Test Plan Structure
24
-
25
- ### 1. Acceptance Criteria
26
- Define in **Given-When-Then** format:
27
- ```
28
- Given [precondition: initial system state]
29
- When [action/event: user or system behavior]
30
- Then [expected result: verifiable outcome]
31
- ```
32
-
33
- ### 2. Test Layers
34
- Indicate which layers are needed with rationale:
35
-
36
- | Layer | When to Use | Priority |
37
- |-------|------------|----------|
38
- | **Unit** | Domain logic, business rules, pure functions | Highest — always write these |
39
- | **Integration** | API boundaries, DB queries, external service calls | Write for critical boundaries |
40
- | **E2E** | Login flow, main CRUD operations, critical user journeys | Write for key user flows only |
41
-
42
- ### 3. Test Cases
43
- For each acceptance criterion:
44
- - **Happy path**: Normal expected behavior
45
- - **Error cases**: Invalid input, unauthorized access, resource not found
46
- - **Boundary values**: Empty, null, max length, zero, negative
47
- - **Concurrency**: Race conditions, parallel access (if applicable)
48
-
49
- ## Output
50
- Markdown filling in each section of the test plan:
51
- - **Scope**: What is being tested and what is excluded
52
- - **Acceptance criteria**: Given-When-Then for each behavior
53
- - **Test cases**: Organized by layer (unit / integration / e2e)
54
- - **Test data**: Required fixtures and setup
55
- - **Environment**: Required infrastructure (DB, services, etc.)
56
- - **Execution commands**: Exact commands to run each test suite
@@ -1,149 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Generated by: godd notes infra (AWS)
5
- # Terraform state 用 S3 バケット + KMS キー + DynamoDB テーブルを作成する。
6
- # CI/CD・Terraform 構築前に 1 回だけ手動実行する。
7
-
8
- BUCKET="${BUCKET:-godd-notes-tfstate-{{accountId}}{{!--brk--}}}"
9
- KMS_ALIAS="${KMS_ALIAS:-alias/godd-tfstate}"
10
- REGION="${REGION:-{{region}}{{!--brk--}}}"
11
- DYNAMODB_TABLE="${DYNAMODB_TABLE:-godd-notes-tfstate-lock}"
12
-
13
- usage() {
14
- cat <<EOF
15
- Usage: $0 [--bucket BUCKET] [--kms-alias KMS_ALIAS] [--region REGION] [--dynamodb-table TABLE]
16
-
17
- Terraform state 用 S3 バケット + KMS キー + DynamoDB テーブルを作成する。
18
- 各アカウントで CI/CD・Terraform 構築前に 1 回だけ手動実行する。
19
-
20
- デフォルト値はウィザード入力値から自動設定済み。
21
- 引数なしでそのまま実行可能。
22
-
23
- Options:
24
- --bucket S3 バケット名 [default: ${BUCKET}]
25
- --kms-alias KMS エイリアス [default: ${KMS_ALIAS}]
26
- --region AWS リージョン [default: ${REGION}]
27
- --dynamodb-table DynamoDB テーブル名 [default: ${DYNAMODB_TABLE}]
28
- --help, -h このヘルプを表示
29
-
30
- Example:
31
- # デフォルト値でそのまま実行
32
- $0
33
-
34
- # リージョンだけ変更
35
- $0 --region us-west-2
36
- EOF
37
- exit 0
38
- }
39
-
40
- while [[ $# -gt 0 ]]; do
41
- case "$1" in
42
- --bucket) BUCKET="$2"; shift 2 ;;
43
- --kms-alias) KMS_ALIAS="$2"; shift 2 ;;
44
- --region) REGION="$2"; shift 2 ;;
45
- --dynamodb-table) DYNAMODB_TABLE="$2"; shift 2 ;;
46
- --help|-h) usage ;;
47
- *) echo "Unknown option: $1" >&2; usage ;;
48
- esac
49
- done
50
-
51
- echo "==> Terraform backend setup"
52
- echo " Bucket: ${BUCKET}"
53
- echo " KMS Alias: ${KMS_ALIAS}"
54
- echo " Region: ${REGION}"
55
- echo " DynamoDB Table: ${DYNAMODB_TABLE}"
56
- echo ""
57
-
58
- # --- S3 bucket ---
59
-
60
- echo "==> Creating S3 bucket: ${BUCKET} (region: ${REGION})"
61
- if aws s3api head-bucket --bucket "$BUCKET" 2>/dev/null; then
62
- echo " Bucket already exists, skipping creation."
63
- else
64
- if [[ "$REGION" == "us-east-1" ]]; then
65
- aws s3api create-bucket --bucket "$BUCKET" --region "$REGION"
66
- else
67
- aws s3api create-bucket \
68
- --bucket "$BUCKET" \
69
- --region "$REGION" \
70
- --create-bucket-configuration LocationConstraint="$REGION"
71
- fi
72
- fi
73
-
74
- echo "==> Enabling versioning on ${BUCKET}"
75
- aws s3api put-bucket-versioning \
76
- --bucket "$BUCKET" \
77
- --versioning-configuration Status=Enabled
78
-
79
- echo "==> Blocking public access on ${BUCKET}"
80
- aws s3api put-public-access-block \
81
- --bucket "$BUCKET" \
82
- --public-access-block-configuration \
83
- BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
84
-
85
- # --- KMS key ---
86
-
87
- KMS_ALIAS_NAME="${KMS_ALIAS#alias/}"
88
-
89
- echo "==> Checking KMS alias: ${KMS_ALIAS}"
90
- KMS_KEY_ID=$(aws kms list-aliases --region "$REGION" \
91
- --query "Aliases[?AliasName=='alias/${KMS_ALIAS_NAME}'].TargetKeyId | [0]" \
92
- --output text 2>/dev/null || true)
93
-
94
- if [[ "$KMS_KEY_ID" == "None" || -z "$KMS_KEY_ID" ]]; then
95
- echo "==> Creating KMS key"
96
- KMS_KEY_ID=$(aws kms create-key \
97
- --region "$REGION" \
98
- --description "Terraform state encryption for ${BUCKET}" \
99
- --tags TagKey=Project,TagValue=godd-notes TagKey=ManagedBy,TagValue=script \
100
- --query KeyMetadata.KeyId \
101
- --output text)
102
-
103
- echo "==> Creating KMS alias: ${KMS_ALIAS}"
104
- aws kms create-alias \
105
- --region "$REGION" \
106
- --alias-name "alias/${KMS_ALIAS_NAME}" \
107
- --target-key-id "$KMS_KEY_ID"
108
- else
109
- echo " KMS alias already exists (KeyId: ${KMS_KEY_ID}), skipping."
110
- fi
111
-
112
- echo "==> Setting default encryption on ${BUCKET} with KMS key"
113
- aws s3api put-bucket-encryption \
114
- --bucket "$BUCKET" \
115
- --server-side-encryption-configuration "{
116
- \"Rules\": [{
117
- \"ApplyServerSideEncryptionByDefault\": {
118
- \"SSEAlgorithm\": \"aws:kms\",
119
- \"KMSMasterKeyID\": \"${KMS_KEY_ID}\"
120
- },
121
- \"BucketKeyEnabled\": true
122
- }]
123
- }"
124
-
125
- # --- DynamoDB table (state locking) ---
126
-
127
- echo "==> Checking DynamoDB table: ${DYNAMODB_TABLE}"
128
- if aws dynamodb describe-table --table-name "$DYNAMODB_TABLE" --region "$REGION" >/dev/null 2>&1; then
129
- echo " DynamoDB table already exists, skipping creation."
130
- else
131
- echo "==> Creating DynamoDB table: ${DYNAMODB_TABLE}"
132
- aws dynamodb create-table \
133
- --table-name "$DYNAMODB_TABLE" \
134
- --attribute-definitions AttributeName=LockID,AttributeType=S \
135
- --key-schema AttributeName=LockID,KeyType=HASH \
136
- --billing-mode PAY_PER_REQUEST \
137
- --region "$REGION" \
138
- --tags Key=Project,Value=godd-notes Key=ManagedBy,Value=script >/dev/null
139
- echo " Waiting for table to become active..."
140
- aws dynamodb wait table-exists --table-name "$DYNAMODB_TABLE" --region "$REGION"
141
- fi
142
-
143
- echo ""
144
- echo "=== Setup complete ==="
145
- echo " Bucket: ${BUCKET}"
146
- echo " KMS Alias: ${KMS_ALIAS}"
147
- echo " KMS KeyId: ${KMS_KEY_ID}"
148
- echo " DynamoDB Table: ${DYNAMODB_TABLE}"
149
- echo " Region: ${REGION}"
@@ -1,58 +0,0 @@
1
- resource "aws_lb" "api" {
2
- name = "${local.project}-alb"
3
- internal = false
4
- load_balancer_type = "application"
5
- security_groups = [aws_security_group.alb.id]
6
- subnets = [aws_subnet.public_1a.id, aws_subnet.public_1c.id]
7
- tags = local.tags
8
- }
9
-
10
- resource "aws_lb_target_group" "api" {
11
- name = "${local.project}-tg"
12
- port = local.container_port
13
- protocol = "HTTP"
14
- vpc_id = aws_vpc.main.id
15
- target_type = "ip"
16
- tags = local.tags
17
-
18
- health_check {
19
- path = "/api/health"
20
- interval = 30
21
- timeout = 5
22
- healthy_threshold = 3
23
- unhealthy_threshold = 3
24
- matcher = "200"
25
- }
26
- }
27
-
28
- resource "aws_lb_listener" "http" {
29
- load_balancer_arn = aws_lb.api.arn
30
- port = 80
31
- protocol = "HTTP"
32
-
33
- default_action {
34
- type = "fixed-response"
35
- fixed_response {
36
- content_type = "text/plain"
37
- message_body = "Forbidden"
38
- status_code = "403"
39
- }
40
- }
41
- }
42
-
43
- resource "aws_lb_listener_rule" "verify_origin" {
44
- listener_arn = aws_lb_listener.http.arn
45
- priority = 1
46
-
47
- condition {
48
- http_header {
49
- http_header_name = "X-Origin-Verify"
50
- values = [random_password.origin_verify.result]
51
- }
52
- }
53
-
54
- action {
55
- type = "forward"
56
- target_group_arn = aws_lb_target_group.api.arn
57
- }
58
- }
@@ -1,10 +0,0 @@
1
- terraform {
2
- backend "s3" {
3
- bucket = "godd-notes-tfstate-{{accountId}}"
4
- key = "{{env}}/terraform.tfstate"
5
- region = "{{region}}"
6
- encrypt = true
7
- kms_key_id = "alias/godd-tfstate"
8
- dynamodb_table = "godd-notes-tfstate-lock"
9
- }
10
- }
@@ -1,96 +0,0 @@
1
- resource "aws_cloudfront_origin_access_control" "notes_app" {
2
- name = "${local.project}-oac"
3
- origin_access_control_origin_type = "s3"
4
- signing_behavior = "always"
5
- signing_protocol = "sigv4"
6
- }
7
-
8
- resource "random_password" "origin_verify" {
9
- length = 64
10
- special = false
11
- }
12
-
13
- resource "aws_cloudfront_distribution" "notes" {
14
- enabled = true
15
- default_root_object = "index.html"
16
- price_class = "PriceClass_200"
17
- tags = local.tags
18
-
19
- # S3 Origin (SPA)
20
- origin {
21
- domain_name = aws_s3_bucket.notes_app.bucket_regional_domain_name
22
- origin_id = "s3-origin"
23
- origin_access_control_id = aws_cloudfront_origin_access_control.notes_app.id
24
- }
25
-
26
- # ALB Origin (API)
27
- origin {
28
- domain_name = aws_lb.api.dns_name
29
- origin_id = "api-origin"
30
-
31
- custom_origin_config {
32
- http_port = 80
33
- https_port = 443
34
- origin_protocol_policy = "http-only"
35
- origin_ssl_protocols = ["TLSv1.2"]
36
- }
37
-
38
- custom_header {
39
- name = "X-Origin-Verify"
40
- value = random_password.origin_verify.result
41
- }
42
- }
43
-
44
- # Default behavior → S3
45
- default_cache_behavior {
46
- allowed_methods = ["GET", "HEAD"]
47
- cached_methods = ["GET", "HEAD"]
48
- target_origin_id = "s3-origin"
49
- viewer_protocol_policy = "redirect-to-https"
50
-
51
- forwarded_values {
52
- query_string = false
53
- cookies { forward = "none" }
54
- }
55
- }
56
-
57
- # /api/* → ALB
58
- ordered_cache_behavior {
59
- path_pattern = "/api/*"
60
- allowed_methods = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
61
- cached_methods = ["GET", "HEAD"]
62
- target_origin_id = "api-origin"
63
- viewer_protocol_policy = "redirect-to-https"
64
-
65
- forwarded_values {
66
- query_string = true
67
- headers = ["Authorization", "Origin", "Accept"]
68
- cookies { forward = "all" }
69
- }
70
-
71
- min_ttl = 0
72
- default_ttl = 0
73
- max_ttl = 0
74
- }
75
-
76
- # SPA fallback
77
- custom_error_response {
78
- error_code = 403
79
- response_code = 200
80
- response_page_path = "/index.html"
81
- }
82
-
83
- custom_error_response {
84
- error_code = 404
85
- response_code = 200
86
- response_page_path = "/index.html"
87
- }
88
-
89
- restrictions {
90
- geo_restriction { restriction_type = "none" }
91
- }
92
-
93
- viewer_certificate {
94
- cloudfront_default_certificate = true
95
- }
96
- }
@@ -1,30 +0,0 @@
1
- resource "aws_ecr_repository" "notes_api" {
2
- name = "godd-notes-api"
3
- image_tag_mutability = "MUTABLE"
4
- force_delete = local.env == "dev"
5
- tags = local.tags
6
-
7
- image_scanning_configuration {
8
- scan_on_push = true
9
- }
10
- }
11
-
12
- resource "aws_ecr_lifecycle_policy" "notes_api" {
13
- repository = aws_ecr_repository.notes_api.name
14
-
15
- policy = jsonencode({
16
- rules = [
17
- {
18
- rulePriority = 1
19
- description = "Delete untagged images after 1 day"
20
- selection = {
21
- tagStatus = "untagged"
22
- countType = "sinceImagePushed"
23
- countUnit = "days"
24
- countNumber = 1
25
- }
26
- action = { type = "expire" }
27
- }
28
- ]
29
- })
30
- }
@@ -1,142 +0,0 @@
1
- resource "aws_ecs_cluster" "main" {
2
- name = local.project
3
- tags = local.tags
4
- }
5
-
6
- resource "aws_cloudwatch_log_group" "ecs" {
7
- name = "/ecs/godd-notes-api"
8
- retention_in_days = 30
9
- tags = local.tags
10
- }
11
-
12
- resource "aws_iam_role" "ecs_task_execution" {
13
- name = "${local.project}-ecs-task-execution"
14
- tags = local.tags
15
-
16
- assume_role_policy = jsonencode({
17
- Version = "2012-10-17"
18
- Statement = [{
19
- Action = "sts:AssumeRole"
20
- Effect = "Allow"
21
- Principal = { Service = "ecs-tasks.amazonaws.com" }
22
- }]
23
- })
24
- }
25
-
26
- resource "aws_iam_role_policy_attachment" "ecs_task_execution" {
27
- role = aws_iam_role.ecs_task_execution.name
28
- policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
29
- }
30
-
31
- resource "aws_iam_role_policy" "ecs_secrets" {
32
- name = "${local.project}-ecs-secrets"
33
- role = aws_iam_role.ecs_task_execution.id
34
-
35
- policy = jsonencode({
36
- Version = "2012-10-17"
37
- Statement = [{
38
- Effect = "Allow"
39
- Action = ["secretsmanager:GetSecretValue"]
40
- Resource = "arn:aws:secretsmanager:${local.region}:${local.account_id}:secret:godd-notes/${local.env}/*"
41
- }]
42
- })
43
- }
44
-
45
- resource "aws_iam_role" "ecs_task" {
46
- name = "${local.project}-ecs-task"
47
- tags = local.tags
48
-
49
- assume_role_policy = jsonencode({
50
- Version = "2012-10-17"
51
- Statement = [{
52
- Action = "sts:AssumeRole"
53
- Effect = "Allow"
54
- Principal = { Service = "ecs-tasks.amazonaws.com" }
55
- }]
56
- })
57
- }
58
-
59
- resource "aws_ecs_task_definition" "api" {
60
- family = "godd-notes-api"
61
- requires_compatibilities = ["FARGATE"]
62
- network_mode = "awsvpc"
63
- cpu = local.ecs_cpu
64
- memory = local.ecs_memory
65
- execution_role_arn = aws_iam_role.ecs_task_execution.arn
66
- task_role_arn = aws_iam_role.ecs_task.arn
67
- tags = local.tags
68
-
69
- runtime_platform {
70
- operating_system_family = "LINUX"
71
- cpu_architecture = "ARM64"
72
- }
73
-
74
- container_definitions = jsonencode([{
75
- name = "notes-api"
76
- image = "${aws_ecr_repository.notes_api.repository_url}:latest"
77
- essential = true
78
- command = ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port ${local.container_port}"]
79
-
80
- portMappings = [{
81
- containerPort = local.container_port
82
- protocol = "tcp"
83
- }]
84
-
85
- environment = [
86
- { name = "DB_PORT", value = "5432" },
87
- { name = "DB_NAME", value = local.rds_db_name },
88
- { name = "DATABASE_SSL", value = "true" },
89
- { name = "API_HOST", value = "0.0.0.0" },
90
- { name = "API_PORT", value = tostring(local.container_port) },
91
- { name = "ALLOWED_ORIGINS", value = "https://${aws_cloudfront_distribution.notes.domain_name}" },
92
- { name = "GITHUB_OWNER", value = local.github_owner },
93
- { name = "GITHUB_REPO", value = local.github_repo },
94
- ]
95
-
96
- secrets = [
97
- { name = "DB_HOST", valueFrom = "${aws_secretsmanager_secret.rds_credentials.arn}:host::" },
98
- { name = "DB_USER", valueFrom = "${aws_secretsmanager_secret.rds_credentials.arn}:username::" },
99
- { name = "DB_PASSWORD", valueFrom = "${aws_secretsmanager_secret.rds_credentials.arn}:password::" },
100
- { name = "JWT_SECRET", valueFrom = aws_secretsmanager_secret.jwt_secret.arn },
101
- { name = "GITHUB_TOKEN", valueFrom = aws_secretsmanager_secret.github_token.arn },
102
- { name = "GITHUB_APP_ID", valueFrom = aws_secretsmanager_secret.github_app_id.arn },
103
- { name = "GITHUB_APP_PRIVATE_KEY", valueFrom = aws_secretsmanager_secret.github_app_private_key.arn },
104
- { name = "GITHUB_APP_INSTALLATION_ID", valueFrom = aws_secretsmanager_secret.github_app_installation_id.arn },
105
- { name = "NOTES_ADMIN_USERNAME", valueFrom = "${aws_secretsmanager_secret.admin_credentials.arn}:username::" },
106
- { name = "NOTES_ADMIN_PASSWORD", valueFrom = "${aws_secretsmanager_secret.admin_credentials.arn}:password::" },
107
- ]
108
-
109
- logConfiguration = {
110
- logDriver = "awslogs"
111
- options = {
112
- "awslogs-group" = aws_cloudwatch_log_group.ecs.name
113
- "awslogs-region" = local.region
114
- "awslogs-stream-prefix" = "ecs"
115
- }
116
- }
117
- }])
118
- }
119
-
120
- resource "aws_ecs_service" "api" {
121
- name = "notes-api"
122
- cluster = aws_ecs_cluster.main.id
123
- task_definition = aws_ecs_task_definition.api.arn
124
- desired_count = 1
125
- launch_type = "FARGATE"
126
- platform_version = "1.4.0"
127
- tags = local.tags
128
-
129
- enable_execute_command = true
130
-
131
- network_configuration {
132
- subnets = [aws_subnet.public_1a.id]
133
- security_groups = [aws_security_group.ecs.id]
134
- assign_public_ip = true
135
- }
136
-
137
- load_balancer {
138
- target_group_arn = aws_lb_target_group.api.arn
139
- container_name = "notes-api"
140
- container_port = local.container_port
141
- }
142
- }
@@ -1,88 +0,0 @@
1
- data "aws_iam_openid_connect_provider" "github" {
2
- url = "https://token.actions.githubusercontent.com"
3
- }
4
-
5
- resource "aws_iam_role" "github_actions" {
6
- name = "github-actions-${local.env}"
7
- tags = local.tags
8
-
9
- assume_role_policy = jsonencode({
10
- Version = "2012-10-17"
11
- Statement = [{
12
- Effect = "Allow"
13
- Principal = {
14
- Federated = data.aws_iam_openid_connect_provider.github.arn
15
- }
16
- Action = "sts:AssumeRoleWithWebIdentity"
17
- Condition = {
18
- StringLike = {
19
- "token.actions.githubusercontent.com:sub" = "repo:${local.github_owner}/${local.github_repo}:*"
20
- }
21
- StringEquals = {
22
- "token.actions.githubusercontent.com:aud" = "sts.amazonaws.com"
23
- }
24
- }
25
- }]
26
- })
27
- }
28
-
29
- resource "aws_iam_role_policy" "github_actions" {
30
- name = "${local.project}-github-actions"
31
- role = aws_iam_role.github_actions.id
32
-
33
- policy = jsonencode({
34
- Version = "2012-10-17"
35
- Statement = [
36
- {
37
- Sid = "ECR"
38
- Effect = "Allow"
39
- Action = [
40
- "ecr:GetAuthorizationToken",
41
- "ecr:BatchCheckLayerAvailability",
42
- "ecr:GetDownloadUrlForLayer",
43
- "ecr:BatchGetImage",
44
- "ecr:PutImage",
45
- "ecr:InitiateLayerUpload",
46
- "ecr:UploadLayerPart",
47
- "ecr:CompleteLayerUpload",
48
- ]
49
- Resource = "*"
50
- },
51
- {
52
- Sid = "ECS"
53
- Effect = "Allow"
54
- Action = [
55
- "ecs:UpdateService",
56
- "ecs:DescribeServices",
57
- "ecs:DescribeTaskDefinition",
58
- "ecs:RegisterTaskDefinition",
59
- "iam:PassRole",
60
- ]
61
- Resource = "*"
62
- },
63
- {
64
- Sid = "S3"
65
- Effect = "Allow"
66
- Action = [
67
- "s3:PutObject",
68
- "s3:GetObject",
69
- "s3:DeleteObject",
70
- "s3:ListBucket",
71
- ]
72
- Resource = [
73
- "arn:aws:s3:::${local.project}-${local.account_id}",
74
- "arn:aws:s3:::${local.project}-${local.account_id}/*",
75
- ]
76
- },
77
- {
78
- Sid = "CloudFront"
79
- Effect = "Allow"
80
- Action = [
81
- "cloudfront:CreateInvalidation",
82
- "cloudfront:GetDistribution",
83
- ]
84
- Resource = "*"
85
- },
86
- ]
87
- })
88
- }