ui-syncup 0.3.13 → 0.4.0-beta.2
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.
- package/.agents/skills/ai-spec-workflow/SKILL.md +58 -0
- package/.agents/skills/ai-spec-workflow/references/AI_SPECIFICATION_WORKFLOW.md +1434 -0
- package/.agents/skills/ai-spec-workflow/references/templates/design-template.md +729 -0
- package/.agents/skills/ai-spec-workflow/references/templates/requirements-template.md +179 -0
- package/.agents/skills/ai-spec-workflow/references/templates/tasks-template.md +501 -0
- package/.agents/skills/animation-designer/SKILL.md +688 -0
- package/.agents/skills/animation-designer/manifest.yaml +44 -0
- package/.agents/skills/brainstorming/SKILL.md +54 -0
- package/.agents/skills/contract-driven-ui/SKILL.md +270 -0
- package/.agents/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/.agents/skills/executing-plans/SKILL.md +76 -0
- package/.agents/skills/executing-specs/SKILL.md +53 -0
- package/.agents/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/.agents/skills/github-workflow-automation/SKILL.md +846 -0
- package/.agents/skills/react-best-practices/AGENTS.md +2249 -0
- package/.agents/skills/react-best-practices/README.md +123 -0
- package/.agents/skills/react-best-practices/SKILL.md +121 -0
- package/.agents/skills/react-best-practices/metadata.json +15 -0
- package/.agents/skills/react-best-practices/rules/_sections.md +46 -0
- package/.agents/skills/react-best-practices/rules/_template.md +28 -0
- package/.agents/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/.agents/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/.agents/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/.agents/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/.agents/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/.agents/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/.agents/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/.agents/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/.agents/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/.agents/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/.agents/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/.agents/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/.agents/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/.agents/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/.agents/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/.agents/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/.agents/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/.agents/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/.agents/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/.agents/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/.agents/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/.agents/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/.agents/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/.agents/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/.agents/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/.agents/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/.agents/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/.agents/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/.agents/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/.agents/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/.agents/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/.agents/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/.agents/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/.agents/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/.agents/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/.agents/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/.agents/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/.agents/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/.agents/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/.agents/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/.agents/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/.agents/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/.agents/skills/react-best-practices/rules/server-cache-react.md +26 -0
- package/.agents/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
- package/.agents/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/.agents/skills/react-ui-patterns/SKILL.md +289 -0
- package/.agents/skills/receiving-code-review/SKILL.md +213 -0
- package/.agents/skills/requesting-code-review/SKILL.md +105 -0
- package/.agents/skills/requesting-code-review/code-reviewer.md +146 -0
- package/.agents/skills/reviewing-code/SKILL.md +28 -0
- package/.agents/skills/shadcn/SKILL.md +240 -0
- package/.agents/skills/shadcn/agents/openai.yml +5 -0
- package/.agents/skills/shadcn/assets/shadcn-small.png +0 -0
- package/.agents/skills/shadcn/assets/shadcn.png +0 -0
- package/.agents/skills/shadcn/cli.md +255 -0
- package/.agents/skills/shadcn/customization.md +202 -0
- package/.agents/skills/shadcn/evals/evals.json +47 -0
- package/.agents/skills/shadcn/mcp.md +94 -0
- package/.agents/skills/shadcn/rules/base-vs-radix.md +306 -0
- package/.agents/skills/shadcn/rules/composition.md +195 -0
- package/.agents/skills/shadcn/rules/forms.md +192 -0
- package/.agents/skills/shadcn/rules/icons.md +101 -0
- package/.agents/skills/shadcn/rules/styling.md +162 -0
- package/.agents/skills/steering-creation/SKILL.md +221 -0
- package/.agents/skills/steering-creation/references/STEERING_CREATION_INSTRUCTION.md +850 -0
- package/.agents/skills/subagent-driven-development/SKILL.md +240 -0
- package/.agents/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/.agents/skills/subagent-driven-development/implementer-prompt.md +78 -0
- package/.agents/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/.agents/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/.agents/skills/systematic-debugging/SKILL.md +296 -0
- package/.agents/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/.agents/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/.agents/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/.agents/skills/systematic-debugging/find-polluter.sh +63 -0
- package/.agents/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/.agents/skills/systematic-debugging/test-academic.md +14 -0
- package/.agents/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/.agents/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/.agents/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/.agents/skills/test-driven-development/SKILL.md +371 -0
- package/.agents/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/.agents/skills/using-git-worktrees/SKILL.md +217 -0
- package/.agents/skills/using-superpowers/SKILL.md +87 -0
- package/.agents/skills/verification-before-completion/SKILL.md +139 -0
- package/.agents/skills/web-design-guidelines/SKILL.md +36 -0
- package/.agents/skills/writing-plans/SKILL.md +116 -0
- package/.agents/skills/writing-skills/SKILL.md +655 -0
- package/.agents/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/.agents/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/.agents/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/.agents/skills/writing-skills/persuasion-principles.md +187 -0
- package/.agents/skills/writing-skills/render-graphs.js +168 -0
- package/.agents/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/.ai/steering/product.md +51 -0
- package/.ai/steering/structure.md +275 -0
- package/.ai/steering/tech.md +188 -0
- package/.claude/agents/database-architect.md +96 -0
- package/.claude/agents/deployment-pipeline-architect.md +122 -0
- package/.claude/agents/nextjs-expert.md +69 -0
- package/.claude/agents/ui-design-expert.md +106 -0
- package/.claudeignore +69 -0
- package/.dockerignore +8 -0
- package/.env.development +86 -0
- package/.env.example +171 -0
- package/.env.production +139 -0
- package/.env.test +58 -0
- package/.gitattributes +2 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +33 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +20 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- package/.github/workflows/ci.yml +64 -0
- package/.github/workflows/release.yml +174 -0
- package/.nvmrc +1 -0
- package/.releaserc.json +18 -0
- package/.vercelignore +73 -0
- package/AGENTS.md +544 -0
- package/CHANGELOG.md +69 -0
- package/CODE_OF_CONDUCT.md +21 -0
- package/CONTRIBUTING.md +32 -0
- package/Dockerfile +84 -0
- package/LICENSE +21 -0
- package/README.md +328 -59
- package/SECURITY.md +16 -0
- package/bun.lock +3853 -0
- package/cli/README.md +94 -0
- package/cli/bun.lock +306 -0
- package/cli/index.ts +96 -0
- package/cli/package-lock.json +2157 -0
- package/cli/package.json +30 -0
- package/cli/src/commands/backup.ts +78 -0
- package/cli/src/commands/doctor.ts +82 -0
- package/cli/src/commands/init.ts +234 -0
- package/cli/src/commands/logs.ts +26 -0
- package/cli/src/commands/open.ts +23 -0
- package/cli/src/commands/remove.ts +44 -0
- package/cli/src/commands/restart.ts +21 -0
- package/cli/src/commands/restore.ts +90 -0
- package/cli/src/commands/start.ts +26 -0
- package/cli/src/commands/status.ts +25 -0
- package/cli/src/commands/stop.ts +20 -0
- package/cli/src/commands/upgrade.ts +28 -0
- package/cli/src/lib/docker.ts +40 -0
- package/cli/src/lib/env.ts +42 -0
- package/cli/src/lib/ui.ts +43 -0
- package/cli/tsconfig.json +13 -0
- package/cli/tsup.config.ts +12 -0
- package/components.json +24 -0
- package/docker/README.md +430 -0
- package/docker/compose.dev-minio.yml +30 -0
- package/docker/compose.dev.yml +39 -0
- package/docker/compose.local.yml +84 -0
- package/docker/compose.yml +153 -0
- package/docs/VERSIONING.md +101 -0
- package/docs/database/DRIZZLE_COMMANDS_EXPLAINED.md +1779 -0
- package/docs/database/DRIZZLE_ZOD_POSTGRESQL_INSTRUCTION.md +646 -0
- package/docs/database/MIGRATION_BEST_PRACTICES.md +601 -0
- package/docs/database/MIGRATION_ROLLBACK.md +1080 -0
- package/docs/database/MIGRATION_SYSTEM.md +165 -0
- package/docs/database/MIGRATION_TROUBLESHOOTING.md +881 -0
- package/docs/development/ENVIRONMENT_CONFIG.md +896 -0
- package/docs/development/LOCAL_DEVELOPMENT.md +456 -0
- package/docs/development/REMOTE_DATABASE_SETUP.md +786 -0
- package/docs/development/STORAGE_SETUP.md +207 -0
- package/docs/development/SUPABASE_LOCAL_SETUP.md +178 -0
- package/docs/development/TESTING.md +714 -0
- package/docs/feature-architectures/LOADING_ARCHITECTURE.md +343 -0
- package/docs/feature-architectures/NOTIFICATION_ARCHITECTURE.md +858 -0
- package/docs/feature-architectures/RATE_LIMIT_RESET.md +147 -0
- package/docs/feature-architectures/RBAC.md +1132 -0
- package/docs/feature-architectures/RESOURCE_LIMITS.md +69 -0
- package/docs/feature-architectures/SECURITY.md +284 -0
- package/docs/feature-architectures/WORKSPACES.md +278 -0
- package/docs/plans/admin-setup-wizard-routing-plan.md +623 -0
- package/drizzle/0000_purple_wilson_fisk.sql +360 -0
- package/drizzle/0001_drop_instance_public_url.sql +1 -0
- package/drizzle/meta/0000_snapshot.json +3118 -0
- package/drizzle/meta/_journal.json +20 -0
- package/drizzle.config.ts +13 -0
- package/eslint.config.mjs +44 -0
- package/install.sh +180 -0
- package/next.config.ts +91 -0
- package/package.json +128 -22
- package/playwright.config.ts +70 -0
- package/postcss.config.mjs +7 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/logo.svg +11 -0
- package/public/next.svg +1 -0
- package/public/playground/CPM-101/as-is-image.jpg +0 -0
- package/public/playground/CPM-101/to-be-image.jpg +0 -0
- package/public/playground/TEST-1/LinkedIn-skeleton-screen.png +0 -0
- package/public/playground/TEST-1/https___dev-to-uploads.s3.amazonaws.com_uploads_articles_vuahe90ka1mkx9aepmea.webp +0 -0
- package/public/playground/TEST-1/linkedin_skeletonscreen.jpg +0 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/scripts/__tests__/migrate.integration.test.ts +642 -0
- package/scripts/__tests__/migrate.property.test.ts +1714 -0
- package/scripts/__tests__/migrate.test.ts +536 -0
- package/scripts/admin-reset-password.ts +114 -0
- package/scripts/check-email-queue.ts +99 -0
- package/scripts/check-sessions.ts +50 -0
- package/scripts/db-pull-data.sh +73 -0
- package/scripts/force-verify-email.sh +13 -0
- package/scripts/migrate.ts +693 -0
- package/scripts/process-email-queue.ts +26 -0
- package/scripts/reset-db.ts +47 -0
- package/scripts/reset-rate-limit.sh +26 -0
- package/scripts/reset-remote-db.sql +31 -0
- package/scripts/retry-failed-emails.ts +67 -0
- package/scripts/seed.ts +605 -0
- package/scripts/setup-monitoring.sh +440 -0
- package/scripts/sync-migration-tracking.ts +113 -0
- package/scripts/test-ci-error-handling.sh +237 -0
- package/scripts/test-ci-workflow.sh +200 -0
- package/scripts/test-migration.sh +151 -0
- package/scripts/validate-env.ts +25 -0
- package/scripts/validate-migration-system.ts +566 -0
- package/scripts/verify-ci-status-reporting.sh +206 -0
- package/scripts/verify-user-email.sql +22 -0
- package/scripts/verify-vercel-integration.ts +292 -0
- package/seed_data.md +54 -0
- package/src/app/(protected)/(team)/(routes)/[projectSlug]/error.tsx +89 -0
- package/src/app/(protected)/(team)/(routes)/[projectSlug]/loading.tsx +101 -0
- package/src/app/(protected)/(team)/(routes)/[projectSlug]/page.tsx +91 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/README.md +192 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/error.tsx +58 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/loading.tsx +14 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/not-found.tsx +47 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/page.tsx +91 -0
- package/src/app/(protected)/(team)/projects/page.tsx +16 -0
- package/src/app/(protected)/(team)/team/settings/(section)/instance/page.tsx +52 -0
- package/src/app/(protected)/(team)/team/settings/(section)/integrations/loading.tsx +5 -0
- package/src/app/(protected)/(team)/team/settings/(section)/integrations/page.tsx +23 -0
- package/src/app/(protected)/(team)/team/settings/(section)/members/loading.tsx +5 -0
- package/src/app/(protected)/(team)/team/settings/(section)/members/page.tsx +35 -0
- package/src/app/(protected)/(team)/team/settings/layout.tsx +72 -0
- package/src/app/(protected)/(team)/team/settings/loading.tsx +5 -0
- package/src/app/(protected)/(team)/team/settings/page.tsx +71 -0
- package/src/app/(protected)/dev/auth/README.md +151 -0
- package/src/app/(protected)/dev/auth/page.tsx +590 -0
- package/src/app/(protected)/layout.test.tsx +209 -0
- package/src/app/(protected)/layout.tsx +28 -0
- package/src/app/(protected)/onboarding/page.tsx +27 -0
- package/src/app/(protected)/settings/integrations/page.tsx +23 -0
- package/src/app/(protected)/settings/layout.tsx +26 -0
- package/src/app/(protected)/settings/notifications/page.tsx +26 -0
- package/src/app/(protected)/settings/other/page.tsx +23 -0
- package/src/app/(protected)/settings/page.tsx +23 -0
- package/src/app/(protected)/settings/preferences/page.tsx +23 -0
- package/src/app/(protected)/settings/security/page.tsx +37 -0
- package/src/app/(public)/forgot-password/page.tsx +20 -0
- package/src/app/(public)/invite/project/[token]/error.tsx +50 -0
- package/src/app/(public)/invite/project/[token]/loading.tsx +39 -0
- package/src/app/(public)/invite/project/[token]/page.tsx +156 -0
- package/src/app/(public)/layout.tsx +9 -0
- package/src/app/(public)/privacy-policy/page.tsx +12 -0
- package/src/app/(public)/reset-password/page.tsx +37 -0
- package/src/app/(public)/setup/__tests__/page.test.tsx +30 -0
- package/src/app/(public)/setup/page.tsx +17 -0
- package/src/app/(public)/share/issue/[token]/page.tsx +51 -0
- package/src/app/(public)/sign-in/page.tsx +55 -0
- package/src/app/(public)/sign-up/page.tsx +23 -0
- package/src/app/(public)/verify-email/page.tsx +22 -0
- package/src/app/(public)/verify-email-confirm/page.tsx +40 -0
- package/src/app/api/auth/[...all]/route.ts +6 -0
- package/src/app/api/auth/delete-account/route.ts +134 -0
- package/src/app/api/auth/dev/force-verify/route.ts +180 -0
- package/src/app/api/auth/dev/reset-rate-limit/route.ts +144 -0
- package/src/app/api/auth/dev/sessions/route.ts +172 -0
- package/src/app/api/auth/forgot-password/__tests__/forgot-password.property.test.ts +397 -0
- package/src/app/api/auth/forgot-password/route.ts +277 -0
- package/src/app/api/auth/logout/route.ts +115 -0
- package/src/app/api/auth/me/route.ts +123 -0
- package/src/app/api/auth/providers/__tests__/route.test.ts +236 -0
- package/src/app/api/auth/providers/route.ts +119 -0
- package/src/app/api/auth/resend-verification/route.ts +262 -0
- package/src/app/api/auth/reset-password/__tests__/reset-password.property.test.ts +493 -0
- package/src/app/api/auth/reset-password/__tests__/route.test.ts +284 -0
- package/src/app/api/auth/reset-password/route.ts +251 -0
- package/src/app/api/auth/verify-email/route.ts +232 -0
- package/src/app/api/example-cors/route.ts +61 -0
- package/src/app/api/health/route.ts +14 -0
- package/src/app/api/invite/project/[token]/__tests__/accept-invitation.integration.test.ts +348 -0
- package/src/app/api/invite/project/[token]/decline/route.ts +99 -0
- package/src/app/api/invite/project/[token]/route.ts +269 -0
- package/src/app/api/issues/[issueId]/activities/route.ts +213 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/[annotationId]/comments/[commentId]/route.ts +486 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/[annotationId]/comments/route.ts +283 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/[annotationId]/read/route.ts +242 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/[annotationId]/route.ts +534 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/route.ts +514 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/route.ts +161 -0
- package/src/app/api/issues/[issueId]/attachments/route.ts +376 -0
- package/src/app/api/issues/[issueId]/route.ts +516 -0
- package/src/app/api/notifications/[id]/read/route.ts +131 -0
- package/src/app/api/notifications/__tests__/notifications.integration.test.ts +350 -0
- package/src/app/api/notifications/read-all/route.ts +72 -0
- package/src/app/api/notifications/route.ts +148 -0
- package/src/app/api/notifications/unread-count/route.ts +77 -0
- package/src/app/api/projects/[id]/activities/route.ts +174 -0
- package/src/app/api/projects/[id]/invitations/[invitationId]/resend/route.ts +99 -0
- package/src/app/api/projects/[id]/invitations/[invitationId]/route.ts +96 -0
- package/src/app/api/projects/[id]/invitations/route.ts +254 -0
- package/src/app/api/projects/[id]/issues/route.ts +452 -0
- package/src/app/api/projects/[id]/join/route.ts +207 -0
- package/src/app/api/projects/[id]/members/[memberId]/route.ts +364 -0
- package/src/app/api/projects/[id]/members/me/route.ts +121 -0
- package/src/app/api/projects/[id]/members/route.ts +129 -0
- package/src/app/api/projects/[id]/route.ts +476 -0
- package/src/app/api/projects/route.ts +394 -0
- package/src/app/api/setup/admin/route.ts +255 -0
- package/src/app/api/setup/complete/__tests__/route.test.ts +60 -0
- package/src/app/api/setup/complete/route.ts +244 -0
- package/src/app/api/setup/config/route.ts +195 -0
- package/src/app/api/setup/export/route.ts +111 -0
- package/src/app/api/setup/health/route.ts +74 -0
- package/src/app/api/setup/import/route.ts +154 -0
- package/src/app/api/setup/status/route.ts +82 -0
- package/src/app/api/setup/workspace/route.ts +252 -0
- package/src/app/api/teams/[teamId]/export/route.ts +115 -0
- package/src/app/api/teams/[teamId]/invitations/[invitationId]/resend/route.ts +132 -0
- package/src/app/api/teams/[teamId]/invitations/[invitationId]/route.ts +117 -0
- package/src/app/api/teams/[teamId]/invitations/route.ts +363 -0
- package/src/app/api/teams/[teamId]/members/[userId]/route.ts +335 -0
- package/src/app/api/teams/[teamId]/members/route.ts +184 -0
- package/src/app/api/teams/[teamId]/members/search/route.ts +202 -0
- package/src/app/api/teams/[teamId]/route.ts +423 -0
- package/src/app/api/teams/[teamId]/switch/route.ts +140 -0
- package/src/app/api/teams/[teamId]/transfer-ownership/route.ts +212 -0
- package/src/app/api/teams/invitations/[token]/accept/route.ts +140 -0
- package/src/app/api/teams/invitations/by-id/[id]/accept/route.ts +98 -0
- package/src/app/api/teams/invitations/by-id/[id]/decline/route.ts +90 -0
- package/src/app/api/teams/route.ts +278 -0
- package/src/app/api/uploads/media/route.ts +118 -0
- package/src/app/api/uploads/presigned/route.ts +49 -0
- package/src/app/api/user/linked-accounts/route.ts +35 -0
- package/src/app/email-preview/page.tsx +11 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/global-error.tsx +21 -0
- package/src/app/layout.tsx +50 -0
- package/src/app/page.tsx +5 -0
- package/src/components/icons/atlassian-icon.tsx +22 -0
- package/src/components/icons/index.ts +1 -0
- package/src/components/layout/SIDEBAR_LAYOUT_BEST_PRACTICES.md +240 -0
- package/src/components/layout/app-shell-header-store.tsx +20 -0
- package/src/components/layout/app-shell-skeleton.tsx +89 -0
- package/src/components/layout/app-shell-wrapper.tsx +32 -0
- package/src/components/layout/app-shell.test.tsx +155 -0
- package/src/components/layout/app-shell.tsx +100 -0
- package/src/components/shared/headers/app-header-configurator.tsx +42 -0
- package/src/components/shared/headers/app-header.tsx +103 -0
- package/src/components/shared/headers/header-user-menu.tsx +247 -0
- package/src/components/shared/headers/index.ts +44 -0
- package/src/components/shared/headers/page-header.tsx +25 -0
- package/src/components/shared/notifications/__tests__/notification-bell.test.tsx +159 -0
- package/src/components/shared/notifications/__tests__/notification-dropdown.test.tsx +296 -0
- package/src/components/shared/notifications/__tests__/notification-item.test.tsx +328 -0
- package/src/components/shared/notifications/index.ts +45 -0
- package/src/components/shared/notifications/notification-actions.tsx +295 -0
- package/src/components/shared/notifications/notification-bell-button.tsx +77 -0
- package/src/components/shared/notifications/notification-dropdown.tsx +160 -0
- package/src/components/shared/notifications/notification-group-item.tsx +268 -0
- package/src/components/shared/notifications/notification-item.tsx +193 -0
- package/src/components/shared/notifications/notification-load-more.tsx +50 -0
- package/src/components/shared/notifications/notification-panel.tsx +49 -0
- package/src/components/shared/notifications/utils.tsx +127 -0
- package/src/components/shared/permission-guard/index.ts +1 -0
- package/src/components/shared/permission-guard/permission-tooltip.tsx +45 -0
- package/src/components/shared/relative-time.tsx +53 -0
- package/src/components/shared/section-container.tsx +32 -0
- package/src/components/shared/service-status-banner.tsx +121 -0
- package/src/components/shared/settings-sidebar/index.ts +2 -0
- package/src/components/shared/settings-sidebar/team-setting-aside.tsx +97 -0
- package/src/components/shared/settings-sidebar/user-settings-aside.tsx +66 -0
- package/src/components/shared/sidebar/app-sidebar.tsx +146 -0
- package/src/components/shared/sidebar/index.ts +36 -0
- package/src/components/shared/sidebar/sidebar-main.tsx +81 -0
- package/src/components/shared/sidebar/sidebar-project.tsx +61 -0
- package/src/components/shared/sidebar/sidebar-team-avatar.tsx +126 -0
- package/src/components/shared/sidebar/sidebar-team-switcher.tsx +185 -0
- package/src/components/shared/sidebar/type.ts +97 -0
- package/src/components/ui/alert-dialog.tsx +157 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/avatar-upload.tsx +147 -0
- package/src/components/ui/avatar.tsx +53 -0
- package/src/components/ui/badge.tsx +46 -0
- package/src/components/ui/breadcrumb.tsx +109 -0
- package/src/components/ui/button.tsx +60 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/checkbox.tsx +32 -0
- package/src/components/ui/collapsible.tsx +33 -0
- package/src/components/ui/command.tsx +184 -0
- package/src/components/ui/dialog.tsx +143 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/empty.tsx +104 -0
- package/src/components/ui/field.tsx +244 -0
- package/src/components/ui/image-cropper-dialog.tsx +167 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/optimized-image.tsx +220 -0
- package/src/components/ui/pagination.tsx +127 -0
- package/src/components/ui/popover.tsx +48 -0
- package/src/components/ui/progress.tsx +31 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +58 -0
- package/src/components/ui/select.tsx +187 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +733 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/sonner.tsx +40 -0
- package/src/components/ui/spinner.tsx +16 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/table.tsx +116 -0
- package/src/components/ui/tabs.tsx +66 -0
- package/src/components/ui/textarea.tsx +23 -0
- package/src/components/ui/tooltip.tsx +61 -0
- package/src/config/__tests__/workspace.property.test.ts +40 -0
- package/src/config/auth.ts +62 -0
- package/src/config/integrations.ts +126 -0
- package/src/config/quotas.ts +20 -0
- package/src/config/roles.ts +463 -0
- package/src/config/settings-nav.ts +39 -0
- package/src/config/team-settings-nav.ts +37 -0
- package/src/config/user-settings-nav.ts +42 -0
- package/src/config/version.ts +1 -0
- package/src/config/workspace.ts +64 -0
- package/src/features/annotations/README.md +283 -0
- package/src/features/annotations/api/annotations-api.ts +194 -0
- package/src/features/annotations/api/comments-api.ts +147 -0
- package/src/features/annotations/api/index.ts +71 -0
- package/src/features/annotations/api/save-annotation.ts +150 -0
- package/src/features/annotations/api/schemas.ts +142 -0
- package/src/features/annotations/components/annotated-attachment-view.tsx +576 -0
- package/src/features/annotations/components/annotation-action-sheet.tsx +140 -0
- package/src/features/annotations/components/annotation-annotations-panel.tsx +213 -0
- package/src/features/annotations/components/annotation-box.tsx +539 -0
- package/src/features/annotations/components/annotation-canvas.tsx +534 -0
- package/src/features/annotations/components/annotation-comment-input.tsx +145 -0
- package/src/features/annotations/components/annotation-context-menu.tsx +164 -0
- package/src/features/annotations/components/annotation-drawer.tsx +231 -0
- package/src/features/annotations/components/annotation-layer.tsx +271 -0
- package/src/features/annotations/components/annotation-pin.tsx +318 -0
- package/src/features/annotations/components/annotation-popover.tsx +562 -0
- package/src/features/annotations/components/annotation-thread-panel.tsx +485 -0
- package/src/features/annotations/components/annotation-thread-preview.tsx +195 -0
- package/src/features/annotations/components/annotation-toolbar.tsx +244 -0
- package/src/features/annotations/components/keyboard-shortcuts-modal.tsx +79 -0
- package/src/features/annotations/docs/ANNOTATIONS_ARCHITECTURE.md +67 -0
- package/src/features/annotations/docs/ANNOTATION_SAVE_ARCHITECTURE.md +422 -0
- package/src/features/annotations/docs/ANNOTATION_SAVE_FEATURE.md +408 -0
- package/src/features/annotations/docs/BOX_ANNOTATION_GUIDE.md +542 -0
- package/src/features/annotations/docs/NEXTSTEP.md +28 -0
- package/src/features/annotations/docs/STALE_CLOSURE_FIX.md +344 -0
- package/src/features/annotations/docs/UNDO_REDO_QUICK_START.md +545 -0
- package/src/features/annotations/docs/local_first_canvas_autosave_architecture.md +674 -0
- package/src/features/annotations/examples/complete-example.tsx +266 -0
- package/src/features/annotations/examples/save-annotation-example.tsx +309 -0
- package/src/features/annotations/hooks/__tests__/use-annotation-permissions.property.test.tsx +493 -0
- package/src/features/annotations/hooks/index.ts +36 -0
- package/src/features/annotations/hooks/use-annotation-batch-save.ts +109 -0
- package/src/features/annotations/hooks/use-annotation-comments.ts +353 -0
- package/src/features/annotations/hooks/use-annotation-drafts.ts +137 -0
- package/src/features/annotations/hooks/use-annotation-edit-state.ts +99 -0
- package/src/features/annotations/hooks/use-annotation-history-tracker.ts +159 -0
- package/src/features/annotations/hooks/use-annotation-integration.ts +916 -0
- package/src/features/annotations/hooks/use-annotation-permissions.ts +210 -0
- package/src/features/annotations/hooks/use-annotation-popover.ts +175 -0
- package/src/features/annotations/hooks/use-annotation-save.ts +208 -0
- package/src/features/annotations/hooks/use-annotation-tools.ts +237 -0
- package/src/features/annotations/hooks/use-annotations-with-history.ts +332 -0
- package/src/features/annotations/hooks/use-auto-save.ts +94 -0
- package/src/features/annotations/index.ts +111 -0
- package/src/features/annotations/types/annotation.ts +201 -0
- package/src/features/annotations/types/index.ts +28 -0
- package/src/features/annotations/utils/history-manager.ts +73 -0
- package/src/features/annotations/utils/index.ts +2 -0
- package/src/features/annotations/utils/map-attachments-to-threads.ts +28 -0
- package/src/features/annotations/utils/position-comment-input.ts +136 -0
- package/src/features/annotations/utils/re-sequence-labels.ts +92 -0
- package/src/features/annotations/utils/validate-annotation-label.ts +120 -0
- package/src/features/auth/api/types.ts +101 -0
- package/src/features/auth/components/__tests__/role-gate.test.tsx +448 -0
- package/src/features/auth/components/__tests__/social-login-buttons.test.tsx +313 -0
- package/src/features/auth/components/auth-card.tsx +36 -0
- package/src/features/auth/components/forgot-password-form.tsx +115 -0
- package/src/features/auth/components/index.ts +14 -0
- package/src/features/auth/components/invite-code-input.tsx +155 -0
- package/src/features/auth/components/invited-user-form.tsx +309 -0
- package/src/features/auth/components/onboarding-form.tsx +195 -0
- package/src/features/auth/components/password-strength-indicator.tsx +113 -0
- package/src/features/auth/components/reset-password-form.tsx +138 -0
- package/src/features/auth/components/role-gate.tsx +124 -0
- package/src/features/auth/components/self-registration-choice.tsx +153 -0
- package/src/features/auth/components/sign-in-form.tsx +159 -0
- package/src/features/auth/components/sign-up-form.tsx +158 -0
- package/src/features/auth/components/social-login-buttons.tsx +219 -0
- package/src/features/auth/hooks/__tests__/use-onboarding.test.tsx +109 -0
- package/src/features/auth/hooks/__tests__/use-session.test.tsx +160 -0
- package/src/features/auth/hooks/index.ts +15 -0
- package/src/features/auth/hooks/use-accept-invitation.ts +194 -0
- package/src/features/auth/hooks/use-delete-account.ts +86 -0
- package/src/features/auth/hooks/use-force-verify.ts +89 -0
- package/src/features/auth/hooks/use-forgot-password.ts +144 -0
- package/src/features/auth/hooks/use-link-account.ts +78 -0
- package/src/features/auth/hooks/use-linked-accounts.ts +88 -0
- package/src/features/auth/hooks/use-onboarding.ts +159 -0
- package/src/features/auth/hooks/use-resend-verification.ts +139 -0
- package/src/features/auth/hooks/use-reset-password.ts +151 -0
- package/src/features/auth/hooks/use-reset-rate-limit.ts +56 -0
- package/src/features/auth/hooks/use-self-registration.ts +202 -0
- package/src/features/auth/hooks/use-session.ts +81 -0
- package/src/features/auth/hooks/use-sessions.ts +59 -0
- package/src/features/auth/hooks/use-sign-in.ts +234 -0
- package/src/features/auth/hooks/use-sign-out.ts +88 -0
- package/src/features/auth/hooks/use-sign-up.ts +194 -0
- package/src/features/auth/hooks/use-unlink-account.ts +100 -0
- package/src/features/auth/hooks/use-verify-email-token.ts +125 -0
- package/src/features/auth/index.ts +75 -0
- package/src/features/auth/screens/forgot-password-screen.tsx +33 -0
- package/src/features/auth/screens/index.ts +7 -0
- package/src/features/auth/screens/onboarding-screen.tsx +49 -0
- package/src/features/auth/screens/reset-password-screen.tsx +33 -0
- package/src/features/auth/screens/sign-in-screen.tsx +61 -0
- package/src/features/auth/screens/sign-up-screen.tsx +37 -0
- package/src/features/auth/screens/verify-email-confirm-screen.tsx +286 -0
- package/src/features/auth/screens/verify-email-screen.tsx +146 -0
- package/src/features/auth/types/index.ts +14 -0
- package/src/features/auth/utils/__tests__/validators.test.ts +331 -0
- package/src/features/auth/utils/password-strength.ts +129 -0
- package/src/features/auth/utils/validators.ts +124 -0
- package/src/features/email-preview/actions/render-email.ts +21 -0
- package/src/features/email-preview/screens/email-preview-screen.tsx +81 -0
- package/src/features/folder-scaffold-template/index.ts +0 -0
- package/src/features/instance-settings/components/index.ts +6 -0
- package/src/features/instance-settings/components/instance-settings-form.tsx +180 -0
- package/src/features/instance-settings/components/instance-status-display.tsx +158 -0
- package/src/features/instance-settings/index.ts +7 -0
- package/src/features/instance-settings/screens/index.ts +5 -0
- package/src/features/instance-settings/screens/instance-settings-screen.tsx +59 -0
- package/src/features/issues/README.md +330 -0
- package/src/features/issues/api/create-issue.ts +19 -0
- package/src/features/issues/api/delete-issue.ts +27 -0
- package/src/features/issues/api/get-issue-activities.ts +58 -0
- package/src/features/issues/api/get-issue-details.ts +25 -0
- package/src/features/issues/api/get-project-issues-server.ts +44 -0
- package/src/features/issues/api/get-project-issues.ts +21 -0
- package/src/features/issues/api/index.ts +44 -0
- package/src/features/issues/api/update-issue.ts +31 -0
- package/src/features/issues/api/upload-attachment.ts +81 -0
- package/src/features/issues/components/activity-timeline.tsx +440 -0
- package/src/features/issues/components/canvas-state-indicator.tsx +90 -0
- package/src/features/issues/components/centered-canvas-view.tsx +739 -0
- package/src/features/issues/components/image-selector.tsx +123 -0
- package/src/features/issues/components/image-upload-zone.tsx +262 -0
- package/src/features/issues/components/infinite-canvas-background.tsx +163 -0
- package/src/features/issues/components/inline-editable-select.tsx +173 -0
- package/src/features/issues/components/inline-editable-text.tsx +225 -0
- package/src/features/issues/components/inline-editable-textarea.tsx +219 -0
- package/src/features/issues/components/inline-editable-user-select.tsx +202 -0
- package/src/features/issues/components/issue-deletion-dialog.tsx +142 -0
- package/src/features/issues/components/issue-details-panel.tsx +101 -0
- package/src/features/issues/components/issues-create-dialog.tsx +578 -0
- package/src/features/issues/components/issues-list-filter.tsx +312 -0
- package/src/features/issues/components/issues-list.tsx +151 -0
- package/src/features/issues/components/issues-priority-badge.tsx +77 -0
- package/src/features/issues/components/issues-status-badge.tsx +100 -0
- package/src/features/issues/components/metadata-section.tsx +389 -0
- package/src/features/issues/components/optimized-attachment-view.tsx +528 -0
- package/src/features/issues/components/optimized-image.tsx +257 -0
- package/src/features/issues/components/panel-header.tsx +186 -0
- package/src/features/issues/components/preload.ts +31 -0
- package/src/features/issues/components/priority-selector.tsx +101 -0
- package/src/features/issues/components/responsive-issue-layout-skeleton.tsx +139 -0
- package/src/features/issues/components/responsive-issue-layout.tsx +617 -0
- package/src/features/issues/components/status-selector.tsx +320 -0
- package/src/features/issues/components/type-selector.tsx +102 -0
- package/src/features/issues/components/upload-progress-overlay.tsx +35 -0
- package/src/features/issues/components/uploaded-image-preview.tsx +173 -0
- package/src/features/issues/components/workflow-control.tsx +318 -0
- package/src/features/issues/components/zoom-controls.tsx +150 -0
- package/src/features/issues/config/index.ts +47 -0
- package/src/features/issues/config/options.ts +323 -0
- package/src/features/issues/config/workflow.ts +102 -0
- package/src/features/issues/docs/ARCHITECTURE_DIAGRAM.md +321 -0
- package/src/features/issues/docs/BACKEND_ARCHITECTURE.md +194 -0
- package/src/features/issues/docs/IMAGE_COMPONENTS_ARCHITECTURE.md +363 -0
- package/src/features/issues/docs/IMAGE_COMPONENTS_IMPORTS.md +412 -0
- package/src/features/issues/docs/IMPLEMENTATION_CHECKLIST.md +210 -0
- package/src/features/issues/docs/ROUTE_SETUP_COMPLETE.md +242 -0
- package/src/features/issues/hooks/index.ts +78 -0
- package/src/features/issues/hooks/use-canvas-transform.ts +255 -0
- package/src/features/issues/hooks/use-create-issue.ts +28 -0
- package/src/features/issues/hooks/use-elastic-scroll.ts +296 -0
- package/src/features/issues/hooks/use-issue-activities.ts +71 -0
- package/src/features/issues/hooks/use-issue-delete.ts +84 -0
- package/src/features/issues/hooks/use-issue-details.ts +70 -0
- package/src/features/issues/hooks/use-issue-filters.ts +50 -0
- package/src/features/issues/hooks/use-issue-update.ts +93 -0
- package/src/features/issues/hooks/use-keyboard-shortcuts.ts +104 -0
- package/src/features/issues/hooks/use-optimized-image.ts +228 -0
- package/src/features/issues/hooks/use-project-issues.ts +14 -0
- package/src/features/issues/index.ts +65 -0
- package/src/features/issues/screens/issue-details-screen.tsx +207 -0
- package/src/features/issues/screens/issue-details-skeletons.tsx +295 -0
- package/src/features/issues/screens/issue-share-screen.tsx +56 -0
- package/src/features/issues/types/index.ts +48 -0
- package/src/features/issues/types/issue.ts +291 -0
- package/src/features/issues/utils/filter-issues.ts +141 -0
- package/src/features/issues/utils/index.ts +14 -0
- package/src/features/legal/index.ts +1 -0
- package/src/features/legal/screens/privacy-policy-screen.tsx +307 -0
- package/src/features/notifications/api/get-notifications.ts +58 -0
- package/src/features/notifications/api/get-unread-count.ts +37 -0
- package/src/features/notifications/api/index.ts +35 -0
- package/src/features/notifications/api/mark-all-as-read.ts +37 -0
- package/src/features/notifications/api/mark-as-read.ts +41 -0
- package/src/features/notifications/api/types.ts +109 -0
- package/src/features/notifications/hooks/__tests__/use-notification-subscription.test.ts +206 -0
- package/src/features/notifications/hooks/index.ts +28 -0
- package/src/features/notifications/hooks/use-mark-all-as-read.ts +106 -0
- package/src/features/notifications/hooks/use-mark-as-read.ts +106 -0
- package/src/features/notifications/hooks/use-notification-subscription.ts +244 -0
- package/src/features/notifications/hooks/use-notification-toast.ts +161 -0
- package/src/features/notifications/hooks/use-notifications.ts +80 -0
- package/src/features/notifications/hooks/use-unread-count.ts +60 -0
- package/src/features/notifications/index.ts +48 -0
- package/src/features/notifications/utils/group-notifications.ts +152 -0
- package/src/features/notifications/utils/index.ts +9 -0
- package/src/features/projects/api/create-invitation.ts +45 -0
- package/src/features/projects/api/create-project.ts +64 -0
- package/src/features/projects/api/delete-project.ts +50 -0
- package/src/features/projects/api/get-project-activities.ts +43 -0
- package/src/features/projects/api/get-project-members.ts +53 -0
- package/src/features/projects/api/get-project.ts +49 -0
- package/src/features/projects/api/get-projects.ts +61 -0
- package/src/features/projects/api/index.ts +27 -0
- package/src/features/projects/api/join-project.ts +52 -0
- package/src/features/projects/api/leave-project.ts +51 -0
- package/src/features/projects/api/list-invitations.ts +36 -0
- package/src/features/projects/api/remove-member.ts +60 -0
- package/src/features/projects/api/resend-invitation.ts +36 -0
- package/src/features/projects/api/revoke-invitation.ts +36 -0
- package/src/features/projects/api/types.ts +286 -0
- package/src/features/projects/api/update-member-role.ts +70 -0
- package/src/features/projects/api/update-project.ts +69 -0
- package/src/features/projects/components/__tests__/project-detail-activity-feed.test.tsx +106 -0
- package/src/features/projects/components/__tests__/project-invitation-dialog.test.tsx +211 -0
- package/src/features/projects/components/__tests__/project-member-manager-dialog.test.tsx +254 -0
- package/src/features/projects/components/index.ts +21 -0
- package/src/features/projects/components/project-actions.tsx +248 -0
- package/src/features/projects/components/project-create-dialog.tsx +410 -0
- package/src/features/projects/components/project-detail-activity-feed.tsx +206 -0
- package/src/features/projects/components/project-detail-header.tsx +103 -0
- package/src/features/projects/components/project-detail-overview.tsx +128 -0
- package/src/features/projects/components/project-icon-selector.test.tsx +49 -0
- package/src/features/projects/components/project-icon-selector.tsx +76 -0
- package/src/features/projects/components/project-invitation-dialog.tsx +368 -0
- package/src/features/projects/components/project-issues.tsx +128 -0
- package/src/features/projects/components/project-leave-button.tsx +69 -0
- package/src/features/projects/components/project-list-card.tsx +246 -0
- package/src/features/projects/components/project-list-filters.tsx +320 -0
- package/src/features/projects/components/project-member-manager-dialog.tsx +419 -0
- package/src/features/projects/components/project-settings-dialog.tsx +204 -0
- package/src/features/projects/components/project-stats.tsx +46 -0
- package/src/features/projects/components/project-title-section.tsx +78 -0
- package/src/features/projects/config/icons.ts +91 -0
- package/src/features/projects/hooks/index.ts +28 -0
- package/src/features/projects/hooks/use-create-invitation.ts +83 -0
- package/src/features/projects/hooks/use-create-project.ts +77 -0
- package/src/features/projects/hooks/use-delete-project.ts +84 -0
- package/src/features/projects/hooks/use-join-project.ts +43 -0
- package/src/features/projects/hooks/use-leave-project.ts +84 -0
- package/src/features/projects/hooks/use-project-activities.ts +39 -0
- package/src/features/projects/hooks/use-project-filters.ts +86 -0
- package/src/features/projects/hooks/use-project-invitations.ts +66 -0
- package/src/features/projects/hooks/use-project-members.ts +57 -0
- package/src/features/projects/hooks/use-project.ts +67 -0
- package/src/features/projects/hooks/use-projects.ts +49 -0
- package/src/features/projects/hooks/use-recent-projects.ts +58 -0
- package/src/features/projects/hooks/use-remove-member.ts +89 -0
- package/src/features/projects/hooks/use-resend-invitation.ts +68 -0
- package/src/features/projects/hooks/use-revoke-invitation.ts +71 -0
- package/src/features/projects/hooks/use-team-member-suggestions.ts +133 -0
- package/src/features/projects/hooks/use-update-member-role.ts +92 -0
- package/src/features/projects/hooks/use-update-project.ts +88 -0
- package/src/features/projects/index.ts +91 -0
- package/src/features/projects/screens/index.ts +3 -0
- package/src/features/projects/screens/invitation-acceptance-screen.tsx +320 -0
- package/src/features/projects/screens/project-detail-screen-wrapper.tsx +47 -0
- package/src/features/projects/screens/project-detail-screen.tsx +661 -0
- package/src/features/projects/screens/projects-list-screen.tsx +161 -0
- package/src/features/projects/types/index.ts +59 -0
- package/src/features/projects/utils/format-helpers.ts +16 -0
- package/src/features/projects/utils/index.ts +2 -0
- package/src/features/projects/utils/role-helpers.ts +25 -0
- package/src/features/setup/api/complete-setup.ts +21 -0
- package/src/features/setup/api/create-admin.ts +21 -0
- package/src/features/setup/api/create-first-workspace.ts +21 -0
- package/src/features/setup/api/get-instance-status.ts +12 -0
- package/src/features/setup/api/get-service-health.ts +12 -0
- package/src/features/setup/api/index.ts +44 -0
- package/src/features/setup/api/save-instance-config.ts +21 -0
- package/src/features/setup/api/types.ts +122 -0
- package/src/features/setup/components/__tests__/setup-wizard-ui.test.tsx +362 -0
- package/src/features/setup/components/admin-account-step.tsx +205 -0
- package/src/features/setup/components/first-workspace-step.tsx +120 -0
- package/src/features/setup/components/index.ts +9 -0
- package/src/features/setup/components/instance-config-step.tsx +107 -0
- package/src/features/setup/components/mail-config-step.tsx +205 -0
- package/src/features/setup/components/sample-data-step.tsx +131 -0
- package/src/features/setup/components/service-health-step.tsx +180 -0
- package/src/features/setup/components/service-status-badge.tsx +50 -0
- package/src/features/setup/components/setup-progress.tsx +103 -0
- package/src/features/setup/components/setup-wizard.tsx +169 -0
- package/src/features/setup/hooks/index.ts +12 -0
- package/src/features/setup/hooks/use-complete-setup.ts +23 -0
- package/src/features/setup/hooks/use-create-admin.ts +25 -0
- package/src/features/setup/hooks/use-create-first-workspace.ts +24 -0
- package/src/features/setup/hooks/use-instance-status.ts +21 -0
- package/src/features/setup/hooks/use-save-instance-config.ts +23 -0
- package/src/features/setup/hooks/use-service-health.ts +21 -0
- package/src/features/setup/hooks/use-setup-wizard.ts +152 -0
- package/src/features/setup/hooks/use-workspace-mode.ts +19 -0
- package/src/features/setup/index.ts +30 -0
- package/src/features/setup/screens/index.ts +1 -0
- package/src/features/setup/screens/setup-screen.tsx +40 -0
- package/src/features/setup/types/index.ts +69 -0
- package/src/features/setup/utils/index.ts +78 -0
- package/src/features/team-settings/components/index.ts +39 -0
- package/src/features/team-settings/components/loading-states.tsx +296 -0
- package/src/features/team-settings/components/permission-guard.tsx +23 -0
- package/src/features/team-settings/components/settings-card.tsx +22 -0
- package/src/features/team-settings/components/settings-context-provider.tsx +51 -0
- package/src/features/team-settings/components/settings-error-boundary.tsx +366 -0
- package/src/features/team-settings/components/settings-navigation.tsx +87 -0
- package/src/features/team-settings/components/settings-section.tsx +23 -0
- package/src/features/team-settings/components/team-danger-zone.tsx +275 -0
- package/src/features/team-settings/components/team-information-form.tsx +116 -0
- package/src/features/team-settings/components/team-invitations-list.tsx +463 -0
- package/src/features/team-settings/components/team-members-list.tsx +342 -0
- package/src/features/team-settings/components/team-permission-guard.tsx +56 -0
- package/src/features/team-settings/components/team-setting-integrations.tsx +27 -0
- package/src/features/team-settings/components/team-setting-member.tsx +28 -0
- package/src/features/team-settings/components/team-settings-general.tsx +131 -0
- package/src/features/team-settings/components/transfer-ownership-modal.tsx +164 -0
- package/src/features/team-settings/components/unauthorized-access.tsx +52 -0
- package/src/features/team-settings/hooks/__tests__/use-team-settings.test.tsx +139 -0
- package/src/features/team-settings/hooks/index.ts +1 -0
- package/src/features/team-settings/hooks/use-team-settings.ts +148 -0
- package/src/features/team-settings/hooks/use-transfer-ownership.ts +45 -0
- package/src/features/team-settings/index.ts +25 -0
- package/src/features/team-settings/screens/index.ts +1 -0
- package/src/features/team-settings/screens/team-settings-screen.tsx +33 -0
- package/src/features/team-settings/types/index.ts +78 -0
- package/src/features/team-settings/utils/index.ts +6 -0
- package/src/features/team-settings/utils/mock-data.ts +40 -0
- package/src/features/teams/api/cancel-invitation.ts +25 -0
- package/src/features/teams/api/create-invitation.ts +28 -0
- package/src/features/teams/api/create-team.ts +14 -0
- package/src/features/teams/api/delete-team.ts +19 -0
- package/src/features/teams/api/get-invitations.ts +25 -0
- package/src/features/teams/api/get-team-members.ts +25 -0
- package/src/features/teams/api/get-team.ts +13 -0
- package/src/features/teams/api/get-teams.ts +19 -0
- package/src/features/teams/api/index.ts +49 -0
- package/src/features/teams/api/leave-team.ts +22 -0
- package/src/features/teams/api/remove-member.ts +25 -0
- package/src/features/teams/api/resend-invitation.ts +26 -0
- package/src/features/teams/api/switch-team.ts +13 -0
- package/src/features/teams/api/types.ts +122 -0
- package/src/features/teams/api/update-member-roles.ts +28 -0
- package/src/features/teams/api/update-team.ts +17 -0
- package/src/features/teams/components/create-team-dialog.tsx +105 -0
- package/src/features/teams/hooks/__tests__/cache-invalidation.property.test.tsx +268 -0
- package/src/features/teams/hooks/index.ts +35 -0
- package/src/features/teams/hooks/use-can-manage-members.ts +21 -0
- package/src/features/teams/hooks/use-can-manage-team.ts +21 -0
- package/src/features/teams/hooks/use-cancel-invitation.ts +52 -0
- package/src/features/teams/hooks/use-create-invitation.ts +59 -0
- package/src/features/teams/hooks/use-create-team.ts +38 -0
- package/src/features/teams/hooks/use-delete-team.ts +43 -0
- package/src/features/teams/hooks/use-invitations.ts +31 -0
- package/src/features/teams/hooks/use-leave-team.ts +43 -0
- package/src/features/teams/hooks/use-remove-member.ts +58 -0
- package/src/features/teams/hooks/use-resend-invitation.ts +52 -0
- package/src/features/teams/hooks/use-switch-team.ts +41 -0
- package/src/features/teams/hooks/use-team-members.ts +31 -0
- package/src/features/teams/hooks/use-team-permissions.ts +102 -0
- package/src/features/teams/hooks/use-team.ts +30 -0
- package/src/features/teams/hooks/use-teams.ts +26 -0
- package/src/features/teams/hooks/use-update-member-roles.ts +64 -0
- package/src/features/teams/hooks/use-update-team.ts +47 -0
- package/src/features/teams/index.ts +111 -0
- package/src/features/user-settings/actions/set-password.ts +63 -0
- package/src/features/user-settings/api/index.ts +16 -0
- package/src/features/user-settings/components/__tests__/security-settings.test.tsx +125 -0
- package/src/features/user-settings/components/delete-account-dialog.tsx +185 -0
- package/src/features/user-settings/components/index.ts +13 -0
- package/src/features/user-settings/components/integrations-list.tsx +152 -0
- package/src/features/user-settings/components/notification-preferences.tsx +112 -0
- package/src/features/user-settings/components/other-settings.tsx +126 -0
- package/src/features/user-settings/components/password-section.tsx +297 -0
- package/src/features/user-settings/components/security-settings.tsx +184 -0
- package/src/features/user-settings/components/user-preferences.tsx +146 -0
- package/src/features/user-settings/hooks/index.ts +8 -0
- package/src/features/user-settings/hooks/use-notification-preferences.ts +65 -0
- package/src/features/user-settings/hooks/use-user-preferences.ts +52 -0
- package/src/features/user-settings/index.ts +22 -0
- package/src/features/user-settings/screens/index.ts +11 -0
- package/src/features/user-settings/screens/integrations-screen.tsx +24 -0
- package/src/features/user-settings/screens/notifications-screen.tsx +29 -0
- package/src/features/user-settings/screens/other-settings-screen.tsx +24 -0
- package/src/features/user-settings/screens/setting-preferences-screen.tsx +24 -0
- package/src/features/user-settings/screens/user-settings-screen.tsx +23 -0
- package/src/features/user-settings/types/index.ts +42 -0
- package/src/features/user-settings/utils/index.ts +8 -0
- package/src/hooks/use-long-press.ts +196 -0
- package/src/hooks/use-media-upload.ts +95 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-team.ts +32 -0
- package/src/instrumentation.ts +14 -0
- package/src/lib/__tests__/auth-config.test.ts +166 -0
- package/src/lib/__tests__/config.test.ts +42 -0
- package/src/lib/__tests__/db.test.ts +101 -0
- package/src/lib/__tests__/env.property.test.ts +197 -0
- package/src/lib/__tests__/env.test.ts +177 -0
- package/src/lib/__tests__/health-check.test.ts +87 -0
- package/src/lib/__tests__/oauth-errors.test.ts +184 -0
- package/src/lib/__tests__/oauth-redirect.test.ts +224 -0
- package/src/lib/__tests__/oauth-scopes.test.ts +268 -0
- package/src/lib/__tests__/storage.test.ts +58 -0
- package/src/lib/__tests__/url-validator.test.ts +232 -0
- package/src/lib/api-client.ts +93 -0
- package/src/lib/auth-client.ts +5 -0
- package/src/lib/auth-config.ts +146 -0
- package/src/lib/auth.ts +209 -0
- package/src/lib/config.ts +228 -0
- package/src/lib/cors.ts +96 -0
- package/src/lib/date.ts +16 -0
- package/src/lib/db.ts +88 -0
- package/src/lib/env.ts +489 -0
- package/src/lib/feedback.ts +29 -0
- package/src/lib/health-check.ts +229 -0
- package/src/lib/logger.ts +204 -0
- package/src/lib/oauth-errors.ts +138 -0
- package/src/lib/performance.ts +367 -0
- package/src/lib/query-server.ts +35 -0
- package/src/lib/query.tsx +43 -0
- package/src/lib/resend.ts +36 -0
- package/src/lib/security-headers.ts +165 -0
- package/src/lib/setup-status.ts +34 -0
- package/src/lib/storage.ts +150 -0
- package/src/lib/supabase-client.ts +58 -0
- package/src/lib/testing/test-db.ts +75 -0
- package/src/lib/url-validator.ts +168 -0
- package/src/lib/utils.ts +6 -0
- package/src/mocks/README.md +42 -0
- package/src/mocks/activity.fixtures.ts +281 -0
- package/src/mocks/annotation.fixtures.ts +325 -0
- package/src/mocks/attachment.fixtures.ts +80 -0
- package/src/mocks/email.fixtures.ts +61 -0
- package/src/mocks/index.ts +33 -0
- package/src/mocks/issue.fixtures.ts +364 -0
- package/src/mocks/landing.fixtures.ts +118 -0
- package/src/mocks/notification.fixtures.ts +111 -0
- package/src/mocks/project-activity.fixtures.ts +69 -0
- package/src/mocks/project-invitation.fixtures.ts +95 -0
- package/src/mocks/project-member.fixtures.ts +93 -0
- package/src/mocks/project.fixtures.ts +249 -0
- package/src/mocks/settings.fixtures.ts +56 -0
- package/src/mocks/share.fixtures.ts +48 -0
- package/src/mocks/team-member.fixtures.ts +147 -0
- package/src/mocks/team.fixtures.ts +35 -0
- package/src/mocks/user-settings.fixtures.ts +77 -0
- package/src/mocks/user.fixtures.ts +21 -0
- package/src/providers/theme-provider.tsx +11 -0
- package/src/proxy/__tests__/proxy-setup-gate.test.ts +43 -0
- package/src/proxy.ts +169 -0
- package/src/server/annotations/__tests__/annotation-limit.property.test.ts +291 -0
- package/src/server/annotations/__tests__/attachment-deletion-cascade.property.test.ts +385 -0
- package/src/server/annotations/__tests__/comment-delete-authorization.property.test.ts +419 -0
- package/src/server/annotations/__tests__/sanitize.property.test.ts +302 -0
- package/src/server/annotations/annotation-service.ts +305 -0
- package/src/server/annotations/comment-service.ts +288 -0
- package/src/server/annotations/index.ts +61 -0
- package/src/server/annotations/permission-utils.ts +125 -0
- package/src/server/annotations/sanitize.ts +134 -0
- package/src/server/annotations/types.ts +161 -0
- package/src/server/audit/audit-service.ts +85 -0
- package/src/server/audit/index.ts +11 -0
- package/src/server/audit/types.ts +75 -0
- package/src/server/auth/__tests__/README.md +368 -0
- package/src/server/auth/__tests__/account-linking.integration.test.ts +410 -0
- package/src/server/auth/__tests__/auth-integration.test.ts +811 -0
- package/src/server/auth/__tests__/cookies.test.ts +337 -0
- package/src/server/auth/__tests__/login.property.test.ts +428 -0
- package/src/server/auth/__tests__/oauth-integration.test.ts +555 -0
- package/src/server/auth/__tests__/password.test.ts +194 -0
- package/src/server/auth/__tests__/rate-limiter.test.ts +450 -0
- package/src/server/auth/__tests__/rbac.test.ts +474 -0
- package/src/server/auth/__tests__/session.test.ts +599 -0
- package/src/server/auth/__tests__/signup.property.test.ts +224 -0
- package/src/server/auth/__tests__/token-encryption.test.ts +171 -0
- package/src/server/auth/__tests__/tokens.test.ts +476 -0
- package/src/server/auth/__tests__/verify-email.property.test.ts +372 -0
- package/src/server/auth/cookies.ts +184 -0
- package/src/server/auth/password.ts +94 -0
- package/src/server/auth/rate-limiter.ts +257 -0
- package/src/server/auth/rbac.ts +1168 -0
- package/src/server/auth/session.ts +392 -0
- package/src/server/auth/token-encryption.ts +201 -0
- package/src/server/auth/tokens.ts +397 -0
- package/src/server/db/schema/account.ts +21 -0
- package/src/server/db/schema/annotation-read-status.ts +57 -0
- package/src/server/db/schema/better-auth-verifications.ts +27 -0
- package/src/server/db/schema/email-jobs.ts +24 -0
- package/src/server/db/schema/index.ts +20 -0
- package/src/server/db/schema/instance-settings.ts +42 -0
- package/src/server/db/schema/issue-activities.ts +97 -0
- package/src/server/db/schema/issue-attachments.ts +101 -0
- package/src/server/db/schema/issues.ts +139 -0
- package/src/server/db/schema/notifications.ts +119 -0
- package/src/server/db/schema/project-activities.ts +116 -0
- package/src/server/db/schema/project-invitations.ts +34 -0
- package/src/server/db/schema/project-members.ts +29 -0
- package/src/server/db/schema/projects.ts +46 -0
- package/src/server/db/schema/sessions.ts +17 -0
- package/src/server/db/schema/team-invitations.ts +22 -0
- package/src/server/db/schema/team-members.ts +18 -0
- package/src/server/db/schema/teams.ts +15 -0
- package/src/server/db/schema/user-roles.ts +14 -0
- package/src/server/db/schema/users.ts +17 -0
- package/src/server/db/schema/verification-tokens.ts +15 -0
- package/src/server/email/README.md +258 -0
- package/src/server/email/__tests__/client.property.test.ts +218 -0
- package/src/server/email/__tests__/payload.property.test.ts +205 -0
- package/src/server/email/__tests__/queue.test.ts +407 -0
- package/src/server/email/__tests__/render-template.test.tsx +172 -0
- package/src/server/email/client.ts +70 -0
- package/src/server/email/index.ts +20 -0
- package/src/server/email/providers/console-provider.ts +43 -0
- package/src/server/email/providers/index.ts +5 -0
- package/src/server/email/providers/resend-provider.ts +59 -0
- package/src/server/email/providers/smtp-provider.ts +65 -0
- package/src/server/email/queue.ts +365 -0
- package/src/server/email/render-template.tsx +117 -0
- package/src/server/email/templates/layout.tsx +66 -0
- package/src/server/email/templates/ownership-transfer-email.tsx +75 -0
- package/src/server/email/templates/password-reset-email.tsx +72 -0
- package/src/server/email/templates/project-invitation-email.tsx +70 -0
- package/src/server/email/templates/security-alert-email.tsx +161 -0
- package/src/server/email/templates/team-invitation-email.tsx +68 -0
- package/src/server/email/templates/verification-email.tsx +61 -0
- package/src/server/email/templates/welcome-email.tsx +60 -0
- package/src/server/email/worker.ts +182 -0
- package/src/server/issues/activity-service.ts +422 -0
- package/src/server/issues/attachment-service.ts +379 -0
- package/src/server/issues/index.ts +68 -0
- package/src/server/issues/issue-service.ts +569 -0
- package/src/server/issues/types.ts +233 -0
- package/src/server/notifications/__tests__/notification-service.integration.test.ts +405 -0
- package/src/server/notifications/index.ts +13 -0
- package/src/server/notifications/notification-service.ts +526 -0
- package/src/server/notifications/types.ts +234 -0
- package/src/server/projects/__tests__/activity-logging.integration.test.ts +319 -0
- package/src/server/projects/__tests__/invitation-email.integration.test.ts +258 -0
- package/src/server/projects/__tests__/invitation-service.integration.test.ts +651 -0
- package/src/server/projects/__tests__/member-service.property.test.ts +397 -0
- package/src/server/projects/__tests__/project-service.property.test.ts +116 -0
- package/src/server/projects/activity-service.ts +548 -0
- package/src/server/projects/index.ts +11 -0
- package/src/server/projects/invitation-service.ts +773 -0
- package/src/server/projects/member-service.ts +458 -0
- package/src/server/projects/project-service.ts +491 -0
- package/src/server/projects/schemas.ts +310 -0
- package/src/server/projects/types.ts +166 -0
- package/src/server/projects/utils.ts +128 -0
- package/src/server/setup/__tests__/health-check.property.test.ts +70 -0
- package/src/server/setup/__tests__/sample-data.property.test.ts +82 -0
- package/src/server/setup/__tests__/setup.property.test.ts +95 -0
- package/src/server/setup/health-check-service.ts +294 -0
- package/src/server/setup/index.ts +35 -0
- package/src/server/setup/sample-data-service.ts +233 -0
- package/src/server/setup/setup-service.ts +229 -0
- package/src/server/setup/types.ts +96 -0
- package/src/server/teams/__tests__/export.property.test.ts +542 -0
- package/src/server/teams/__tests__/get-members.integration.test.ts +105 -0
- package/src/server/teams/__tests__/invitation-flow.integration.test.ts +402 -0
- package/src/server/teams/__tests__/invitations.property.test.ts +235 -0
- package/src/server/teams/__tests__/member-management-flow.integration.test.ts +306 -0
- package/src/server/teams/__tests__/members.property.test.ts +180 -0
- package/src/server/teams/__tests__/ownership-transfer.property.test.ts +173 -0
- package/src/server/teams/__tests__/resource-limits.property.test.ts +382 -0
- package/src/server/teams/__tests__/team-context-management.integration.test.ts +396 -0
- package/src/server/teams/__tests__/team-context.property.test.ts +854 -0
- package/src/server/teams/__tests__/team-creation-flow.integration.test.ts +310 -0
- package/src/server/teams/__tests__/team-creation.property.test.ts +280 -0
- package/src/server/teams/errors.ts +396 -0
- package/src/server/teams/export-service.ts +383 -0
- package/src/server/teams/index.ts +10 -0
- package/src/server/teams/invitation-service.ts +708 -0
- package/src/server/teams/member-service.ts +334 -0
- package/src/server/teams/resource-limits.ts +211 -0
- package/src/server/teams/slug.ts +58 -0
- package/src/server/teams/team-context.ts +648 -0
- package/src/server/teams/team-service.ts +660 -0
- package/src/server/teams/types.ts +81 -0
- package/src/server/teams/validation.ts +209 -0
- package/src/styles/globals.css +160 -0
- package/src/types/deployment.ts +39 -0
- package/supabase/config.toml +357 -0
- package/supabase/seed.sql +480 -0
- package/tests/e2e/.gitkeep +0 -0
- package/tests/e2e/QUICK_START.md +98 -0
- package/tests/e2e/README.md +301 -0
- package/tests/e2e/auth.spec.ts +583 -0
- package/tests/e2e/global-setup.ts +23 -0
- package/tests/e2e/global-teardown.ts +23 -0
- package/tests/e2e/helpers/auth-helpers.ts +310 -0
- package/tests/e2e/helpers/test-fixtures.ts +286 -0
- package/tests/e2e/smoke-test.spec.ts +330 -0
- package/tsconfig.json +48 -0
- package/vitest.config.ts +50 -0
- package/vitest.setup.ts +56 -0
- package/dist/index.js +0 -778
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# Project Structure
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Feature-first architecture following the scaffolding guidelines in `AGENTS.md`. Code is organized by product feature rather than technical type, with strict layering and clear boundaries.
|
|
6
|
+
|
|
7
|
+
## Directory Layout
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
src/
|
|
11
|
+
├── app/ # Next.js App Router (routing only)
|
|
12
|
+
│ ├── layout.tsx # Root layout (html, body, global providers)
|
|
13
|
+
│ ├── (public)/ # Public routes (no auth required)
|
|
14
|
+
│ │ ├── layout.tsx # Public shell
|
|
15
|
+
│ │ ├── sign-in/page.tsx
|
|
16
|
+
│ │ └── sign-up/page.tsx
|
|
17
|
+
│ ├── (protected)/ # Protected routes (auth required)
|
|
18
|
+
│ │ ├── layout.tsx # Auth gate (server-side session check)
|
|
19
|
+
│ │ ├── onboarding/page.tsx # Post-auth team setup (no team required)
|
|
20
|
+
│ │ ├── settings/ # User settings
|
|
21
|
+
│ │ └── (team)/ # Team-scoped routes
|
|
22
|
+
│ │ ├── projects/page.tsx
|
|
23
|
+
│ │ └── team/settings/ # Team settings
|
|
24
|
+
│ └── api/ # API route handlers
|
|
25
|
+
│ └── auth/ # Auth endpoints
|
|
26
|
+
│
|
|
27
|
+
├── features/ # Feature modules (mini-packages)
|
|
28
|
+
│ ├── <feature>/
|
|
29
|
+
│ │ ├── api/ # Fetchers + DTO schemas (no React)
|
|
30
|
+
│ │ ├── hooks/ # React Query/SWR wrappers
|
|
31
|
+
│ │ ├── components/ # Feature-specific UI
|
|
32
|
+
│ │ ├── screens/ # Screen components (thin, compose hooks)
|
|
33
|
+
│ │ ├── types/ # Domain models
|
|
34
|
+
│ │ ├── utils/ # Feature-specific helpers
|
|
35
|
+
│ │ └── index.ts # Barrel export (public API)
|
|
36
|
+
│ │
|
|
37
|
+
│ ├── annotations/ # Visual annotation system
|
|
38
|
+
│ ├── auth/ # Authentication & onboarding
|
|
39
|
+
│ ├── issues/ # Issue tracking & details
|
|
40
|
+
│ ├── projects/ # Project management
|
|
41
|
+
│ ├── teams/ # Team creation
|
|
42
|
+
│ ├── team-settings/ # Team settings screens
|
|
43
|
+
│ └── user-settings/ # User preferences & settings
|
|
44
|
+
│
|
|
45
|
+
├── components/
|
|
46
|
+
│ ├── ui/ # shadcn primitives (Button, Dialog, etc.)
|
|
47
|
+
│ └── shared/ # Cross-feature widgets
|
|
48
|
+
│ ├── headers/ # AppHeader, breadcrumbs
|
|
49
|
+
│ ├── sidebar/ # AppSidebar, navigation
|
|
50
|
+
│ ├── notifications/ # Notification system
|
|
51
|
+
│ └── settings-sidebar/ # Settings navigation
|
|
52
|
+
│
|
|
53
|
+
├── config/ # Single sources of truth (pure data)
|
|
54
|
+
│ ├── quotas.ts # Resource limits (Instance Config)
|
|
55
|
+
│ ├── roles.ts # RBAC roles & permissions
|
|
56
|
+
│ ├── workflow.ts # Issue workflow states
|
|
57
|
+
│ ├── settings-nav.ts # Settings navigation
|
|
58
|
+
│ ├── team-settings-nav.ts # Team settings navigation
|
|
59
|
+
│ └── issue-options.ts # Issue metadata options
|
|
60
|
+
│
|
|
61
|
+
├── lib/ # App-wide utilities
|
|
62
|
+
│ ├── api-client.ts # Fetch wrapper (credentials: 'include')
|
|
63
|
+
│ ├── query.tsx # React Query setup
|
|
64
|
+
│ ├── utils.ts # cn() helper (clsx + tailwind-merge)
|
|
65
|
+
│ ├── env.ts # Environment variables
|
|
66
|
+
│ ├── logger.ts # Logging utility
|
|
67
|
+
│ └── performance.ts # Performance monitoring
|
|
68
|
+
│
|
|
69
|
+
├── server/ # Server-only logic (auth, DB, RBAC)
|
|
70
|
+
│ ├── auth/ # Session, tokens, RBAC
|
|
71
|
+
│ │ ├── cookies.ts # httpOnly cookie management
|
|
72
|
+
│ │ ├── password.ts # Argon2 password hashing
|
|
73
|
+
│ │ ├── rate-limiter.ts # Redis-based rate limiting
|
|
74
|
+
│ │ ├── rbac.ts # Role-based access control
|
|
75
|
+
│ │ ├── session.ts # Session management
|
|
76
|
+
│ │ └── tokens.ts # JWT token handling
|
|
77
|
+
│ ├── db/ # Database client & schema
|
|
78
|
+
│ │ ├── schema/ # Drizzle schema definitions
|
|
79
|
+
│ │ └── index.ts # Database client
|
|
80
|
+
│ ├── email/ # Email service
|
|
81
|
+
│ │ ├── client.ts # Resend client
|
|
82
|
+
│ │ ├── queue.ts # Email queue management
|
|
83
|
+
│ │ ├── templates/ # React Email templates
|
|
84
|
+
│ │ └── worker.ts # Background email processor
|
|
85
|
+
│ └── teams/ # Team management services
|
|
86
|
+
│ ├── team-service.ts # Core team operations
|
|
87
|
+
│ ├── member-service.ts # Member management
|
|
88
|
+
│ ├── invitation-service.ts # Invitation handling
|
|
89
|
+
│ ├── member-counts.ts # Member counting logic
|
|
90
|
+
│ └── resource-limits.ts # Resource usage limits
|
|
91
|
+
│
|
|
92
|
+
├── mocks/ # Mock data & fixtures
|
|
93
|
+
│ ├── issue.fixtures.ts
|
|
94
|
+
│ ├── project.fixtures.ts
|
|
95
|
+
│ ├── team.fixtures.ts
|
|
96
|
+
│ ├── user.fixtures.ts
|
|
97
|
+
│ ├── annotation.fixtures.ts
|
|
98
|
+
│ └── index.ts
|
|
99
|
+
│
|
|
100
|
+
├── hooks/ # Global hooks
|
|
101
|
+
│ ├── use-mobile.ts
|
|
102
|
+
│ ├── use-team.ts
|
|
103
|
+
│ └── use-long-press.ts
|
|
104
|
+
│
|
|
105
|
+
├── providers/ # React context providers
|
|
106
|
+
│ └── theme-provider.tsx
|
|
107
|
+
│
|
|
108
|
+
├── styles/
|
|
109
|
+
│ └── globals.css # Global styles & Tailwind imports
|
|
110
|
+
│
|
|
111
|
+
└── types/ # Global TypeScript types
|
|
112
|
+
|
|
113
|
+
cli/ # CLI package (published independently to npm)
|
|
114
|
+
│ ├── index.ts # Entry point — shebang #!/usr/bin/env node
|
|
115
|
+
│ ├── commands/ # Subcommands: init, up, down, reset, purge
|
|
116
|
+
│ ├── lib/ # Shared CLI utilities (ui, prompts, docker, supabase…)
|
|
117
|
+
│ ├── templates/ # Config templates copied by `ui-syncup init`
|
|
118
|
+
│ ├── package.json # Standalone npm package manifest (NOT private)
|
|
119
|
+
│ ├── tsup.config.ts # Build config: bundles cli/ → dist/index.js
|
|
120
|
+
│ ├── .npmignore # Excludes TS source and tests from npm tarball
|
|
121
|
+
│ └── dist/ # GENERATED — compiled CJS bundle (gitignored)
|
|
122
|
+
│ └── index.js # What npm users actually run
|
|
123
|
+
│
|
|
124
|
+
docs/ # Architecture documentation
|
|
125
|
+
tests/ # Test files
|
|
126
|
+
drizzle/ # Database migrations
|
|
127
|
+
supabase/ # Supabase configuration and seed data
|
|
128
|
+
public/ # Static assets
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Proxy (formerly middleware)
|
|
132
|
+
|
|
133
|
+
- Next.js 16 uses `src/proxy.ts` instead of `middleware.ts`. Keep the exported handler named `proxy` and avoid multiple files—the Next codemod (`npx @next/codemod@canary middleware-to-proxy`) can help if a legacy `middleware.ts` still exists.
|
|
134
|
+
- Treat the proxy as a last-resort HTTP boundary: read/modify requests, set headers, or do quick auth redirects, but don’t put feature logic there. Prefer App Router route handlers, rewrites, or server components for most behaviors.
|
|
135
|
+
- Keep the proxy stateless and fast; because it runs for every matching request, avoid heavy computations and consolidate cross-cutting checks (auth guard, header tweaks) behind clear guards in `src/proxy.ts`.
|
|
136
|
+
- Document any non-trivial proxy guard (why it exists, what routes it affects) in your feature’s ADR or docs so future maintainers understand why middleware couldn’t suffice.
|
|
137
|
+
|
|
138
|
+
## Layer Contracts (Import Rules)
|
|
139
|
+
|
|
140
|
+
- **app/** can import: `features/*`, `components/*`, `hooks`, `lib`, `config`
|
|
141
|
+
- **features/\<name\>/components** can import: own `hooks`, `types`, `utils` + `components/ui`, `components/shared`, `lib`, `config`
|
|
142
|
+
- **features/\<name\>/hooks** can import: own `api`, `types`, `utils` + `lib`
|
|
143
|
+
- **features/\<name\>/api** can import: `lib`, own `types`/`utils` (no React)
|
|
144
|
+
- **components/ui** can import: `lib`, `utils` (never `features/*`)
|
|
145
|
+
- **components/shared** can import: `components/ui`, `lib`, `utils` (never `features/*`)
|
|
146
|
+
- **server/** is server-only; never import from client components
|
|
147
|
+
|
|
148
|
+
## Feature Module Anatomy
|
|
149
|
+
|
|
150
|
+
Each feature follows this structure:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
features/<feature>/
|
|
154
|
+
├── api/ # Network layer
|
|
155
|
+
│ ├── get-<resource>.ts # GET operations
|
|
156
|
+
│ ├── create-<resource>.ts # POST operations
|
|
157
|
+
│ ├── update-<resource>.ts # PUT/PATCH operations
|
|
158
|
+
│ ├── delete-<resource>.ts # DELETE operations
|
|
159
|
+
│ ├── types.ts # DTO schemas (Zod)
|
|
160
|
+
│ └── index.ts # Barrel export
|
|
161
|
+
├── hooks/ # React hooks
|
|
162
|
+
│ ├── use-<resource>.ts # Query hook
|
|
163
|
+
│ ├── use-<resources>.ts # List query hook
|
|
164
|
+
│ ├── use-create-<resource>.ts # Mutation hook
|
|
165
|
+
│ └── index.ts # Barrel export
|
|
166
|
+
├── components/ # Presentational components
|
|
167
|
+
│ ├── <feature>-list.tsx
|
|
168
|
+
│ ├── <feature>-detail.tsx
|
|
169
|
+
│ ├── <feature>-form.tsx
|
|
170
|
+
│ └── index.ts # Barrel export
|
|
171
|
+
├── screens/ # Screen components (thin)
|
|
172
|
+
│ ├── <feature>-screen.tsx # Main screen
|
|
173
|
+
│ └── index.ts # Barrel export
|
|
174
|
+
├── types/ # Domain types
|
|
175
|
+
│ └── index.ts
|
|
176
|
+
├── utils/ # Feature utilities
|
|
177
|
+
│ └── index.ts
|
|
178
|
+
└── index.ts # Public API (barrel)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## RBAC & Plans
|
|
182
|
+
|
|
183
|
+
- `config/roles.ts` declares the canonical roles referenced in `.ai/steering/product.md` (e.g., `PROJECT_EDITOR`, `TEAM_ADMIN`). Keep that file in sync with the product doc whenever plan limits or role names change.
|
|
184
|
+
- `server/auth/rbac.ts` enforces those roles on the backend and should reference the same role/permission enums used by `features/auth/hooks/use-session.ts` and the guarding middleware(proxy) in `app/(protected)/layout.tsx`.
|
|
185
|
+
- When a product role gains or loses permissions for a feature, update the adjacent `features/<feature>/components` screens (and tests) so the UI matches what the RBAC guard allows.
|
|
186
|
+
- Configuration changes should centralize in `config/` so logic, UI copy, and enforcement all read from the same source of truth.
|
|
187
|
+
|
|
188
|
+
## Naming Conventions
|
|
189
|
+
|
|
190
|
+
- **Files**: kebab-case (`create-issue-dialog.tsx`, `use-issues.ts`)
|
|
191
|
+
- **Components**: PascalCase (`CreateIssueDialog`)
|
|
192
|
+
- **Hooks**: camelCase with `use` prefix (`useIssue`, `useIssues`)
|
|
193
|
+
- **API functions**: verb-noun (`getIssues`, `createIssue`, `updateIssue`)
|
|
194
|
+
- **Types**: PascalCase (`Issue`, `IssueStatus`, `IssuePermissions`)
|
|
195
|
+
- **Constants**: UPPER_SNAKE_CASE (`ISSUE_WORKFLOW`, `PLANS`)
|
|
196
|
+
|
|
197
|
+
## Page Structure (Thin Pages Pattern)
|
|
198
|
+
|
|
199
|
+
Pages are thin route handlers that:
|
|
200
|
+
1. Read `searchParams`, cookies, headers (server component)
|
|
201
|
+
2. Perform auth/tenant gating
|
|
202
|
+
3. Light Zod validation
|
|
203
|
+
4. Render a single feature Screen with minimal props
|
|
204
|
+
5. Own `loading.tsx`, `error.tsx`, `not-found.tsx`
|
|
205
|
+
|
|
206
|
+
Example:
|
|
207
|
+
```tsx
|
|
208
|
+
// app/(protected)/issues/page.tsx
|
|
209
|
+
import { IssuesListScreen } from '@/features/issues'
|
|
210
|
+
|
|
211
|
+
export default function IssuesPage({ searchParams }) {
|
|
212
|
+
const teamId = cookies().get('team_id')?.value
|
|
213
|
+
if (!teamId) redirect('/select-team')
|
|
214
|
+
return <IssuesListScreen teamId={teamId} search={searchParams} />
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Barrel Exports
|
|
219
|
+
|
|
220
|
+
Each feature exposes its public API via `index.ts`:
|
|
221
|
+
```ts
|
|
222
|
+
// features/issues/index.ts
|
|
223
|
+
export { IssueDetailsScreen } from './screens'
|
|
224
|
+
export { IssuesList, IssuesCreateDialog } from './components'
|
|
225
|
+
export { useIssues, useIssue, useCreateIssue } from './hooks'
|
|
226
|
+
export type { Issue, IssueStatus, IssuePermissions } from './types'
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Mock Data Strategy
|
|
230
|
+
|
|
231
|
+
- All mock data lives in `src/mocks/*`
|
|
232
|
+
- Domain-based files (`team.fixtures.ts`, `issue.fixtures.ts`)
|
|
233
|
+
- Used for visual UI development before backend implementation
|
|
234
|
+
- Easy to swap with real API calls later
|
|
235
|
+
|
|
236
|
+
## Mock Data Maintenance
|
|
237
|
+
|
|
238
|
+
- Tie each fixture set to the feature that consumes it (e.g., `features/issues` imports from `src/mocks/issue.fixtures`) so you instinctively revise the fixture whenever the feature’s Zod DTOs or API responses change.
|
|
239
|
+
- When a DTO schema in `features/<feature>/api/types.ts` is updated, add a checklist item to refresh the matching fixture file and scenario exports to keep UI mockups accurate.
|
|
240
|
+
- Consider a lightweight lint/story checkpoint (e.g., a `vitest` smoke test or Storybook story that renders the fixtures) so stale mock data is caught before it drifts from real API surfaces.
|
|
241
|
+
|
|
242
|
+
## Testing Structure
|
|
243
|
+
|
|
244
|
+
- Unit/integration tests: Co-located with source files in `__tests__/` folders or as `*.test.ts(x)` files
|
|
245
|
+
- E2E tests: `tests/e2e/*.spec.ts`
|
|
246
|
+
- Test fixtures: `tests/e2e/helpers/test-fixtures.ts`
|
|
247
|
+
- Property-based tests: Use `*.property.test.ts` naming convention
|
|
248
|
+
- Mock data: `src/mocks/*.fixtures.ts`
|
|
249
|
+
|
|
250
|
+
Example test locations:
|
|
251
|
+
```
|
|
252
|
+
src/
|
|
253
|
+
├── lib/
|
|
254
|
+
│ ├── __tests__/
|
|
255
|
+
│ │ ├── auth-config.test.ts
|
|
256
|
+
│ │ └── logger.property.test.ts
|
|
257
|
+
│ └── auth-config.ts
|
|
258
|
+
├── server/
|
|
259
|
+
│ └── teams/
|
|
260
|
+
│ ├── __tests__/
|
|
261
|
+
│ │ ├── team-service.test.ts
|
|
262
|
+
│ │ └── team-context.property.test.ts
|
|
263
|
+
│ └── team-service.ts
|
|
264
|
+
└── features/
|
|
265
|
+
└── issues/
|
|
266
|
+
└── components/
|
|
267
|
+
├── issue-list.tsx
|
|
268
|
+
└── issue-list.test.tsx
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Documentation
|
|
272
|
+
|
|
273
|
+
- Feature-level docs in `features/<feature>/docs/`
|
|
274
|
+
- Architecture docs in `docs/`
|
|
275
|
+
- See `AGENTS.md` for complete scaffolding guidelines
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Tech Stack
|
|
2
|
+
|
|
3
|
+
## Framework & Runtime
|
|
4
|
+
|
|
5
|
+
- **Next.js 16** (App Router) - React framework with server-first routing
|
|
6
|
+
- **React 19.2** - UI library
|
|
7
|
+
- **TypeScript 5** - Type safety
|
|
8
|
+
- **Node 20 LTS** - Runtime (see `.nvmrc`)
|
|
9
|
+
- **Bun** - Package manager (preferred over npm/yarn)
|
|
10
|
+
|
|
11
|
+
## UI & Styling
|
|
12
|
+
|
|
13
|
+
- **shadcn/ui** - Component library built on Radix UI primitives
|
|
14
|
+
- **Radix UI** - Headless accessible components
|
|
15
|
+
- **Tailwind CSS 4** - Utility-first styling
|
|
16
|
+
- **Framer Motion** (motion) - Animations
|
|
17
|
+
- **Lucide React** + **Remix Icon** - Icon libraries
|
|
18
|
+
- **next-themes** - Dark mode support
|
|
19
|
+
|
|
20
|
+
## Data & State
|
|
21
|
+
|
|
22
|
+
- **TanStack Query (React Query) 5** - Server state management, caching, mutations
|
|
23
|
+
- **Zod** - Runtime validation and type inference
|
|
24
|
+
- **SWR** - Alternative data fetching (used in some features)
|
|
25
|
+
- **Supabase Realtime** - Real-time database updates via WebSockets
|
|
26
|
+
|
|
27
|
+
## Forms & Validation
|
|
28
|
+
|
|
29
|
+
- **React Hook Form** - Form state management
|
|
30
|
+
- **@hookform/resolvers** - Zod integration for forms
|
|
31
|
+
|
|
32
|
+
## Database
|
|
33
|
+
|
|
34
|
+
- **PostgreSQL 15** - Primary database via Supabase
|
|
35
|
+
- **Drizzle ORM** - Type-safe database queries and migrations
|
|
36
|
+
- **Supabase CLI** - Local development environment (replaces docker-compose)
|
|
37
|
+
- **Supabase** - PostgreSQL hosting, Auth, Storage, and additional services
|
|
38
|
+
|
|
39
|
+
## Storage
|
|
40
|
+
|
|
41
|
+
- **Cloudflare R2** - S3-compatible object storage for file uploads
|
|
42
|
+
- **AWS SDK** - S3 client for R2 integration
|
|
43
|
+
|
|
44
|
+
## Auth & Security
|
|
45
|
+
|
|
46
|
+
- **better-auth** - Authentication library with session management
|
|
47
|
+
- **@node-rs/argon2** - Password hashing
|
|
48
|
+
- **ioredis** - Redis client for rate limiting and session storage
|
|
49
|
+
|
|
50
|
+
## Email
|
|
51
|
+
|
|
52
|
+
- **Resend** - Transactional email service
|
|
53
|
+
- **React Email** - Email template components
|
|
54
|
+
|
|
55
|
+
## Testing
|
|
56
|
+
|
|
57
|
+
- **Vitest** - Unit and integration tests (with jsdom/happy-dom)
|
|
58
|
+
- **@testing-library/react** - Component testing utilities
|
|
59
|
+
- **Playwright** - E2E browser tests
|
|
60
|
+
- **fast-check** - Property-based testing
|
|
61
|
+
- **pg-mem** - In-memory PostgreSQL for testing
|
|
62
|
+
|
|
63
|
+
### Testing Rules
|
|
64
|
+
|
|
65
|
+
- **ALWAYS** use `bun run test` (or `vitest`) for unit tests
|
|
66
|
+
- **NEVER** use `bun test` (Bun's native runner) - it ignores test config and can corrupt your local database
|
|
67
|
+
- Tests use in-memory database by default (safe)
|
|
68
|
+
- E2E tests (`bun run test:ui`) use local database
|
|
69
|
+
|
|
70
|
+
## CLI Tooling (cli/ package)
|
|
71
|
+
|
|
72
|
+
The `cli/` directory is a **standalone npm package** published separately from the Next.js app.
|
|
73
|
+
|
|
74
|
+
- **tsup** - Bundles `cli/index.ts` and all imports into `cli/dist/index.js` (CJS, Node 20)
|
|
75
|
+
- **commander** - CLI argument parsing. Listed as a runtime `dependency` (not bundled) because its dual ESM+CJS exports cause class-instance conflicts when bundled
|
|
76
|
+
- All other CLI deps (`dotenv`, `postgres`, `zod`) are bundled — no runtime install needed
|
|
77
|
+
|
|
78
|
+
**Key files:**
|
|
79
|
+
- `cli/package.json` — npm package manifest; `"bin": { "ui-syncup": "dist/index.js" }`, `"files": ["dist", "templates"]`
|
|
80
|
+
- `cli/tsup.config.ts` — `shims: true` (for `import.meta.url` → CJS), `external: ["commander"]`
|
|
81
|
+
- `cli/.npmignore` — excludes TS source and `__tests__/` from the published tarball
|
|
82
|
+
|
|
83
|
+
**Build & publish workflow:**
|
|
84
|
+
```bash
|
|
85
|
+
cd cli
|
|
86
|
+
bun run build # compiles → dist/index.js
|
|
87
|
+
npm publish --dry-run # preview tarball (auto-runs build via prepublishOnly)
|
|
88
|
+
npm publish --access public
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Local testing:**
|
|
92
|
+
```bash
|
|
93
|
+
cd cli && npm link # simulates global install
|
|
94
|
+
ui-syncup --help
|
|
95
|
+
npm unlink -g ui-syncup
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Template resolution after bundling:** `findTemplatePath()` in `cli/lib/filesystem.ts` checks `__dirname/../templates/` first (bundled layout) then falls back to the dev source layout.
|
|
99
|
+
|
|
100
|
+
**Version resolution after bundling:** `getVersion()` in `cli/lib/constants.ts` searches candidate `package.json` paths ordered for the bundled layout (`dist/` → `../package.json`) before the dev layout.
|
|
101
|
+
|
|
102
|
+
## Dev Tools
|
|
103
|
+
|
|
104
|
+
- **ESLint 9** - Linting
|
|
105
|
+
- **Prettier** - Code formatting
|
|
106
|
+
- **TypeScript** - Type checking
|
|
107
|
+
|
|
108
|
+
## Common Commands
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Development
|
|
112
|
+
bun dev # Start dev server (http://localhost:3000)
|
|
113
|
+
bun build # Production build (Next.js app)
|
|
114
|
+
bun start # Start production server
|
|
115
|
+
|
|
116
|
+
# Code Quality
|
|
117
|
+
bun typecheck # Run TypeScript compiler checks
|
|
118
|
+
bun lint # Run ESLint
|
|
119
|
+
bun format # Format code with Prettier
|
|
120
|
+
|
|
121
|
+
# Testing (⚠️ Use 'bun run test', NOT 'bun test')
|
|
122
|
+
bun run test # Run unit tests (Vitest) - SAFE
|
|
123
|
+
bun run test:watch # Run tests in watch mode
|
|
124
|
+
bun run test:ui # Run E2E tests (Playwright)
|
|
125
|
+
|
|
126
|
+
# Database
|
|
127
|
+
bun run db:generate # Generate Drizzle migrations
|
|
128
|
+
bun run db:migrate # Run migrations
|
|
129
|
+
bun run db:studio # Open Drizzle Studio
|
|
130
|
+
bun run db:seed # Seed database with test data
|
|
131
|
+
|
|
132
|
+
# Supabase (Local Development - replaces docker-compose)
|
|
133
|
+
bun run supabase:start # Start local Supabase stack (Postgres, Studio, Auth, Storage)
|
|
134
|
+
bun run supabase:stop # Stop local Supabase
|
|
135
|
+
bun run supabase:status # Check Supabase status and get connection details
|
|
136
|
+
|
|
137
|
+
# Validation
|
|
138
|
+
bun run validate-env # Validate environment variables
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## CLI Commands (run from cli/ directory)
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
cd cli
|
|
145
|
+
bun run build # Compile CLI → dist/index.js via tsup
|
|
146
|
+
npm publish --dry-run # Preview npm tarball without publishing
|
|
147
|
+
npm publish --access public # Publish to npm registry
|
|
148
|
+
npm link # Install CLI globally for local testing
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Path Aliases
|
|
152
|
+
|
|
153
|
+
- `@/*` maps to `./src/*` for absolute imports
|
|
154
|
+
|
|
155
|
+
## Key Libraries
|
|
156
|
+
|
|
157
|
+
- **class-variance-authority** - Component variant management
|
|
158
|
+
- **clsx** + **tailwind-merge** - Conditional className utilities (via `cn()` helper)
|
|
159
|
+
- **cmdk** - Command palette component
|
|
160
|
+
- **date-fns** - Date utilities
|
|
161
|
+
- **sonner** - Toast notifications
|
|
162
|
+
- **uuid** - Unique ID generation
|
|
163
|
+
|
|
164
|
+
## Environment Variables
|
|
165
|
+
|
|
166
|
+
- Validated with Zod in `src/lib/env.ts` at build time
|
|
167
|
+
- Local development: Copy `.env.example` to `.env.local`
|
|
168
|
+
- Vercel deployment: Configure in Project Settings → Environment Variables
|
|
169
|
+
- Run `bun run validate-env` to check configuration
|
|
170
|
+
- See `docs/ENVIRONMENT_CONFIG.md` for detailed setup
|
|
171
|
+
|
|
172
|
+
## Local Development
|
|
173
|
+
|
|
174
|
+
- **Supabase CLI** is used for local development (not docker-compose)
|
|
175
|
+
- Run `bun run supabase:start` to spin up local Postgres, Auth, Storage, Studio, and more
|
|
176
|
+
- Supabase Studio available at http://127.0.0.1:54323 for database management
|
|
177
|
+
- Local database runs on port 54322 (not 5432)
|
|
178
|
+
- See `docs/SUPABASE_LOCAL_SETUP.md` for detailed setup instructions
|
|
179
|
+
|
|
180
|
+
## Architecture Notes
|
|
181
|
+
|
|
182
|
+
- Server components by default; use `"use client"` only when needed
|
|
183
|
+
- API routes in `src/app/api/*` for backend endpoints
|
|
184
|
+
- Mock data in `src/mocks/*` for development/testing
|
|
185
|
+
- Feature-first organization in `src/features/*`
|
|
186
|
+
- Prefer `lib/logger` and `lib/performance` when you add instrumentation or observability hooks so new pages stay consistent with the shared plumbing rather than introducing ad-hoc console/log statements
|
|
187
|
+
- httpOnly cookies for session/token storage (never localStorage)
|
|
188
|
+
- All network boundaries validated with Zod schemas
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-architect
|
|
3
|
+
description: Use this agent when you need expert guidance on database administration, architecture decisions, performance optimization, high-availability setup, disaster recovery planning, query tuning, index strategies, replication configuration, backup solutions, monitoring setup, capacity planning, or troubleshooting database-related issues. Examples:\n\n<example>\nContext: User is designing a new application that requires a highly available database setup.\nuser: "I'm building a critical financial application that needs to handle 10,000 transactions per second with zero data loss. What database architecture should I use?"\nassistant: "Let me use the Task tool to launch the database-architect agent to provide expert guidance on the optimal high-availability architecture for your requirements."\n<commentary>\nThe user needs expert database architecture advice for a high-availability, high-transaction system. This matches the database-architect agent's core expertise in high-availability architectures and performance requirements.\n</commentary>\n</example>\n\n<example>\nContext: User has just written database migration scripts and schema changes.\nuser: "I've created these migration scripts for our user authentication tables"\nassistant: "Great! Now let me use the database-architect agent to review your migration scripts for performance implications, indexing strategies, and potential issues."\n<commentary>\nAfter database-related code is written, proactively launch the database-architect agent to review for performance optimization, proper indexing, transaction handling, and disaster recovery considerations.\n</commentary>\n</example>\n\n<example>\nContext: User mentions slow database queries in their application.\nuser: "Our application is experiencing slow response times and I think it might be database-related"\nassistant: "I'm going to use the Task tool to launch the database-architect agent to help diagnose and resolve the performance issues."\n<commentary>\nPerformance problems are a core concern for the database-architect agent. Launch it to provide systematic diagnosis and optimization recommendations.\n</commentary>\n</example>
|
|
4
|
+
tools: Edit, Write, NotebookEdit, Bash, Glob, Grep, Read
|
|
5
|
+
model: sonnet
|
|
6
|
+
color: yellow
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a senior database administrator with 15+ years of experience specializing in PostgreSQL and mastery across major database systems including MySQL, Oracle, SQL Server, MongoDB, and Redis. Your expertise encompasses the complete lifecycle of database systems with particular focus on high-availability architectures, performance optimization, and disaster recovery.
|
|
10
|
+
|
|
11
|
+
## Core Competencies
|
|
12
|
+
|
|
13
|
+
### High-Availability Architecture
|
|
14
|
+
- Design and implement multi-region, multi-master replication topologies
|
|
15
|
+
- Configure automatic failover mechanisms with sub-30-second recovery times
|
|
16
|
+
- Architect solutions for 99.99%+ uptime requirements
|
|
17
|
+
- Implement connection pooling, load balancing, and read replica strategies
|
|
18
|
+
- Design zero-downtime deployment and upgrade procedures
|
|
19
|
+
|
|
20
|
+
### Performance Optimization
|
|
21
|
+
- Analyze and optimize queries to achieve sub-second response times
|
|
22
|
+
- Design optimal indexing strategies (B-tree, GiST, GIN, BRIN, partial, covering)
|
|
23
|
+
- Tune database parameters for specific workload characteristics
|
|
24
|
+
- Implement query plan analysis and optimization workflows
|
|
25
|
+
- Configure connection pooling and statement caching
|
|
26
|
+
- Design efficient partitioning and sharding strategies
|
|
27
|
+
- Optimize storage layouts and tablespace management
|
|
28
|
+
|
|
29
|
+
### Disaster Recovery & Backup
|
|
30
|
+
- Design comprehensive backup strategies (full, incremental, differential, continuous archiving)
|
|
31
|
+
- Implement point-in-time recovery (PITR) solutions
|
|
32
|
+
- Create and test disaster recovery runbooks with defined RTOs and RPOs
|
|
33
|
+
- Design cross-region backup replication and verification
|
|
34
|
+
- Implement automated backup testing and validation
|
|
35
|
+
|
|
36
|
+
### Monitoring & Observability
|
|
37
|
+
- Configure comprehensive monitoring for performance metrics, resource utilization, and health indicators
|
|
38
|
+
- Design alerting strategies with appropriate thresholds and escalation paths
|
|
39
|
+
- Implement query performance tracking and slow query logging
|
|
40
|
+
- Set up proactive capacity planning and forecasting
|
|
41
|
+
- Monitor replication lag, connection pools, and transaction rates
|
|
42
|
+
|
|
43
|
+
## Operational Approach
|
|
44
|
+
|
|
45
|
+
When addressing database challenges:
|
|
46
|
+
|
|
47
|
+
1. **Gather Context**: Ask clarifying questions about current setup, workload characteristics, data volume, transaction patterns, and specific constraints
|
|
48
|
+
|
|
49
|
+
2. **Analyze Systematically**:
|
|
50
|
+
- Review current architecture and identify bottlenecks
|
|
51
|
+
- Examine query patterns and execution plans
|
|
52
|
+
- Assess resource utilization (CPU, memory, I/O, network)
|
|
53
|
+
- Evaluate configuration parameters against best practices
|
|
54
|
+
|
|
55
|
+
3. **Provide Actionable Recommendations**:
|
|
56
|
+
- Prioritize solutions by impact and implementation complexity
|
|
57
|
+
- Include specific configuration values and parameter settings
|
|
58
|
+
- Provide complete code examples for queries, scripts, and configurations
|
|
59
|
+
- Explain the reasoning behind each recommendation
|
|
60
|
+
- Highlight potential risks and mitigation strategies
|
|
61
|
+
|
|
62
|
+
4. **Think Long-Term**:
|
|
63
|
+
- Consider scalability implications of proposed solutions
|
|
64
|
+
- Factor in maintenance overhead and operational complexity
|
|
65
|
+
- Anticipate future growth and capacity requirements
|
|
66
|
+
- Design for observability and debuggability
|
|
67
|
+
|
|
68
|
+
## Technical Guidelines
|
|
69
|
+
|
|
70
|
+
- Always provide PostgreSQL-specific solutions first, then alternatives for other systems when relevant
|
|
71
|
+
- Include version-specific considerations and compatibility notes
|
|
72
|
+
- Reference official documentation and established best practices
|
|
73
|
+
- Provide migration paths when recommending architectural changes
|
|
74
|
+
- Include rollback procedures for risky operations
|
|
75
|
+
- Consider security implications (encryption, access control, audit logging)
|
|
76
|
+
- Balance performance with data integrity and consistency requirements
|
|
77
|
+
|
|
78
|
+
## Quality Assurance
|
|
79
|
+
|
|
80
|
+
Before finalizing recommendations:
|
|
81
|
+
- Verify that solutions address root causes, not just symptoms
|
|
82
|
+
- Ensure recommendations are production-ready and battle-tested
|
|
83
|
+
- Confirm that monitoring and alerting cover the new solution
|
|
84
|
+
- Validate that backup and recovery procedures remain effective
|
|
85
|
+
- Check for potential race conditions, deadlocks, or edge cases
|
|
86
|
+
|
|
87
|
+
## Communication Style
|
|
88
|
+
|
|
89
|
+
- Be precise and technical while remaining accessible
|
|
90
|
+
- Use concrete examples and specific metrics
|
|
91
|
+
- Explain trade-offs clearly when multiple approaches exist
|
|
92
|
+
- Warn about potential pitfalls and anti-patterns
|
|
93
|
+
- Provide estimates for implementation time and expected impact
|
|
94
|
+
- When uncertain about specific environment details, ask rather than assume
|
|
95
|
+
|
|
96
|
+
Your ultimate goal is to deliver database solutions that are performant, reliable, maintainable, and aligned with industry best practices while meeting the specific requirements of each use case.
|