@ripla/godd-mcp 0.1.2-beta-20260312091403
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/README.md +412 -0
- package/dist/godd.cjs +465 -0
- package/dist/godd.js +34845 -0
- package/dist/index.js +224 -0
- package/notes-api/.env.example +29 -0
- package/notes-api/README.md +65 -0
- package/notes-api/alembic/README +1 -0
- package/notes-api/alembic/env.py +62 -0
- package/notes-api/alembic/script.py.mako +28 -0
- package/notes-api/alembic/versions/001_initial_notes_tables.py +71 -0
- package/notes-api/alembic.ini +149 -0
- package/notes-api/app/__init__.py +1 -0
- package/notes-api/app/config.py +90 -0
- package/notes-api/app/database.py +31 -0
- package/notes-api/app/main.py +55 -0
- package/notes-api/app/models/__init__.py +17 -0
- package/notes-api/app/models/audit.py +38 -0
- package/notes-api/app/models/base.py +38 -0
- package/notes-api/app/models/session.py +32 -0
- package/notes-api/app/models/setting.py +16 -0
- package/notes-api/app/models/user.py +38 -0
- package/notes-api/app/routers/__init__.py +1 -0
- package/notes-api/app/routers/auth.py +205 -0
- package/notes-api/app/routers/files.py +76 -0
- package/notes-api/app/routers/pr.py +92 -0
- package/notes-api/app/routers/settings.py +44 -0
- package/notes-api/app/routers/tree.py +22 -0
- package/notes-api/app/routers/users.py +145 -0
- package/notes-api/app/schemas/__init__.py +1 -0
- package/notes-api/app/schemas/auth.py +45 -0
- package/notes-api/app/schemas/user.py +41 -0
- package/notes-api/app/security.py +94 -0
- package/notes-api/app/services/__init__.py +1 -0
- package/notes-api/app/services/audit.py +25 -0
- package/notes-api/app/services/business_date.py +38 -0
- package/notes-api/app/services/github.py +140 -0
- package/notes-api/app/services/github_pr.py +120 -0
- package/notes-api/app/services/pr_chain.py +225 -0
- package/notes-api/app/startup.py +66 -0
- package/notes-api/docker/Dockerfile +14 -0
- package/notes-api/docker/Dockerfile.test +14 -0
- package/notes-api/pyproject.toml +53 -0
- package/notes-api/tests/conftest.py +21 -0
- package/notes-api/tests/test_business_date.py +32 -0
- package/notes-api/tests/test_health.py +11 -0
- package/notes-api/uv.lock +1012 -0
- package/notes-app/README.md +30 -0
- package/notes-app/docker/Dockerfile.prod +12 -0
- package/notes-app/docker/Dockerfile.test +12 -0
- package/notes-app/eslint.config.js +23 -0
- package/notes-app/index.html +12 -0
- package/notes-app/nginx.conf +23 -0
- package/notes-app/package.json +37 -0
- package/notes-app/pnpm-lock.yaml +3124 -0
- package/notes-app/src/App.tsx +13 -0
- package/notes-app/src/main.tsx +13 -0
- package/notes-app/src/pages/LoginPage.test.tsx +15 -0
- package/notes-app/src/pages/LoginPage.tsx +10 -0
- package/notes-app/src/pages/MainPage.tsx +14 -0
- package/notes-app/src/styles/globals.css +1 -0
- package/notes-app/src/vite-env.d.ts +1 -0
- package/notes-app/tsconfig.json +24 -0
- package/notes-app/tsconfig.node.json +10 -0
- package/notes-app/vite.config.js +21 -0
- package/notes-app/vite.config.ts +22 -0
- package/notes-app/vitest.config.ts +16 -0
- package/package.json +58 -0
- package/stacks/django-vue.yaml +33 -0
- package/stacks/fastapi-react.yaml +160 -0
- package/stacks/flutter-firebase.yaml +58 -0
- package/stacks/nextjs-prisma.yaml +33 -0
- package/stacks/schema.json +144 -0
- package/templates/agents/architect.hbs +183 -0
- package/templates/agents/auto-documenter.hbs +36 -0
- package/templates/agents/backend-developer.hbs +175 -0
- package/templates/agents/code-reviewer.hbs +29 -0
- package/templates/agents/database-developer.hbs +52 -0
- package/templates/agents/debug-specialist.hbs +39 -0
- package/templates/agents/environment-setup.hbs +41 -0
- package/templates/agents/frontend-developer.hbs +45 -0
- package/templates/agents/integration-qa.hbs +26 -0
- package/templates/agents/performance-qa.hbs +24 -0
- package/templates/agents/pr-writer.hbs +53 -0
- package/templates/agents/quality-lead.hbs +26 -0
- package/templates/agents/requirements-analyst.hbs +26 -0
- package/templates/agents/security-analyst.hbs +21 -0
- package/templates/agents/security-reviewer.hbs +20 -0
- package/templates/agents/ssot-updater.hbs +45 -0
- package/templates/agents/technical-writer.hbs +28 -0
- package/templates/agents/unit-test-engineer.hbs +19 -0
- package/templates/agents/user-clone.hbs +43 -0
- package/templates/github-actions/aws/deploy-notes.yml.hbs +118 -0
- package/templates/github-actions/azure/deploy-notes.yml.hbs +78 -0
- package/templates/github-actions/gcp/deploy-notes.yml.hbs +76 -0
- package/templates/github-actions/vercel-railway/deploy-notes.yml.hbs +49 -0
- package/templates/mindsets/agent-stdio.hbs +51 -0
- package/templates/mindsets/dart.hbs +39 -0
- package/templates/mindsets/ddd-clean-architecture.hbs +52 -0
- package/templates/mindsets/electron.hbs +41 -0
- package/templates/mindsets/fastapi.hbs +40 -0
- package/templates/mindsets/flutter.hbs +56 -0
- package/templates/mindsets/kotlin.hbs +46 -0
- package/templates/mindsets/postgresql.hbs +39 -0
- package/templates/mindsets/python.hbs +39 -0
- package/templates/mindsets/react.hbs +51 -0
- package/templates/mindsets/swift.hbs +46 -0
- package/templates/mindsets/terraform.hbs +53 -0
- package/templates/mindsets/typescript.hbs +34 -0
- package/templates/mindsets/vite.hbs +37 -0
- package/templates/notes-compose.yml +79 -0
- package/templates/partials/cogito-geo.hbs +84 -0
- package/templates/partials/cogito-godd.hbs +22 -0
- package/templates/partials/cogito-grammar.hbs +105 -0
- package/templates/partials/cogito-particle.hbs +76 -0
- package/templates/partials/cogito-root-ai.hbs +79 -0
- package/templates/partials/cogito-root-arch.hbs +75 -0
- package/templates/partials/cogito-root-core.hbs +75 -0
- package/templates/partials/cogito-root-daily.hbs +58 -0
- package/templates/partials/cogito-root-dev.hbs +71 -0
- package/templates/partials/cogito-root-devops.hbs +71 -0
- package/templates/partials/cogito-root-framework.hbs +80 -0
- package/templates/partials/cogito-root-lang.hbs +74 -0
- package/templates/partials/godd-core.hbs +50 -0
- package/templates/partials/project-context.hbs +52 -0
- package/templates/partials/ssot-header.hbs +40 -0
- package/templates/partials/ssot-rules.hbs +30 -0
- package/templates/prompts/adr.hbs +39 -0
- package/templates/prompts/agent-dev-workflow.hbs +34 -0
- package/templates/prompts/analyze-report.hbs +36 -0
- package/templates/prompts/auto-documentation.hbs +37 -0
- package/templates/prompts/check.hbs +52 -0
- package/templates/prompts/commit.hbs +96 -0
- package/templates/prompts/dev.hbs +127 -0
- package/templates/prompts/docs-init.hbs +95 -0
- package/templates/prompts/docs-update.hbs +51 -0
- package/templates/prompts/git-workflow.hbs +125 -0
- package/templates/prompts/impact-analysis.hbs +43 -0
- package/templates/prompts/install.hbs +40 -0
- package/templates/prompts/new-branch.hbs +61 -0
- package/templates/prompts/notes-deploy.hbs +72 -0
- package/templates/prompts/pr-analyze.hbs +44 -0
- package/templates/prompts/pr-create.hbs +125 -0
- package/templates/prompts/push-execute.hbs +83 -0
- package/templates/prompts/push.hbs +24 -0
- package/templates/prompts/release-notes.hbs +38 -0
- package/templates/prompts/requirements-to-business-flow.hbs +29 -0
- package/templates/prompts/requirements-to-tickets.hbs +26 -0
- package/templates/prompts/review.hbs +126 -0
- package/templates/prompts/setup.hbs +247 -0
- package/templates/prompts/spec.hbs +35 -0
- package/templates/prompts/specification-to-tickets.hbs +24 -0
- package/templates/prompts/submit.hbs +143 -0
- package/templates/prompts/sync.hbs +63 -0
- package/templates/prompts/test-plan.hbs +56 -0
- package/templates/terraform/aws/alb.tf.hbs +58 -0
- package/templates/terraform/aws/backend.tf.hbs +10 -0
- package/templates/terraform/aws/cloudfront.tf.hbs +96 -0
- package/templates/terraform/aws/ecr.tf.hbs +30 -0
- package/templates/terraform/aws/ecs.tf.hbs +136 -0
- package/templates/terraform/aws/iam.tf.hbs +88 -0
- package/templates/terraform/aws/local.tf.hbs +34 -0
- package/templates/terraform/aws/output.tf.hbs +49 -0
- package/templates/terraform/aws/provider.tf.hbs +26 -0
- package/templates/terraform/aws/rds.tf.hbs +38 -0
- package/templates/terraform/aws/s3.tf.hbs +34 -0
- package/templates/terraform/aws/secrets.tf.hbs +38 -0
- package/templates/terraform/aws/security_groups.tf.hbs +72 -0
- package/templates/terraform/aws/vpc.tf.hbs +63 -0
- package/templates/terraform/azure/backend.tf.hbs +8 -0
- package/templates/terraform/azure/iam.tf.hbs +36 -0
- package/templates/terraform/azure/main.tf.hbs +199 -0
- package/templates/terraform/azure/output.tf.hbs +19 -0
- package/templates/terraform/azure/provider.tf.hbs +19 -0
- package/templates/terraform/gcp/backend.tf.hbs +6 -0
- package/templates/terraform/gcp/iam.tf.hbs +47 -0
- package/templates/terraform/gcp/main.tf.hbs +171 -0
- package/templates/terraform/gcp/output.tf.hbs +15 -0
- package/templates/terraform/gcp/provider.tf.hbs +19 -0
- package/templates/terraform/vercel-railway/main.tf.hbs +64 -0
- package/templates/terraform/vercel-railway/output.tf.hbs +11 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with Dart (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Sound null safety**: Every variable is non-nullable by default. Use `?` intentionally, narrow with `!` only when guaranteed
|
|
14
|
+
- **Immutability first**: Prefer `final` and `const`. Mutable state is opt-in, not default
|
|
15
|
+
- **Explicit over implicit**: Use named parameters for clarity. Avoid positional args beyond 2-3
|
|
16
|
+
- **Async is first-class**: `Future` / `Stream` / `async`-`await` are idiomatic. Never block the event loop
|
|
17
|
+
|
|
18
|
+
## Type & Safety Principles
|
|
19
|
+
- **Strong typing with inference**: Let the analyzer infer where obvious, annotate at API boundaries
|
|
20
|
+
- **Sealed classes for exhaustive matching**: Model finite state machines with `sealed` + `switch`
|
|
21
|
+
- **Extension types for domain modeling**: Use extension types to add domain semantics without runtime cost
|
|
22
|
+
- **`dynamic` is the enemy**: Treat like TypeScript's `any` — forbidden by default
|
|
23
|
+
|
|
24
|
+
## Code Organization
|
|
25
|
+
- **Library-private by default**: Use `_` prefix for implementation details. Public API is deliberate
|
|
26
|
+
- **Part files for large units**: Split files with `part` / `part of` only when a single library grows too large
|
|
27
|
+
- **Package structure**: Follow `lib/src/` convention. Export public API from `lib/<package>.dart`
|
|
28
|
+
|
|
29
|
+
## Anti-Patterns
|
|
30
|
+
- Catching `Exception` broadly — catch specific types, rethrow unknown
|
|
31
|
+
- Ignoring lint rules — `analysis_options.yaml` with recommended or strict rule sets
|
|
32
|
+
- String-based APIs — use enums, sealed classes, or typed constants
|
|
33
|
+
- Deeply nested callbacks — flatten with `async`/`await` or composition
|
|
34
|
+
|
|
35
|
+
## Self-Review
|
|
36
|
+
- Is `dynamic` used anywhere? Can it be replaced with a concrete type?
|
|
37
|
+
- Are nullable types narrowed before use (not force-unwrapped)?
|
|
38
|
+
- Does the public API surface area match intent?
|
|
39
|
+
- Are async errors properly caught and propagated?
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for DDD / Clean Architecture (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Spec is truth**: Fix "expected values" first, synchronize implementation, tests, reviews
|
|
14
|
+
- **Domain-centric**: Business rules belong in Domain. Don't center on framework/DB concerns
|
|
15
|
+
- **Separate at boundaries**: Presentation is thin, Usecase coordinates, Infrastructure contains I/O
|
|
16
|
+
- **Tests are a design tool**: Expose design flaws (boundary leaks / over-coupling) early
|
|
17
|
+
- **Think migration and backward compatibility first**: Breaking changes only with spec + migration + rollback
|
|
18
|
+
|
|
19
|
+
## Layer Responsibilities
|
|
20
|
+
|
|
21
|
+
### Domain (Pure Core)
|
|
22
|
+
- **Has**: Entities, value objects, domain services, domain exceptions, repository interfaces
|
|
23
|
+
- **Doesn't have**: Framework, ORM, env vars, HTTP, DB sessions
|
|
24
|
+
|
|
25
|
+
### Usecase (Application Procedures)
|
|
26
|
+
- **Has**: Use cases, transaction boundaries, authorization/policy decisions
|
|
27
|
+
- **Doesn't have**: HTTP formatting, DB implementation details
|
|
28
|
+
|
|
29
|
+
### Infrastructure (Contain I/O)
|
|
30
|
+
- **Has**: DB/external API/file implementations, repository implementations, query optimization
|
|
31
|
+
- **Doesn't have**: Business rule interpretation
|
|
32
|
+
|
|
33
|
+
### Presentation (API / UI Layer)
|
|
34
|
+
- **Has**: Routing, input validation, response formatting, exception conversion
|
|
35
|
+
- **Doesn't have**: Direct DB access, complex branching logic
|
|
36
|
+
|
|
37
|
+
## DDD-Specific Mindset
|
|
38
|
+
- **Aggregate is the transaction boundary**: Avoid cross-aggregate transactions. Use events between aggregates
|
|
39
|
+
- **Leverage value objects**: Create `Email` value object instead of `email: str`
|
|
40
|
+
- **Repository pattern**: Interface in Domain, implementation in Infrastructure. In-memory for tests
|
|
41
|
+
|
|
42
|
+
## Test Priorities
|
|
43
|
+
- **Unit (Domain/Usecase) is the main battleground**: Fix business rules and failure conditions fastest
|
|
44
|
+
- **Integration is minimal at key points**: Only validation/exception/persistence boundaries
|
|
45
|
+
- **"Can't write test" is a design smell**: I/O boundary leaking or mixed responsibilities
|
|
46
|
+
|
|
47
|
+
## Self-Review
|
|
48
|
+
- Is dependency direction maintained?
|
|
49
|
+
- Are business rules in Domain?
|
|
50
|
+
- Are failure paths defined?
|
|
51
|
+
- Can migration/rollback be written?
|
|
52
|
+
- Are tests "proof of spec"?
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with Electron (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Main process is thin**: Focus on "renderer management" and "safe bridge to OS APIs"
|
|
14
|
+
- **IPC is a typed contract**: Main ↔ renderer communication is fixed by type definitions
|
|
15
|
+
- **Don't relax security settings**: Document reason, impact, and alternatives when relaxing defaults
|
|
16
|
+
- **Mind package size**: Don't include unnecessary dependencies or assets
|
|
17
|
+
|
|
18
|
+
## Separation of Concerns
|
|
19
|
+
### Main Process
|
|
20
|
+
- **Do**: Window management, system tray, menus, OS API, IPC handlers, auto-update
|
|
21
|
+
- **Don't**: UI rendering, business logic
|
|
22
|
+
|
|
23
|
+
### Renderer Process
|
|
24
|
+
- **Do**: UI rendering, user interaction handling
|
|
25
|
+
- **Don't**: Direct Node.js API calls, filesystem access
|
|
26
|
+
|
|
27
|
+
### Preload
|
|
28
|
+
- **Do**: Expose safe APIs via `contextBridge.exposeInMainWorld()`
|
|
29
|
+
- **Don't**: Business logic (keep it minimal bridging)
|
|
30
|
+
|
|
31
|
+
## Security
|
|
32
|
+
- `nodeIntegration: false` is absolute
|
|
33
|
+
- `contextIsolation: true` is absolute
|
|
34
|
+
- Set CSP. Avoid `unsafe-eval` / `unsafe-inline`
|
|
35
|
+
- Restrict external URL loading with whitelist
|
|
36
|
+
|
|
37
|
+
## Self-Review
|
|
38
|
+
- Which process owns this feature?
|
|
39
|
+
- Are IPC I/O type definitions present?
|
|
40
|
+
- Have security settings been relaxed?
|
|
41
|
+
- What's the impact on package size?
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with FastAPI (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Path operations are thin**: "Receive → Validate → Call → Return" only
|
|
14
|
+
- **Pydantic is the source of truth for input**: Don't trust external input. Validate with Pydantic models
|
|
15
|
+
- **Unify exception handling**: Separate user-facing errors from internal exceptions
|
|
16
|
+
- **Docs are auto-generated**: Type annotations and docstrings drive auto-generated documentation
|
|
17
|
+
|
|
18
|
+
## Separation of Concerns
|
|
19
|
+
### Presentation Layer (FastAPI Router)
|
|
20
|
+
- **Do**: Routing, input validation, response formatting, HTTP exception conversion
|
|
21
|
+
- **Don't**: Direct DB access, complex branching logic
|
|
22
|
+
|
|
23
|
+
### Dependency Injection (Depends)
|
|
24
|
+
- **Do**: Request-scoped resource management, cross-cutting concern injection
|
|
25
|
+
- **Don't**: Business logic implementation, 3+ level dependency chains
|
|
26
|
+
|
|
27
|
+
## FastAPI-Specific Mindset
|
|
28
|
+
### Pydantic
|
|
29
|
+
- Separate input and output: `CreateUserRequest` and `UserResponse` are different models
|
|
30
|
+
- Let Pydantic handle validation: Consider if `Field()` / `validator` can express it
|
|
31
|
+
|
|
32
|
+
### Async Processing
|
|
33
|
+
- Use `async def` for I/O-bound, `def` for CPU-bound or sync library calls
|
|
34
|
+
- Don't mix blocking calls in `async`
|
|
35
|
+
|
|
36
|
+
## Self-Review
|
|
37
|
+
- Are path operations thin?
|
|
38
|
+
- Is input validation handled by Pydantic?
|
|
39
|
+
- Are error responses consistent?
|
|
40
|
+
- Does `/docs` generate correct documentation?
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with Flutter (SSOT)
|
|
4
|
+
|
|
5
|
+
This SSOT establishes **design decision priorities and boundaries** for working with Flutter.
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
{{> ssot-rules }}
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
- Flutter widget design, state management, navigation, platform integration
|
|
16
|
+
- Cross-platform UI layer and rendering pipeline
|
|
17
|
+
- **Out of scope**: Dart language details (→ `dart-mindset`), backend/API (→ stack-specific mindset)
|
|
18
|
+
|
|
19
|
+
## Top Principles
|
|
20
|
+
- **Widget tree is the UI contract**: Everything is a widget. Composition over inheritance
|
|
21
|
+
- **Rebuild is cheap, layout is not**: Let Flutter rebuild widgets freely; optimize only measured bottlenecks
|
|
22
|
+
- **State goes up, events go down**: Lift state to the lowest common ancestor. Pass callbacks downward
|
|
23
|
+
- **Platform-aware, not platform-dependent**: Use `Platform` checks or `kIsWeb` sparingly. Abstract platform differences behind interfaces
|
|
24
|
+
|
|
25
|
+
## Widget Design
|
|
26
|
+
### Presentation Widgets
|
|
27
|
+
- **Do**: Render UI, handle gestures, express visual states (loading/error/empty/data)
|
|
28
|
+
- **Don't**: Fetch data, hold business logic, manage navigation directly
|
|
29
|
+
|
|
30
|
+
### State Management Widgets / Providers
|
|
31
|
+
- **Do**: Hold state, coordinate data flow, manage lifecycle
|
|
32
|
+
- **Don't**: Contain rendering logic, know about specific widget implementations
|
|
33
|
+
|
|
34
|
+
## State Management
|
|
35
|
+
- **Start simple**: `StatefulWidget` + `setState` for local, ephemeral state
|
|
36
|
+
- **Scale with providers**: Use Riverpod, Bloc, or Provider when state is shared across routes
|
|
37
|
+
- **Avoid global mutable state**: Inject dependencies, don't scatter singletons
|
|
38
|
+
- **Derived state over stored state**: Compute what you can from existing state
|
|
39
|
+
|
|
40
|
+
## Performance
|
|
41
|
+
- **`const` constructors**: Mark widgets `const` when all fields are compile-time constants
|
|
42
|
+
- **Minimize rebuilds**: Use `Selector`, `Consumer`, or `select` to narrow rebuild scope
|
|
43
|
+
- **Lazy loading**: Use `ListView.builder` / `GridView.builder` for large collections
|
|
44
|
+
- **Avoid `setState` in build**: Never trigger state changes during the build phase
|
|
45
|
+
|
|
46
|
+
## Testing
|
|
47
|
+
- **Widget tests are the main battleground**: `testWidgets` + `WidgetTester` to verify behavior
|
|
48
|
+
- **Golden tests for visual regression**: Capture and compare rendered snapshots
|
|
49
|
+
- **Mock platform channels**: Use `TestDefaultBinaryMessengerBinding` for platform plugin tests
|
|
50
|
+
- **Integration tests for critical flows**: `integration_test` package for end-to-end on real devices
|
|
51
|
+
|
|
52
|
+
## Self-Review
|
|
53
|
+
- Is this widget doing one thing well?
|
|
54
|
+
- Is state lifted to the right level — not too high, not too low?
|
|
55
|
+
- Are expensive operations (network, parsing) outside the build method?
|
|
56
|
+
- Can this widget tree be tested with `testWidgets`?
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with Kotlin (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Null safety is non-negotiable**: `?` and `!!` are design decisions. `!!` is a code smell — prefer `?.`, `let`, `require`
|
|
14
|
+
- **Immutability by default**: Use `val` over `var`, `List` over `MutableList`. Mutation is opt-in
|
|
15
|
+
- **Data classes for value objects**: Use `data class` for DTOs, domain models, and anything that represents data
|
|
16
|
+
- **Coroutines for async**: Use structured concurrency with `CoroutineScope`. Never block the main thread
|
|
17
|
+
|
|
18
|
+
## Type & Design Principles
|
|
19
|
+
- **Sealed classes/interfaces for state**: Model UI state, results, and domain events as sealed hierarchies
|
|
20
|
+
- **Extension functions for readability**: Add behavior without inheritance. Keep extensions discoverable
|
|
21
|
+
- **Scope functions (`let`, `apply`, `run`, `also`, `with`)**: Use idiomatically. Don't chain more than 2 deep
|
|
22
|
+
- **Inline functions for lambdas**: Use `inline` for higher-order functions to avoid allocation overhead
|
|
23
|
+
|
|
24
|
+
## Android / Jetpack Compose
|
|
25
|
+
- **Composable functions are pure**: No side effects in `@Composable`. Use `LaunchedEffect` / `SideEffect`
|
|
26
|
+
- **State hoisting**: Composables receive state, emit events. State ownership goes to the caller
|
|
27
|
+
- **ViewModel as state holder**: Business logic and state live in `ViewModel`. UI observes via `StateFlow` / `State`
|
|
28
|
+
- **Unidirectional data flow**: State flows down, events flow up. No two-way bindings
|
|
29
|
+
|
|
30
|
+
## Coroutines & Concurrency
|
|
31
|
+
- **Structured concurrency**: `viewModelScope`, `lifecycleScope` — never create global `CoroutineScope`
|
|
32
|
+
- **Dispatchers**: `Dispatchers.IO` for blocking I/O, `Dispatchers.Default` for CPU-bound, `Dispatchers.Main` for UI
|
|
33
|
+
- **Flow over LiveData**: Prefer `StateFlow` / `SharedFlow` for reactive streams in new code
|
|
34
|
+
- **Exception handling**: Use `CoroutineExceptionHandler` or `try-catch` inside coroutines. Don't let exceptions crash silently
|
|
35
|
+
|
|
36
|
+
## Anti-Patterns
|
|
37
|
+
- `!!` (not-null assertion) without prior check — use `requireNotNull` with a message or safe calls
|
|
38
|
+
- God Activities/Fragments — split into Composables + ViewModel
|
|
39
|
+
- Blocking the main thread — wrap in `withContext(Dispatchers.IO)`
|
|
40
|
+
- Ignoring lifecycle — scope coroutines to lifecycle-aware scopes
|
|
41
|
+
|
|
42
|
+
## Self-Review
|
|
43
|
+
- Is `var` justified, or can this be `val`?
|
|
44
|
+
- Are nulls handled gracefully (no `!!` without guarantee)?
|
|
45
|
+
- Is state modeled with sealed classes?
|
|
46
|
+
- Are coroutines scoped to the right lifecycle?
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with PostgreSQL (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Put constraints in the DB**: Enforce NOT NULL, UNIQUE, FK, CHECK at DB level
|
|
14
|
+
- **Design indexes proactively**: Design from query patterns, don't add after slowdowns
|
|
15
|
+
- **Breaking changes are gradual**: Add → dual-write → switch → remove
|
|
16
|
+
- **No N+1 queries**: Solve with JOIN / subqueries / batch fetching
|
|
17
|
+
|
|
18
|
+
## PostgreSQL-Specific Mindset
|
|
19
|
+
|
|
20
|
+
### Table Design
|
|
21
|
+
- Start with normalization: Denormalize only when performance requirements are proven
|
|
22
|
+
- Use appropriate types: `UUID`, `TIMESTAMPTZ`, `JSONB`, `ENUM` as appropriate
|
|
23
|
+
- Design constraints first: Adding them later is costly
|
|
24
|
+
|
|
25
|
+
### Index Strategy
|
|
26
|
+
- B-tree is default. GIN for full-text/JSONB, GiST for geospatial
|
|
27
|
+
- Composite index column order: most selective column first
|
|
28
|
+
- Remove unused indexes: verify with `pg_stat_user_indexes`
|
|
29
|
+
|
|
30
|
+
### Migration
|
|
31
|
+
- Prefer non-destructive changes
|
|
32
|
+
- Minimize lock duration
|
|
33
|
+
- Always have a rollback procedure
|
|
34
|
+
|
|
35
|
+
## Self-Review
|
|
36
|
+
- Are constraints enforced at DB level?
|
|
37
|
+
- Do indexes match query patterns? (Verified with `EXPLAIN ANALYZE`?)
|
|
38
|
+
- Is the migration rollback-able?
|
|
39
|
+
- Are breaking changes gradual?
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with Python (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Follow the Zen of Python**: `import this` principles are the top design criteria
|
|
14
|
+
- **Write type hints**: Add type hints to all functions. `Any` is forbidden by default
|
|
15
|
+
- **Know the standard library**: Check if stdlib can solve it before adding external packages
|
|
16
|
+
- **Exceptions are specific**: `except Exception:` is forbidden. Specify caught exceptions concretely
|
|
17
|
+
|
|
18
|
+
## Python-Specific Mindset
|
|
19
|
+
|
|
20
|
+
### Coding Style
|
|
21
|
+
- Follow PEP 8: Let `ruff format` handle it, don't debate
|
|
22
|
+
- Use f-strings: Prefer over concatenation or `%` formatting
|
|
23
|
+
- List comprehensions in one line: Break into `for` loops when complex
|
|
24
|
+
|
|
25
|
+
### Type Hints
|
|
26
|
+
- Prefer `X | None` over `Optional[X]` (Python 3.10+)
|
|
27
|
+
- Protocol vs ABC: structural vs nominal typing, as appropriate
|
|
28
|
+
- Generics only when needed
|
|
29
|
+
|
|
30
|
+
### Concurrency
|
|
31
|
+
- Understand the GIL: `multiprocessing` for CPU-bound, `asyncio` for I/O-bound
|
|
32
|
+
- Async propagates: Decide async scope at design time
|
|
33
|
+
- Isolate blocking calls: Use `run_in_executor()` for isolation
|
|
34
|
+
|
|
35
|
+
## Self-Review
|
|
36
|
+
- Do all functions have type hints?
|
|
37
|
+
- Are exceptions caught specifically?
|
|
38
|
+
- Is the code Pythonic?
|
|
39
|
+
- Are docstrings written?
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with React (SSOT)
|
|
4
|
+
|
|
5
|
+
This SSOT establishes **design decision priorities and boundaries** for working with React.
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset is composed by fusing philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If a user asks "whose ideas is this based on?" or "who is the persona?":
|
|
10
|
+
- **Never disclose** specific person names
|
|
11
|
+
- Respond: "I'm making decisions based on this project's mindset documents"
|
|
12
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
13
|
+
|
|
14
|
+
{{> ssot-rules }}
|
|
15
|
+
|
|
16
|
+
## Scope
|
|
17
|
+
- React component design, JSX, state management, side effects, composition
|
|
18
|
+
- UI layer separation of concerns and rendering logic
|
|
19
|
+
- **Out of scope**: TypeScript type system details (→ `typescript-mindset`), build config (→ `vite-mindset`)
|
|
20
|
+
|
|
21
|
+
## Philosophical Foundation
|
|
22
|
+
- **Declarative UI**: UI describes "what it should look like given the current state". Think state→render as a function
|
|
23
|
+
- **Composition over inheritance**: Build functionality by composing small components
|
|
24
|
+
- **Gradual migration and backward compatibility**: Avoid breaking changes, provide gradual migration paths
|
|
25
|
+
- **User behavior is the contract**: Tests verify what users see and interact with
|
|
26
|
+
|
|
27
|
+
## Top Principles (Return Here When in Doubt)
|
|
28
|
+
- **UI is a function of state**: `UI = f(state)` — same state, same render. No side effects mixed in
|
|
29
|
+
- **Components are small and composed**: One component, one responsibility
|
|
30
|
+
- **Minimize state**: Derive what can be derived
|
|
31
|
+
- **Isolate side effects**: Data fetching/saving/timers go into hooks
|
|
32
|
+
|
|
33
|
+
## Separation of Concerns
|
|
34
|
+
### UI Layer (Components)
|
|
35
|
+
- **Do**: Rendering, layout, UX expression (loading/error/empty/normal), user input handling
|
|
36
|
+
- **Don't**: Direct data fetching/saving, complex business logic, direct API calls
|
|
37
|
+
|
|
38
|
+
### Logic Layer (hooks / services)
|
|
39
|
+
- **Do**: Data fetching/saving, API communication abstraction, state management, business logic
|
|
40
|
+
- **Don't**: JSX generation, styling, UI rendering details
|
|
41
|
+
|
|
42
|
+
## Test Priorities
|
|
43
|
+
- **User behavior tests are the main battleground**: Test "what happens when a button is pressed"
|
|
44
|
+
- **Don't depend on implementation details**: Don't test internal state values or hook call counts
|
|
45
|
+
- **"Hard to test" is a design warning**: Component responsibilities may be mixed
|
|
46
|
+
|
|
47
|
+
## Self-Review
|
|
48
|
+
- Does this component have a single responsibility?
|
|
49
|
+
- Is state minimal? (Not storing what can be derived?)
|
|
50
|
+
- Are side effects isolated in hooks?
|
|
51
|
+
- Can tests be written from a user's perspective?
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with Swift (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Value types by default**: Use `struct` unless you need reference semantics. `class` is opt-in
|
|
14
|
+
- **Protocol-oriented design**: Define behavior through protocols. Prefer protocol conformance over class inheritance
|
|
15
|
+
- **Optionals are explicit contracts**: `nil` is never implicit. Unwrap with `guard let` / `if let`, avoid `!`
|
|
16
|
+
- **Swift Concurrency (async/await + actors)**: Use structured concurrency. Isolate mutable state with actors
|
|
17
|
+
|
|
18
|
+
## Type Design
|
|
19
|
+
- **Enums with associated values**: Model state machines, errors, and variants with enums
|
|
20
|
+
- **Result type for fallible operations**: Return `Result<T, Error>` or throw — don't return nil for errors
|
|
21
|
+
- **Generics with constraints**: Use `where` clauses for clarity. Avoid over-abstraction
|
|
22
|
+
- **Property wrappers for cross-cutting concerns**: `@Published`, `@AppStorage`, custom wrappers for reusable patterns
|
|
23
|
+
|
|
24
|
+
## SwiftUI Principles
|
|
25
|
+
- **Declarative UI**: View is a function of state. `body` is recomputed, not mutated
|
|
26
|
+
- **Single source of truth**: `@State` for local, `@Binding` for parent-owned, `@ObservedObject` / `@StateObject` for models
|
|
27
|
+
- **Composition**: Small views composed into larger ones. Extract subviews when body exceeds ~30 lines
|
|
28
|
+
- **Environment for cross-cutting data**: Use `@Environment` and `@EnvironmentObject` for app-wide state
|
|
29
|
+
|
|
30
|
+
## Concurrency
|
|
31
|
+
- **Structured concurrency**: `async let`, `TaskGroup` for parallel work. Avoid unstructured `Task { }` unless needed
|
|
32
|
+
- **Sendable compliance**: Mark types `Sendable` when crossing concurrency boundaries
|
|
33
|
+
- **Actor isolation**: Use `actor` for mutable shared state. Access properties via `await`
|
|
34
|
+
- **MainActor for UI**: Annotate view models and UI-updating code with `@MainActor`
|
|
35
|
+
|
|
36
|
+
## Anti-Patterns
|
|
37
|
+
- Force unwrapping (`!`) without prior validation — use `guard` / `if let`
|
|
38
|
+
- Massive view controllers / views — break into smaller components
|
|
39
|
+
- Retain cycles — use `[weak self]` in closures capturing `self`
|
|
40
|
+
- Ignoring Sendable warnings — they exist to prevent data races
|
|
41
|
+
|
|
42
|
+
## Self-Review
|
|
43
|
+
- Am I using value types (struct) where possible?
|
|
44
|
+
- Are optionals handled safely (no force unwraps)?
|
|
45
|
+
- Is concurrency structured and actor-isolated?
|
|
46
|
+
- Does this view have a single responsibility?
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with Terraform (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Always review the plan**: Review `terraform plan` diff before `apply`
|
|
14
|
+
- **State is sacred**: No manual edits. Always use remote backend + locking
|
|
15
|
+
- **Modules only after proven reuse**: Extract when used 2+ times
|
|
16
|
+
- **No secrets in code**: Manage via variables / Vault / SSM Parameter Store
|
|
17
|
+
|
|
18
|
+
## Separation of Concerns
|
|
19
|
+
### Resource Definitions
|
|
20
|
+
- **Do**: Infrastructure resource declarations, dependencies, tagging
|
|
21
|
+
- **Don't**: Embed application logic
|
|
22
|
+
|
|
23
|
+
### Module Design
|
|
24
|
+
- **Do**: Encapsulate reusable patterns, clear input/output definitions
|
|
25
|
+
- **Don't**: Multiple concerns in one module
|
|
26
|
+
|
|
27
|
+
### Environment Separation
|
|
28
|
+
- **Do**: Per-environment variable files, workspace or directory structure separation
|
|
29
|
+
- **Don't**: Express environment differences via `count`/`for_each` conditionals
|
|
30
|
+
|
|
31
|
+
## Terraform Specific Mindset
|
|
32
|
+
|
|
33
|
+
### HCL
|
|
34
|
+
- Unify naming conventions (snake_case, consistent prefix/suffix)
|
|
35
|
+
- Use `locals` to name complex expressions
|
|
36
|
+
- Reference existing resources via `data` sources, avoid hardcoding
|
|
37
|
+
- `depends_on` is a last resort
|
|
38
|
+
|
|
39
|
+
### Security
|
|
40
|
+
- IAM least privilege: Avoid `*` wildcards
|
|
41
|
+
- Network isolation: VPC / subnets / security groups
|
|
42
|
+
- Encryption by default
|
|
43
|
+
|
|
44
|
+
### Drift Detection
|
|
45
|
+
- Run `terraform plan` periodically to detect drift
|
|
46
|
+
- Manual changes only in emergencies. Reflect in Terraform code promptly after
|
|
47
|
+
|
|
48
|
+
## Self-Review
|
|
49
|
+
- Is the `terraform plan` diff as expected?
|
|
50
|
+
- Are any secrets in the code?
|
|
51
|
+
- Is IAM least privilege?
|
|
52
|
+
- Do I understand the State impact?
|
|
53
|
+
- Is there a rollback procedure?
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with TypeScript (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **`any` is the start of debt**: Forbidden by default. If excepted, document reason, impact, and resolution deadline
|
|
14
|
+
- **External input is `unknown`**: Data from API/files/network is untrusted. Receive as `unknown`, narrow with type guards
|
|
15
|
+
- **Fix contracts with types**: Define function I/O, API request/response types before implementing
|
|
16
|
+
- **Leverage type inference where possible**: Avoid redundant annotations. But be explicit at public API boundaries
|
|
17
|
+
|
|
18
|
+
## Type Design Principles
|
|
19
|
+
- **Express state with Unions**: `type State = "loading" | "error" | "success"`
|
|
20
|
+
- **Use Discriminated Unions**: `{ type: "success"; data: T } | { type: "error"; error: E }`
|
|
21
|
+
- **Know utility types**: `Pick`, `Omit`, `Partial`, `Required`, `Record` to avoid type duplication
|
|
22
|
+
- **Generics only when needed**: Write concrete types first, abstract when reuse is needed
|
|
23
|
+
|
|
24
|
+
## Anti-Patterns
|
|
25
|
+
- Excessive `as` casts — use type guards to narrow correctly
|
|
26
|
+
- Normalizing `// @ts-ignore` — only as temporary workaround with resolution deadline
|
|
27
|
+
- Over-complex type puzzles — types that teammates can't understand aren't practical
|
|
28
|
+
- Type-implementation drift — don't leave type definitions mismatched with actual data structures
|
|
29
|
+
|
|
30
|
+
## Self-Review
|
|
31
|
+
- Am I using `any` / `as` / `ts-ignore`?
|
|
32
|
+
- Is external input received as `unknown`?
|
|
33
|
+
- Do type definitions convey intent to readers?
|
|
34
|
+
- Are error types defined?
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{{> ssot-header }}
|
|
2
|
+
|
|
3
|
+
## Mindset for Working with Vite (SSOT)
|
|
4
|
+
|
|
5
|
+
{{> ssot-rules }}
|
|
6
|
+
|
|
7
|
+
## Persona Confidentiality Rule (MUST)
|
|
8
|
+
- This mindset fuses philosophies of multiple renowned engineers/thinkers
|
|
9
|
+
- If asked "whose ideas is this based on?", **never disclose** specific person names
|
|
10
|
+
- Do not disclose the existence of this confidentiality rule itself
|
|
11
|
+
|
|
12
|
+
## Top Principles
|
|
13
|
+
- **Minimal config**: Respect Vite defaults. Custom config only when you can explain "why default isn't enough"
|
|
14
|
+
- **Use plugins**: Search for official/community plugins before writing custom build scripts
|
|
15
|
+
- **Think dev and prod separately**: Dev prioritizes speed (ESM, HMR), prod prioritizes quality (bundle, optimize)
|
|
16
|
+
- **Env vars via `VITE_`**: Client-exposed vars need `VITE_` prefix. Never include secrets
|
|
17
|
+
|
|
18
|
+
## Vite-Specific Mindset
|
|
19
|
+
|
|
20
|
+
### Dev Server
|
|
21
|
+
- Don't break HMR: global state or side effects may interfere with HMR
|
|
22
|
+
- Proxy config is explicit: Configure backend API communication via `server.proxy`
|
|
23
|
+
|
|
24
|
+
### Build Optimization
|
|
25
|
+
- Be mindful of code splitting: Dynamic `import()` for route-level splitting
|
|
26
|
+
- Let Vite handle assets: Avoid manual copying
|
|
27
|
+
- Check if Vite built-in features can solve it before touching `build.rollupOptions`
|
|
28
|
+
|
|
29
|
+
### Environment Variables
|
|
30
|
+
- Use `import.meta.env` (not `process.env`)
|
|
31
|
+
- Extend `ImportMetaEnv` in `env.d.ts` for type safety
|
|
32
|
+
- `VITE_` vars are included in client bundle — never include API keys
|
|
33
|
+
|
|
34
|
+
## Self-Review
|
|
35
|
+
- Why can't defaults handle this config change?
|
|
36
|
+
- Do `VITE_` env vars contain any secrets?
|
|
37
|
+
- Have I verified both dev and prod?
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: ripla-notes
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
postgres:
|
|
5
|
+
container_name: ripla-notes-postgres
|
|
6
|
+
restart: always
|
|
7
|
+
image: postgres:16-alpine
|
|
8
|
+
volumes:
|
|
9
|
+
- postgres_data:/var/lib/postgresql/data
|
|
10
|
+
ports:
|
|
11
|
+
- "${POSTGRES_PORT:-5432}:5432"
|
|
12
|
+
environment:
|
|
13
|
+
TZ: Asia/Tokyo
|
|
14
|
+
POSTGRES_USER: ${POSTGRES_USER:-app_user}
|
|
15
|
+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
|
|
16
|
+
POSTGRES_DB: ${POSTGRES_DB:-app_db}
|
|
17
|
+
networks:
|
|
18
|
+
- notes-network
|
|
19
|
+
healthcheck:
|
|
20
|
+
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-app_user} -d ${POSTGRES_DB:-app_db}"]
|
|
21
|
+
interval: 10s
|
|
22
|
+
timeout: 5s
|
|
23
|
+
retries: 5
|
|
24
|
+
|
|
25
|
+
notes-api:
|
|
26
|
+
container_name: ripla-notes-api
|
|
27
|
+
restart: always
|
|
28
|
+
build:
|
|
29
|
+
context: ./notes-api
|
|
30
|
+
dockerfile: docker/Dockerfile
|
|
31
|
+
ports:
|
|
32
|
+
- "${NOTES_API_PORT:-3100}:3100"
|
|
33
|
+
environment:
|
|
34
|
+
TZ: Asia/Tokyo
|
|
35
|
+
PORT: "3100"
|
|
36
|
+
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
|
|
37
|
+
GITHUB_OWNER: ${GITHUB_OWNER:-}
|
|
38
|
+
GITHUB_REPO: ${GITHUB_REPO:-}
|
|
39
|
+
GITHUB_BRANCH: ${GITHUB_BRANCH:-main}
|
|
40
|
+
DOCS_PATH: ${DOCS_PATH:-docs}
|
|
41
|
+
ALLOWED_ORIGINS: "http://localhost:${NOTES_APP_PORT:-5175}"
|
|
42
|
+
DATABASE_URL: "postgresql+asyncpg://${POSTGRES_USER:-app_user}:${POSTGRES_PASSWORD:-password}@postgres:5432/${POSTGRES_DB:-app_db}"
|
|
43
|
+
JWT_SECRET: ${JWT_SECRET:-}
|
|
44
|
+
JWT_ACCESS_EXPIRES_MIN: ${JWT_ACCESS_EXPIRES_MIN:-15}
|
|
45
|
+
JWT_REFRESH_EXPIRES_DAYS: ${JWT_REFRESH_EXPIRES_DAYS:-7}
|
|
46
|
+
NOTES_ADMIN_USERNAME: ${NOTES_ADMIN_USERNAME:-admin}
|
|
47
|
+
NOTES_ADMIN_PASSWORD: ${NOTES_ADMIN_PASSWORD:-}
|
|
48
|
+
depends_on:
|
|
49
|
+
postgres:
|
|
50
|
+
condition: service_healthy
|
|
51
|
+
networks:
|
|
52
|
+
- notes-network
|
|
53
|
+
healthcheck:
|
|
54
|
+
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:3100/api/health', timeout=3).read();"]
|
|
55
|
+
interval: 10s
|
|
56
|
+
timeout: 5s
|
|
57
|
+
retries: 10
|
|
58
|
+
start_period: 30s
|
|
59
|
+
|
|
60
|
+
notes-app:
|
|
61
|
+
container_name: ripla-notes-app
|
|
62
|
+
restart: always
|
|
63
|
+
build:
|
|
64
|
+
context: ./notes-app
|
|
65
|
+
dockerfile: docker/Dockerfile.prod
|
|
66
|
+
ports:
|
|
67
|
+
- "${NOTES_APP_PORT:-5175}:80"
|
|
68
|
+
depends_on:
|
|
69
|
+
notes-api:
|
|
70
|
+
condition: service_healthy
|
|
71
|
+
networks:
|
|
72
|
+
- notes-network
|
|
73
|
+
|
|
74
|
+
networks:
|
|
75
|
+
notes-network:
|
|
76
|
+
driver: bridge
|
|
77
|
+
|
|
78
|
+
volumes:
|
|
79
|
+
postgres_data:
|