feature domain architecture#209
Merged
Merged
Conversation
Reorganize 23 packages into 5 logical domains to improve code discoverability and maintainability. Domain structure: - foundation/: shared infrastructure (helper, cfg, log, git, vfs, tasks, tools, up) - apimodel/: API specification and model (model, idl, spec) - codegen/: code generation and templates (gen, tpl, repos) - orchestration/: solution and project management (sol, prj) - runtime/: runtime infrastructure (mon, evt, net, sim, streams) Changes: - Move and rename 23 packages to new domain structure - Update 1000+ import paths across entire codebase - Update package declarations and internal references - Preserve testdata and test files - Maintain clean dependency hierarchy: foundation → apimodel → codegen → orchestration Benefits: - Reduced package count from 23 to ~7 top-level domains - Clearer separation of concerns - Easier to work on isolated features within domains - No circular dependencies
The testdata directory for the model package was not moved during the package reorganization, causing TestVoidReturn and other tests to fail. Restored testdata files from previous commit and moved them to the new pkg/apimodel/testdata location. All tests now pass successfully.
Rename the apimodel package to objmodel to better reflect that it represents the ObjectAPI model and avoid future naming confusion with REST API models. Changes: - Rename pkg/apimodel/ to pkg/objmodel/ - Update package declarations from apimodel to objmodel - Update all import paths across codebase - Update all package references (apimodel. to objmodel.) Rationale: - The IDL is called ObjectAPI, so objmodel is more accurate - Avoids confusion when REST API models are introduced later - Better aligns naming with the domain concepts
Add comprehensive architecture documentation for adding REST API server and React web UI to the CLI. Key decisions: - Server runs as 'apigear serve' subcommand (not separate binary) - Use chi router with stdlib http.HandlerFunc pattern - Swag for OpenAPI generation (annotations in code) - AI-written TypeScript SDKs (not codegen) - Vertical slice ownership for parallel development - Clear separation: objmodel (ObjectAPI) vs restmodel (REST DTOs) Structure: - pkg/cmd/serve/ - Serve subcommand - internal/server/ - HTTP handlers and router - internal/restmodel/ - REST API DTOs - web/ - Vite + React frontend - docs/swagger/ - Auto-generated OpenAPI specs Benefits: - Minimal merge conflicts (domain-based ownership) - Single binary distribution - Type-safe APIs (Go + TypeScript) - Auto-generated documentation - Parallel frontend/backend development
Remove 45 auto-generated markdown files from docs/ that documented individual CLI commands. These files were: - Auto-generated from cobra commands - Outdated and not maintained - Duplicated information available via --help - Cluttering the docs directory The CLI help is the single source of truth for command documentation: apigear --help apigear <command> --help Kept: - ARCHITECTURE-REST-WEB.md (new architecture plan) - Other manually written architecture docs
Update the architecture documentation to reflect the new package structure after the domain-based consolidation. Major changes: - Updated high-level architecture diagram to show 5 domains - Replaced 27-package directory layout with domain-based structure - Rewrote package architecture section with domain descriptions - Added dependency hierarchy and architectural principles - Updated all package references (model→objmodel, etc.) - Added Future Architecture section for REST API + Web UI - Added Package Reorganization History section - Updated design pattern locations New domain structure: - foundation/ - Shared infrastructure (8 subpackages) - objmodel/ - ObjectAPI model (3 subpackages) - codegen/ - Code generation (12 language filters + registry/template) - orchestration/ - High-level workflows (solution, project) - runtime/ - Runtime services (monitoring, network, simulation) Benefits documented: - Clear dependency hierarchy - No circular dependencies - Better code discoverability - Easier parallel development
Update Go version from 1.25.0 to 1.25.7 to fix 5 standard library vulnerabilities in net/url, crypto/tls, and crypto/x509. Update dependencies golang.org/x/crypto to v0.48.0 and github.com/ulikunitz/xz to v0.5.15 to resolve DoS and memory leak vulnerabilities.
Update github.com/go-git/go-git/v5 from v5.16.2 to v5.16.5 to fix data integrity verification vulnerability. Replace vulnerable github.com/whilp/git-urls (CVE with no patch) with go-git's built-in transport.NewEndpoint for secure URL parsing. Update test expectations to match go-git's more permissive (and correct) URL validation behavior that accepts local paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
new domain architecture. Essentially we repackaged the individual packages to larger packages to avoid editing collision. We also added a plan for an addition of REST APIs and a web ui.
Also added some security updates which will require go 1.15.7