@totaland/create-starter-kit 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/package.json +1 -1
  2. package/templates/backend/.github/agents/ /360/237/216/255 planner.agent.md" +92 -0
  3. package/templates/backend/.github/agents/api-architect.agent.md +41 -0
  4. package/templates/backend/.github/agents/code-reviewer.agent.md +26 -0
  5. package/templates/backend/.github/agents/code-simplifier.agent.md +41 -0
  6. package/templates/backend/.github/agents/code-skeptic.agent.md +74 -0
  7. package/templates/backend/.github/agents/docs-specialist.agent.md +25 -0
  8. package/templates/backend/.github/agents/implementation-plan.agent.md +160 -0
  9. package/templates/backend/.github/agents/janitor.agent.md +90 -0
  10. package/templates/backend/.github/agents/ms-sql-dba.agent.md +25 -0
  11. package/templates/backend/.github/agents/plan.agent.md +115 -0
  12. package/templates/backend/.github/agents/planner.agent.md +15 -0
  13. package/templates/backend/.github/agents/playwright-tester.agent.md +13 -0
  14. package/templates/backend/.github/agents/postgresql-dba.agent.md +18 -0
  15. package/templates/backend/.github/agents/prd.agent.md +202 -0
  16. package/templates/backend/.github/agents/research-technical-spike.agent.md +170 -0
  17. package/templates/backend/.github/agents/software-engineer-agent-v1.agent.md +165 -0
  18. package/templates/backend/.github/agents/task-planner.agent.md +375 -0
  19. package/templates/backend/.github/agents/task-researcher.agent.md +255 -0
  20. package/templates/backend/.github/agents/tdd-green.agent.md +60 -0
  21. package/templates/backend/.github/agents/tdd-red.agent.md +60 -0
  22. package/templates/backend/.github/agents/tdd-refactor.agent.md +85 -0
  23. package/templates/backend/.github/agents/tech-debt-remediation-plan.agent.md +50 -0
  24. package/templates/backend/.github/agents/typescript-mcp-expert.agent.md +91 -0
  25. package/templates/backend/.github/agents/ultimate-thinking-beastmode.agent.md +644 -0
  26. package/templates/backend/.github/agents//360/237/216/255 generator.agent.md" +264 -0
  27. package/templates/backend/.github/agents//360/237/216/255 healer.agent.md" +44 -0
  28. package/templates/backend/.github/agents//360/237/216/255 pom.agent.md" +308 -0
  29. package/templates/backend/.github/instructions/a11y.instructions.md +369 -0
  30. package/templates/backend/.github/instructions/ms-sql-dba.instructions.md +25 -0
  31. package/templates/backend/.github/instructions/object-calisthenics.instructions.md +302 -0
  32. package/templates/backend/.github/instructions/performance-optimization.instructions.md +420 -0
  33. package/templates/backend/.github/instructions/playwright-python.instructions.md +62 -0
  34. package/templates/backend/.github/instructions/playwright-typescript.instructions.md +86 -0
  35. package/templates/backend/.github/instructions/security-and-owasp.instructions.md +51 -0
  36. package/templates/backend/.github/instructions/self-explanatory-code-commenting.instructions.md +162 -0
  37. package/templates/backend/.github/instructions/spec-driven-workflow-v1.instructions.md +323 -0
  38. package/templates/backend/.github/instructions/sql-sp-generation.instructions.md +74 -0
  39. package/templates/backend/.github/instructions/task-implementation.instructions.md +190 -0
  40. package/templates/backend/.github/instructions/typescript-mcp-server.instructions.md +228 -0
  41. package/templates/backend/.github/prompts/ai-prompt-engineering-safety-review.prompt.md +229 -0
  42. package/templates/backend/.github/prompts/architecture-blueprint-generator.prompt.md +321 -0
  43. package/templates/backend/.github/prompts/breakdown-epic-arch.prompt.md +65 -0
  44. package/templates/backend/.github/prompts/breakdown-epic-pm.prompt.md +57 -0
  45. package/templates/backend/.github/prompts/breakdown-feature-implementation.prompt.md +127 -0
  46. package/templates/backend/.github/prompts/breakdown-feature-prd.prompt.md +60 -0
  47. package/templates/backend/.github/prompts/breakdown-plan.prompt.md +508 -0
  48. package/templates/backend/.github/prompts/copilot-instructions-blueprint-generator.prompt.md +293 -0
  49. package/templates/backend/.github/prompts/create-agentsmd.prompt.md +248 -0
  50. package/templates/backend/.github/prompts/create-github-issue-feature-from-specification.prompt.md +27 -0
  51. package/templates/backend/.github/prompts/create-github-issues-feature-from-implementation-plan.prompt.md +27 -0
  52. package/templates/backend/.github/prompts/create-github-issues-for-unmet-specification-requirements.prompt.md +35 -0
  53. package/templates/backend/.github/prompts/create-implementation-plan.prompt.md +156 -0
  54. package/templates/backend/.github/prompts/create-llms.prompt.md +209 -0
  55. package/templates/backend/.github/prompts/create-specification.prompt.md +126 -0
  56. package/templates/backend/.github/prompts/create-technical-spike.prompt.md +230 -0
  57. package/templates/backend/.github/prompts/csharp-nunit.prompt.md +71 -0
  58. package/templates/backend/.github/prompts/ef-core.prompt.md +76 -0
  59. package/templates/backend/.github/prompts/folder-structure-blueprint-generator.prompt.md +404 -0
  60. package/templates/backend/.github/prompts/gen-specs-as-issues.prompt.md +165 -0
  61. package/templates/backend/.github/prompts/generate-custom-instructions-from-codebase.prompt.md +239 -0
  62. package/templates/backend/.github/prompts/java-junit.prompt.md +64 -0
  63. package/templates/backend/.github/prompts/memory-merger.prompt.md +107 -0
  64. package/templates/backend/.github/prompts/multi-stage-dockerfile.prompt.md +46 -0
  65. package/templates/backend/.github/prompts/playwright-automation-fill-in-form.prompt.md +29 -0
  66. package/templates/backend/.github/prompts/playwright-explore-website.prompt.md +19 -0
  67. package/templates/backend/.github/prompts/playwright-generate-test.prompt.md +19 -0
  68. package/templates/backend/.github/prompts/postgresql-code-review.prompt.md +214 -0
  69. package/templates/backend/.github/prompts/postgresql-optimization.prompt.md +406 -0
  70. package/templates/backend/.github/prompts/project-workflow-analysis-blueprint-generator.prompt.md +294 -0
  71. package/templates/backend/.github/prompts/prompt-builder.prompt.md +142 -0
  72. package/templates/backend/.github/prompts/remember.prompt.md +125 -0
  73. package/templates/backend/.github/prompts/review-and-refactor.prompt.md +15 -0
  74. package/templates/backend/.github/prompts/sql-code-review.prompt.md +303 -0
  75. package/templates/backend/.github/prompts/sql-optimization.prompt.md +298 -0
  76. package/templates/backend/.github/prompts/suggest-awesome-github-copilot-agents.prompt.md +72 -0
  77. package/templates/backend/.github/prompts/suggest-awesome-github-copilot-chatmodes.prompt.md +71 -0
  78. package/templates/backend/.github/prompts/suggest-awesome-github-copilot-collections.prompt.md +149 -0
  79. package/templates/backend/.github/prompts/suggest-awesome-github-copilot-instructions.prompt.md +88 -0
  80. package/templates/backend/.github/prompts/suggest-awesome-github-copilot-prompts.prompt.md +71 -0
  81. package/templates/backend/.github/prompts/technology-stack-blueprint-generator.prompt.md +242 -0
  82. package/templates/backend/.github/prompts/typescript-mcp-server-generator.prompt.md +90 -0
  83. package/templates/backend/.github/prompts/update-implementation-plan.prompt.md +157 -0
  84. package/templates/backend/.github/prompts/update-markdown-file-index.prompt.md +76 -0
  85. package/templates/backend/Project_Folders_Structure_Blueprint.md +529 -0
  86. package/templates/backend/README.md +99 -0
  87. package/templates/backend/biome.json +43 -1
  88. package/templates/backend/drizzle.config.ts +1 -1
  89. package/templates/backend/package.json +9 -4
  90. package/templates/backend/pnpm-lock.yaml +4240 -0
  91. package/templates/backend/src/features/health/health.test.ts +23 -0
  92. package/templates/backend/src/features/health/index.ts +1 -0
  93. package/templates/backend/src/features/health/schemas.ts +29 -0
  94. package/templates/backend/src/features/orders/controller.ts +9 -4
  95. package/templates/backend/src/features/orders/index.ts +4 -1
  96. package/templates/backend/src/features/orders/schemas.ts +62 -0
  97. package/templates/backend/src/index.ts +3 -36
  98. package/templates/backend/src/lib/openapi.ts +25 -0
  99. package/templates/backend/src/lib/validateRequest.test.ts +84 -0
  100. package/templates/backend/src/lib/validateRequest.ts +72 -0
  101. package/templates/backend/tsconfig.json +2 -2
  102. package/templates/backend/vitest.config.ts +8 -1
  103. package/templates/frontend/.github/agents/ /360/237/216/255 planner.agent.md" +92 -0
  104. package/templates/frontend/.github/agents/api-architect.agent.md +41 -0
  105. package/templates/frontend/.github/agents/code-reviewer.agent.md +26 -0
  106. package/templates/frontend/.github/agents/code-simplifier.agent.md +41 -0
  107. package/templates/frontend/.github/agents/code-skeptic.agent.md +74 -0
  108. package/templates/frontend/.github/agents/docs-specialist.agent.md +25 -0
  109. package/templates/frontend/.github/agents/implementation-plan.agent.md +160 -0
  110. package/templates/frontend/.github/agents/janitor.agent.md +90 -0
  111. package/templates/frontend/.github/agents/ms-sql-dba.agent.md +25 -0
  112. package/templates/frontend/.github/agents/plan.agent.md +115 -0
  113. package/templates/frontend/.github/agents/planner.agent.md +15 -0
  114. package/templates/frontend/.github/agents/playwright-tester.agent.md +13 -0
  115. package/templates/frontend/.github/agents/postgresql-dba.agent.md +18 -0
  116. package/templates/frontend/.github/agents/prd.agent.md +202 -0
  117. package/templates/frontend/.github/agents/research-technical-spike.agent.md +170 -0
  118. package/templates/frontend/.github/agents/software-engineer-agent-v1.agent.md +165 -0
  119. package/templates/frontend/.github/agents/task-planner.agent.md +375 -0
  120. package/templates/frontend/.github/agents/task-researcher.agent.md +255 -0
  121. package/templates/frontend/.github/agents/tdd-green.agent.md +60 -0
  122. package/templates/frontend/.github/agents/tdd-red.agent.md +60 -0
  123. package/templates/frontend/.github/agents/tdd-refactor.agent.md +85 -0
  124. package/templates/frontend/.github/agents/tech-debt-remediation-plan.agent.md +50 -0
  125. package/templates/frontend/.github/agents/typescript-mcp-expert.agent.md +91 -0
  126. package/templates/frontend/.github/agents/ultimate-thinking-beastmode.agent.md +644 -0
  127. package/templates/frontend/.github/agents//360/237/216/255 generator.agent.md" +264 -0
  128. package/templates/frontend/.github/agents//360/237/216/255 healer.agent.md" +44 -0
  129. package/templates/frontend/.github/agents//360/237/216/255 pom.agent.md" +308 -0
  130. package/templates/frontend/.github/instructions/a11y.instructions.md +369 -0
  131. package/templates/frontend/.github/instructions/ms-sql-dba.instructions.md +25 -0
  132. package/templates/frontend/.github/instructions/object-calisthenics.instructions.md +302 -0
  133. package/templates/frontend/.github/instructions/performance-optimization.instructions.md +420 -0
  134. package/templates/frontend/.github/instructions/playwright-python.instructions.md +62 -0
  135. package/templates/frontend/.github/instructions/playwright-typescript.instructions.md +86 -0
  136. package/templates/frontend/.github/instructions/security-and-owasp.instructions.md +51 -0
  137. package/templates/frontend/.github/instructions/self-explanatory-code-commenting.instructions.md +162 -0
  138. package/templates/frontend/.github/instructions/spec-driven-workflow-v1.instructions.md +323 -0
  139. package/templates/frontend/.github/instructions/sql-sp-generation.instructions.md +74 -0
  140. package/templates/frontend/.github/instructions/task-implementation.instructions.md +190 -0
  141. package/templates/frontend/.github/instructions/typescript-mcp-server.instructions.md +228 -0
  142. package/templates/frontend/.github/prompts/ai-prompt-engineering-safety-review.prompt.md +229 -0
  143. package/templates/frontend/.github/prompts/architecture-blueprint-generator.prompt.md +321 -0
  144. package/templates/frontend/.github/prompts/breakdown-epic-arch.prompt.md +65 -0
  145. package/templates/frontend/.github/prompts/breakdown-epic-pm.prompt.md +57 -0
  146. package/templates/frontend/.github/prompts/breakdown-feature-implementation.prompt.md +127 -0
  147. package/templates/frontend/.github/prompts/breakdown-feature-prd.prompt.md +60 -0
  148. package/templates/frontend/.github/prompts/breakdown-plan.prompt.md +508 -0
  149. package/templates/frontend/.github/prompts/copilot-instructions-blueprint-generator.prompt.md +293 -0
  150. package/templates/frontend/.github/prompts/create-agentsmd.prompt.md +248 -0
  151. package/templates/frontend/.github/prompts/create-github-issue-feature-from-specification.prompt.md +27 -0
  152. package/templates/frontend/.github/prompts/create-github-issues-feature-from-implementation-plan.prompt.md +27 -0
  153. package/templates/frontend/.github/prompts/create-github-issues-for-unmet-specification-requirements.prompt.md +35 -0
  154. package/templates/frontend/.github/prompts/create-implementation-plan.prompt.md +156 -0
  155. package/templates/frontend/.github/prompts/create-llms.prompt.md +209 -0
  156. package/templates/frontend/.github/prompts/create-specification.prompt.md +126 -0
  157. package/templates/frontend/.github/prompts/create-technical-spike.prompt.md +230 -0
  158. package/templates/frontend/.github/prompts/csharp-nunit.prompt.md +71 -0
  159. package/templates/frontend/.github/prompts/ef-core.prompt.md +76 -0
  160. package/templates/frontend/.github/prompts/folder-structure-blueprint-generator.prompt.md +404 -0
  161. package/templates/frontend/.github/prompts/gen-specs-as-issues.prompt.md +165 -0
  162. package/templates/frontend/.github/prompts/generate-custom-instructions-from-codebase.prompt.md +239 -0
  163. package/templates/frontend/.github/prompts/java-junit.prompt.md +64 -0
  164. package/templates/frontend/.github/prompts/memory-merger.prompt.md +107 -0
  165. package/templates/frontend/.github/prompts/multi-stage-dockerfile.prompt.md +46 -0
  166. package/templates/frontend/.github/prompts/playwright-automation-fill-in-form.prompt.md +29 -0
  167. package/templates/frontend/.github/prompts/playwright-explore-website.prompt.md +19 -0
  168. package/templates/frontend/.github/prompts/playwright-generate-test.prompt.md +19 -0
  169. package/templates/frontend/.github/prompts/postgresql-code-review.prompt.md +214 -0
  170. package/templates/frontend/.github/prompts/postgresql-optimization.prompt.md +406 -0
  171. package/templates/frontend/.github/prompts/project-workflow-analysis-blueprint-generator.prompt.md +294 -0
  172. package/templates/frontend/.github/prompts/prompt-builder.prompt.md +142 -0
  173. package/templates/frontend/.github/prompts/remember.prompt.md +125 -0
  174. package/templates/frontend/.github/prompts/review-and-refactor.prompt.md +15 -0
  175. package/templates/frontend/.github/prompts/sql-code-review.prompt.md +303 -0
  176. package/templates/frontend/.github/prompts/sql-optimization.prompt.md +298 -0
  177. package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-agents.prompt.md +72 -0
  178. package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-chatmodes.prompt.md +71 -0
  179. package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-collections.prompt.md +149 -0
  180. package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-instructions.prompt.md +88 -0
  181. package/templates/frontend/.github/prompts/suggest-awesome-github-copilot-prompts.prompt.md +71 -0
  182. package/templates/frontend/.github/prompts/technology-stack-blueprint-generator.prompt.md +242 -0
  183. package/templates/frontend/.github/prompts/typescript-mcp-server-generator.prompt.md +90 -0
  184. package/templates/frontend/.github/prompts/update-implementation-plan.prompt.md +157 -0
  185. package/templates/frontend/.github/prompts/update-markdown-file-index.prompt.md +76 -0
  186. package/templates/frontend/README.md +67 -0
  187. package/templates/frontend/biome.json +42 -44
  188. package/templates/frontend/package.json +1 -1
  189. package/templates/frontend/pnpm-lock.yaml +2011 -0
  190. package/templates/frontend/src/App.tsx +3 -3
  191. package/templates/backend/AGENTS.md +0 -23
  192. package/templates/backend/ARCHITECTURE.md +0 -53
  193. package/templates/backend/ORDER_SYSTEM.md +0 -93
  194. /package/templates/frontend/src/components/layout/{Layout.tsx → layout.component.tsx} +0 -0
  195. /package/templates/frontend/{RECOMMENDED_LIBRARIES.md → src/docs/RECOMMENDED_LIBRARIES.md} +0 -0
  196. /package/templates/frontend/{SETUP_SUMMARY.md → src/docs/SETUP_SUMMARY.md} +0 -0
  197. /package/templates/frontend/src/pages/about/{AboutPage.tsx → about.page.tsx} +0 -0
  198. /package/templates/frontend/src/pages/home/{HomePage.tsx → home.page.tsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { Route, Routes } from 'react-router-dom';
2
- import { Layout } from './components/layout/Layout';
3
- import { AboutPage } from './pages/about/AboutPage';
4
- import { HomePage } from './pages/home/HomePage';
2
+ import { Layout } from './components/layout/layout.component';
3
+ import { AboutPage } from './pages/about/about.page';
4
+ import { HomePage } from './pages/home/home.page';
5
5
 
6
6
  function App() {
7
7
  return (
@@ -1,23 +0,0 @@
1
- # Repository Guidelines
2
-
3
- ## Project Structure & Module Organization
4
- TypeScript sources live in `src/`, with graph traversal logic under `src/graph/` (crawl policy, state hashing, trajectory storage) and telemetry helpers in `src/telemetry.ts`. Example entrypoints such as `src/demo.ts` show how agents orchestrate flows. Generated JavaScript lands in `build/` (never hand-edit). Documentation and design notes are under `docs/`, and replay artifacts persist to `storage/` while running crawls or demo scripts. Keep tests adjacent to the code (for example `src/graph/xstate.test.ts`).
5
-
6
- ## Build, Test, and Development Commands
7
- - `pnpm install`: sets up dependencies for both the CLI and Playwright runtime.
8
- - `pnpm typecheck`: runs `tsc --noEmit` against `tsconfig.json` to catch type regressions early.
9
- - `pnpm build`: compiles `src/` to ESM output in `build/` via SWC; use `pnpm build:debug` when you need source maps.
10
- - `pnpm test`, `pnpm test:watch`, `pnpm test:ui`: execute the Vitest suite in batch, watch, or UI mode.
11
- - `pnpm knip`: detects unused files, exports, and dependencies—fix warnings before raising a PR.
12
-
13
- ## Coding Style & Naming Conventions
14
- Follow the repository's Biome configuration (`biome.json`) and run `npx biome check .` if needed. Use 2-space indentation, TypeScript `strict` semantics, and ECMAScript modules (`import/export`). Exported symbols and files should read as actions or nouns (`discoverState`, `persist.ts`). Tests mirror the file under test (`xstate.test.ts`). Prefer descriptive async function names reflecting their side effects.
15
-
16
- ## Testing Guidelines
17
- Vitest drives all unit and integration coverage. Name suites after the module (`describe("bfs")`) and isolate Playwright-heavy tests behind capability checks to keep CI fast. New behavior must include at least one test validating failure handling and a corresponding happy path. Run `pnpm test` locally before committing; `storage/` fixtures may be stubbed with lightweight mocks to avoid hitting real browsers.
18
-
19
- ## Commit & Pull Request Guidelines
20
- Use imperative, conventional messages observed in history (`feat:`, `chore:`, `fix:`). One logical change per commit, referencing an issue ID when relevant. Pull requests should describe motivation, summarize testing (`pnpm test` output, screenshots for Playwright interactions), and link design docs in `docs/` if expanded. Request review from an owner when touching crawl policy or telemetry layers, and ensure CI (typecheck, build, tests) passes before assignment.
21
-
22
- ## Environment & Configuration Tips
23
- Configure credentials through `.env` files consumed by Crawlee/Playwright—never hard-code tokens. For telemetry, set OpenTelemetry exporters via environment variables before running demos. Heavy crawls persist checkpoints to `storage/`; clean stale runs before committing to keep diffs focused.
@@ -1,53 +0,0 @@
1
- # Architecture Pattern Examples
2
-
3
- This starter kit demonstrates a blend of patterns from **"Designing Data-Intensive Applications"** and **"Patterns of Enterprise Application Architecture"**.
4
-
5
- ## Order System Example
6
-
7
- ### From Designing Data-Intensive Applications (DDIA):
8
-
9
- 1. **Event Sourcing** - All state changes stored as immutable events
10
- - `order.entity.ts`: Events are the source of truth
11
- - Events: `OrderCreated`, `ItemAdded`, `OrderPlaced`
12
-
13
- 2. **CQRS (Command Query Responsibility Segregation)**
14
- - Commands: `commands.usecase.ts` - Write operations that generate events
15
- - Queries: `queries.usecase.ts` - Read operations from materialized views
16
-
17
- 3. **Materialized Views** - Denormalized data for fast queries
18
- - `order.repository.impl.ts`: `readModel` maintains pre-computed summaries
19
- - User index for O(1) lookups by user ID
20
-
21
- 4. **Append-Only Log** - Event store never modifies existing data
22
- - New events are appended, never updated or deleted
23
-
24
- ### From Patterns of Enterprise Application Architecture (PEAA):
25
-
26
- 1. **Repository Pattern** - Abstract data access
27
- - `order.repository.ts`: Interface defining data operations
28
- - Separates domain logic from persistence
29
-
30
- 2. **Domain Model** - Rich business logic in entities
31
- - `order.entity.ts`: Order entity with business rules and validation
32
-
33
- 3. **Use Case / Service Layer** - Application logic orchestration
34
- - Commands and queries as separate use cases
35
- - Transaction boundaries and workflow management
36
-
37
- ## API Endpoints
38
-
39
- ```
40
- POST /orders # Create new order
41
- POST /orders/:id/items # Add item to order
42
- POST /orders/:id/place # Place order
43
- GET /orders/:id # Get order details
44
- GET /orders/user/:userId # Get user's orders (fast via materialized view)
45
- GET /orders/:id/events # Get event stream (audit log)
46
- ```
47
-
48
- ## Key Benefits
49
-
50
- - **Scalability**: Read/write separation allows independent scaling
51
- - **Auditability**: Complete event history for compliance/debugging
52
- - **Performance**: Materialized views optimize common queries
53
- - **Maintainability**: Clean architecture with separated concerns
@@ -1,93 +0,0 @@
1
- # Order System with Drizzle ORM
2
-
3
- ## Setup
4
-
5
- ### 1. Environment Variables
6
-
7
- Create a `.env` file:
8
-
9
- ```bash
10
- # Optional: PostgreSQL connection (if not set, uses in-memory)
11
- DATABASE_URL=postgres://user:password@localhost:5432/orders_db
12
-
13
- PORT=3000
14
- ```
15
-
16
- ### 2. Database Setup (Optional - for PostgreSQL)
17
-
18
- If you want to use PostgreSQL instead of in-memory storage:
19
-
20
- ```bash
21
- # Generate migration
22
- pnpm drizzle-kit generate
23
-
24
- # Run migration
25
- pnpm drizzle-kit migrate
26
-
27
- # Or use push for development
28
- pnpm drizzle-kit push
29
- ```
30
-
31
- ### 3. Run the Server
32
-
33
- ```bash
34
- # Development
35
- pnpm dev
36
-
37
- # Production
38
- pnpm build
39
- pnpm start
40
- ```
41
-
42
- ## API Endpoints
43
-
44
- Base URL: `http://localhost:3000/api`
45
-
46
- ### Create Order
47
- ```bash
48
- POST /api/orders
49
- Content-Type: application/json
50
-
51
- {
52
- "userId": "550e8400-e29b-41d4-a716-446655440000"
53
- }
54
- ```
55
-
56
- ### Add Item to Order
57
- ```bash
58
- POST /api/orders/:orderId/items
59
- Content-Type: application/json
60
-
61
- {
62
- "productId": "660e8400-e29b-41d4-a716-446655440000",
63
- "quantity": 2,
64
- "price": 29.99
65
- }
66
- ```
67
-
68
- ### Place Order
69
- ```bash
70
- POST /api/orders/:orderId/place
71
- ```
72
-
73
- ### Get Order Details
74
- ```bash
75
- GET /api/orders/:orderId
76
- ```
77
-
78
- ### Get User's Orders (Fast - from materialized view)
79
- ```bash
80
- GET /api/orders/user/:userId
81
- ```
82
-
83
- ### Get Order Event Stream (Audit log)
84
- ```bash
85
- GET /api/orders/:orderId/events
86
- ```
87
-
88
- ## Architecture
89
-
90
- - **No DATABASE_URL**: Uses in-memory repository (for testing/demo)
91
- - **With DATABASE_URL**: Uses Drizzle ORM with PostgreSQL
92
- - Event Sourcing with materialized views for optimal read performance
93
- - CQRS pattern with separate command and query operations