vega-framework 0.2.0__tar.gz → 0.2.1__tar.gz

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 (100) hide show
  1. {vega_framework-0.2.0 → vega_framework-0.2.1}/PKG-INFO +1 -1
  2. {vega_framework-0.2.0 → vega_framework-0.2.1}/pyproject.toml +1 -1
  3. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/commands/generate.py +15 -15
  4. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/commands/web.py +8 -7
  5. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/ARCHITECTURE.md.j2 +13 -13
  6. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/README.md.j2 +5 -5
  7. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/main.py.j2 +2 -3
  8. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/middleware.py.j2 +3 -3
  9. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/routes_init.py.j2 +3 -3
  10. {vega_framework-0.2.0 → vega_framework-0.2.1}/LICENSE +0 -0
  11. {vega_framework-0.2.0 → vega_framework-0.2.1}/README.md +0 -0
  12. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/__init__.py +0 -0
  13. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/__init__.py +0 -0
  14. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/commands/__init__.py +0 -0
  15. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/commands/add.py +0 -0
  16. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/commands/init.py +0 -0
  17. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/commands/migrate.py +0 -0
  18. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/commands/update.py +0 -0
  19. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/main.py +0 -0
  20. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/scaffolds/__init__.py +0 -0
  21. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/scaffolds/fastapi.py +0 -0
  22. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/scaffolds/sqlalchemy.py +0 -0
  23. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/scaffolds/vega_web.py +0 -0
  24. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/__init__.py +0 -0
  25. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/cli/command.py.j2 +0 -0
  26. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/cli/command_simple.py.j2 +0 -0
  27. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/cli/commands_init.py.j2 +0 -0
  28. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/components.py +0 -0
  29. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/domain/entity.py.j2 +0 -0
  30. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/domain/event.py.j2 +0 -0
  31. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/domain/event_handler.py.j2 +0 -0
  32. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/domain/interactor.py.j2 +0 -0
  33. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/domain/mediator.py.j2 +0 -0
  34. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/domain/repository_interface.py.j2 +0 -0
  35. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/domain/service_interface.py.j2 +0 -0
  36. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/infrastructure/model.py.j2 +0 -0
  37. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/infrastructure/repository_impl.py.j2 +0 -0
  38. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/infrastructure/service_impl.py.j2 +0 -0
  39. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/loader.py +0 -0
  40. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/.env.example +0 -0
  41. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/.gitignore +0 -0
  42. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/config.py.j2 +0 -0
  43. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/events_init.py.j2 +0 -0
  44. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/main.py.j2 +0 -0
  45. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/main_fastapi.py.j2 +0 -0
  46. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/main_standard.py.j2 +0 -0
  47. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/pyproject.toml.j2 +0 -0
  48. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/project/settings.py.j2 +0 -0
  49. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/sqlalchemy/alembic.ini.j2 +0 -0
  50. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/sqlalchemy/database_manager.py.j2 +0 -0
  51. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/sqlalchemy/env.py.j2 +0 -0
  52. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/sqlalchemy/script.py.mako +0 -0
  53. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/__init__.py.j2 +0 -0
  54. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/app.py.j2 +0 -0
  55. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/health_route.py.j2 +0 -0
  56. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/models_init.py.j2 +0 -0
  57. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/request_model.py.j2 +0 -0
  58. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/response_model.py.j2 +0 -0
  59. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/router.py.j2 +0 -0
  60. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/routes_init_autodiscovery.py.j2 +0 -0
  61. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/user_models.py.j2 +0 -0
  62. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/templates/web/users_route.py.j2 +0 -0
  63. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/utils/__init__.py +0 -0
  64. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/utils/async_support.py +0 -0
  65. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/utils/messages.py +0 -0
  66. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/utils/naming.py +0 -0
  67. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/cli/utils/validators.py +0 -0
  68. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/di/__init__.py +0 -0
  69. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/di/container.py +0 -0
  70. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/di/decorators.py +0 -0
  71. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/di/errors.py +0 -0
  72. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/di/scope.py +0 -0
  73. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/discovery/__init__.py +0 -0
  74. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/discovery/commands.py +0 -0
  75. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/discovery/events.py +0 -0
  76. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/discovery/routes.py +0 -0
  77. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/events/README.md +0 -0
  78. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/events/SYNTAX_GUIDE.md +0 -0
  79. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/events/__init__.py +0 -0
  80. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/events/bus.py +0 -0
  81. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/events/decorators.py +0 -0
  82. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/events/event.py +0 -0
  83. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/events/middleware.py +0 -0
  84. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/patterns/__init__.py +0 -0
  85. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/patterns/interactor.py +0 -0
  86. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/patterns/mediator.py +0 -0
  87. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/patterns/repository.py +0 -0
  88. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/patterns/service.py +0 -0
  89. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/settings/__init__.py +0 -0
  90. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/settings/base.py +0 -0
  91. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/__init__.py +0 -0
  92. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/application.py +0 -0
  93. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/builtin_middlewares.py +0 -0
  94. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/exceptions.py +0 -0
  95. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/middleware.py +0 -0
  96. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/request.py +0 -0
  97. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/response.py +0 -0
  98. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/route_middleware.py +0 -0
  99. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/router.py +0 -0
  100. {vega_framework-0.2.0 → vega_framework-0.2.1}/vega/web/routing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vega-framework
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Enterprise-ready Python framework that enforces Clean Architecture for building maintainable and scalable applications.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "vega-framework"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Enterprise-ready Python framework that enforces Clean Architecture for building maintainable and scalable applications."
5
5
  authors = ["Roberto Ferro"]
6
6
  license = "MIT"
@@ -394,13 +394,13 @@ def _register_router_in_init(project_root: Path, resource_file: str, resource_na
394
394
 
395
395
 
396
396
  def _generate_router(project_root: Path, project_name: str, name: str) -> None:
397
- """Generate a FastAPI router for a resource"""
397
+ """Generate a Vega Web router for a resource"""
398
398
 
399
399
  # Check if web folder exists
400
400
  web_path = project_root / "presentation" / "web"
401
401
  if not web_path.exists():
402
402
  click.echo(click.style("ERROR: Web module not found", fg='red'))
403
- click.echo(" Router generation requires FastAPI web module")
403
+ click.echo(" Router generation requires Vega Web module")
404
404
  click.echo(" Install it with: vega add web")
405
405
  return
406
406
 
@@ -440,13 +440,13 @@ def _generate_router(project_root: Path, project_name: str, name: str) -> None:
440
440
 
441
441
 
442
442
  def _generate_web_models(project_root: Path, project_name: str, name: str, is_request: bool, is_response: bool) -> None:
443
- """Generate Pydantic request or response model for FastAPI"""
443
+ """Generate Pydantic request or response model for Vega Web"""
444
444
 
445
445
  # Check if web folder exists
446
446
  web_path = project_root / "presentation" / "web"
447
447
  if not web_path.exists():
448
448
  click.echo(click.style("ERROR: Web module not found", fg='red'))
449
- click.echo(" Model generation requires FastAPI web module")
449
+ click.echo(" Model generation requires Vega Web module")
450
450
  click.echo(" Install it with: vega add web")
451
451
  return
452
452
 
@@ -531,13 +531,13 @@ def _generate_web_models(project_root: Path, project_name: str, name: str, is_re
531
531
 
532
532
 
533
533
  def _generate_middleware(project_root: Path, project_name: str, class_name: str, file_name: str) -> None:
534
- """Generate a FastAPI middleware"""
534
+ """Generate a Vega Web middleware"""
535
535
 
536
536
  # Check if web folder exists
537
537
  web_path = project_root / "presentation" / "web"
538
538
  if not web_path.exists():
539
539
  click.echo(click.style("ERROR: Web module not found", fg='red'))
540
- click.echo(" Middleware generation requires FastAPI web module")
540
+ click.echo(" Middleware generation requires Vega Web module")
541
541
  click.echo(" Install it with: vega add web")
542
542
  return
543
543
 
@@ -554,7 +554,7 @@ def _generate_middleware(project_root: Path, project_name: str, class_name: str,
554
554
  # Check if __init__.py exists
555
555
  init_file = middleware_path / "__init__.py"
556
556
  if not init_file.exists():
557
- init_file.write_text('"""FastAPI Middlewares"""\n')
557
+ init_file.write_text('"""Vega Web Middlewares"""\n')
558
558
  click.echo(f"+ Created {click.style(str(init_file.relative_to(project_root)), fg='green')}")
559
559
 
560
560
  # Generate middleware file
@@ -589,8 +589,8 @@ def _register_middleware_in_app(project_root: Path, class_name: str, file_name:
589
589
  click.echo(click.style(f'''
590
590
  from .middleware.{file_name} import {class_name}Middleware
591
591
 
592
- def create_app() -> FastAPI:
593
- app = FastAPI(...)
592
+ def create_app() -> VegaApp:
593
+ app = VegaApp(...)
594
594
  app.add_middleware({class_name}Middleware)
595
595
  app.include_router(get_api_router())
596
596
  return app
@@ -619,9 +619,9 @@ def create_app() -> FastAPI:
619
619
  break
620
620
 
621
621
  if not import_added:
622
- # Fallback: add after FastAPI import
622
+ # Fallback: add after VegaApp import
623
623
  for i, line in enumerate(lines):
624
- if 'from fastapi import' in line:
624
+ if 'from vega.web import' in line:
625
625
  lines.insert(i + 1, middleware_import)
626
626
  lines.insert(i + 2, '')
627
627
  break
@@ -629,8 +629,8 @@ def create_app() -> FastAPI:
629
629
  # Find create_app function and add middleware registration
630
630
  middleware_added = False
631
631
  for i, line in enumerate(lines):
632
- if 'app = FastAPI(' in line:
633
- # Find the end of FastAPI initialization
632
+ if 'app = VegaApp(' in line:
633
+ # Find the end of VegaApp initialization
634
634
  j = i + 1
635
635
  while j < len(lines) and not lines[j].strip().startswith('app.include_router'):
636
636
  j += 1
@@ -649,8 +649,8 @@ def create_app() -> FastAPI:
649
649
  click.echo(click.style(f'''
650
650
  from .middleware.{file_name} import {class_name}Middleware
651
651
 
652
- def create_app() -> FastAPI:
653
- app = FastAPI(...)
652
+ def create_app() -> VegaApp:
653
+ app = VegaApp(...)
654
654
  app.add_middleware({class_name}Middleware)
655
655
  app.include_router(get_api_router())
656
656
  return app
@@ -1,4 +1,4 @@
1
- """Web command - Manage FastAPI web server"""
1
+ """Web command - Manage Vega Web server"""
2
2
  import sys
3
3
  from pathlib import Path
4
4
 
@@ -7,7 +7,7 @@ import click
7
7
 
8
8
  @click.group()
9
9
  def web():
10
- """Manage FastAPI web server
10
+ """Manage Vega Web server
11
11
 
12
12
  Commands to manage the web server for your Vega project.
13
13
  The web module must be added to the project first using 'vega add web'.
@@ -21,7 +21,7 @@ def web():
21
21
  @click.option('--reload', is_flag=True, help='Enable auto-reload')
22
22
  @click.option('--path', default='.', help='Path to Vega project (default: current directory)')
23
23
  def run(host: str, port: int, reload: bool, path: str):
24
- """Start the FastAPI web server
24
+ """Start the Vega Web server
25
25
 
26
26
  Examples:
27
27
  vega web run
@@ -42,7 +42,7 @@ def run(host: str, port: int, reload: bool, path: str):
42
42
  web_main = project_path / "presentation" / "web" / "main.py"
43
43
  if not web_main.exists():
44
44
  click.echo(click.style("ERROR: Web module not found", fg='red'))
45
- click.echo("\nThe FastAPI web module is not available in this project.")
45
+ click.echo("\nThe Vega Web module is not available in this project.")
46
46
  click.echo("Add it using:")
47
47
  click.echo(click.style(" vega add web", fg='cyan', bold=True))
48
48
  sys.exit(1)
@@ -56,8 +56,9 @@ def run(host: str, port: int, reload: bool, path: str):
56
56
  import uvicorn
57
57
  except ImportError:
58
58
  click.echo(click.style("ERROR: uvicorn not installed", fg='red'))
59
- click.echo("\nInstall FastAPI dependencies:")
60
- click.echo(click.style(" poetry add fastapi uvicorn[standard]", fg='cyan', bold=True))
59
+ click.echo("\nUvicorn is required but not installed.")
60
+ click.echo("It should be included with vega-framework, but you can also install it with:")
61
+ click.echo(click.style(" poetry add uvicorn[standard]", fg='cyan', bold=True))
61
62
  sys.exit(1)
62
63
 
63
64
  # Initialize DI container first
@@ -73,7 +74,7 @@ def run(host: str, port: int, reload: bool, path: str):
73
74
  try:
74
75
  from presentation.web.main import app
75
76
  except ImportError as e:
76
- click.echo(click.style("ERROR: Failed to import FastAPI app", fg='red'))
77
+ click.echo(click.style("ERROR: Failed to import Vega Web app", fg='red'))
77
78
  click.echo(f"\nDetails: {e}")
78
79
  click.echo("\nMake sure:")
79
80
  click.echo(" 1. You are in the project directory or use --path")
@@ -38,7 +38,7 @@ The innermost layer containing pure business logic, completely independent of an
38
38
  **Rules:**
39
39
 
40
40
  - ✅ **NO** dependencies on any other layer
41
- - ✅ **NO** framework-specific code (no FastAPI, SQLAlchemy, etc.)
41
+ - ✅ **NO** framework-specific code (no Vega Web, SQLAlchemy, etc.)
42
42
  - ✅ **NO** infrastructure details (no database, HTTP, file system)
43
43
  - ✅ Pure business logic only
44
44
  - ✅ Only defines **interfaces**, never concrete implementations
@@ -90,7 +90,7 @@ Handles user interaction and external communication, acting as the entry point t
90
90
 
91
91
  **Contains:**
92
92
 
93
- - **Web API** - FastAPI routes, controllers, request/response models (when web is enabled)
93
+ - **Web API** - Vega Web routes, controllers, request/response models (when web is enabled)
94
94
  - **CLI** - Command-line interface commands and argument parsing
95
95
  - **GraphQL/gRPC** - Alternative API implementations (if needed)
96
96
  - **WebSockets** - Real-time communication handlers (if needed)
@@ -108,7 +108,7 @@ Handles user interaction and external communication, acting as the entry point t
108
108
  **Examples:**
109
109
 
110
110
  - **CLI**: Uses Click/Typer to define commands that invoke interactors or mediators
111
- - **Web API**: FastAPI endpoints that receive HTTP requests and call domain use cases
111
+ - **Web API**: Vega Web endpoints that receive HTTP requests and call domain use cases
112
112
  - **Both**: Can coexist in the same application, sharing the same business logic
113
113
 
114
114
  ## Core Patterns
@@ -344,7 +344,7 @@ The generator will interactively prompt for:
344
344
 
345
345
  Commands are **automatically discovered** from `presentation/cli/commands/` - no manual registration required.
346
346
 
347
- **FastAPI Routers** - HTTP API endpoints (requires web support):
347
+ **Vega Web Routers** - HTTP API endpoints (requires web support):
348
348
  ```bash
349
349
  vega generate router User
350
350
  vega generate router Product
@@ -353,7 +353,7 @@ vega generate router Order
353
353
 
354
354
  Routers are **automatically discovered** from `presentation/web/routes/` - no manual registration required.
355
355
 
356
- **FastAPI Middleware** - Request/response processing (requires web support):
356
+ **Vega Web Middleware** - Request/response processing (requires web support):
357
357
  ```bash
358
358
  vega generate middleware Logging
359
359
  vega generate middleware Authentication
@@ -362,12 +362,12 @@ vega generate middleware RateLimiting
362
362
 
363
363
  ### Adding Features to Existing Projects
364
364
 
365
- **Add FastAPI Web Support**:
365
+ **Add Vega Web Support**:
366
366
  ```bash
367
367
  vega add web
368
368
  ```
369
369
 
370
- Creates complete FastAPI scaffold:
370
+ Creates complete Vega Web scaffold:
371
371
  - `presentation/web/` directory structure
372
372
  - Routes and middleware setup
373
373
  - Health check endpoints
@@ -482,9 +482,9 @@ vega doctor
482
482
  | `vega generate interactor <Name>` | Generate use case |
483
483
  | `vega generate mediator <Name>` | Generate workflow |
484
484
  | `vega generate command <Name>` | Generate CLI command |
485
- | `vega generate router <Name>` | Generate FastAPI router |
485
+ | `vega generate router <Name>` | Generate Vega Web router |
486
486
  | `vega generate model <Name>` | Generate SQLAlchemy model |
487
- | `vega add web` | Add FastAPI support |
487
+ | `vega add web` | Add Vega Web support |
488
488
  | `vega add sqlalchemy` | Add database support |
489
489
  | `vega migrate <command>` | Manage database migrations |
490
490
  | `vega doctor` | Validate project architecture |
@@ -519,9 +519,9 @@ vega generate router Product
519
519
 
520
520
  This creates `presentation/web/routes/product.py`:
521
521
  ```python
522
- from fastapi import APIRouter
522
+ from vega.web import Router
523
523
 
524
- router = APIRouter() # MUST be named 'router'
524
+ router = Router() # MUST be named 'router'
525
525
 
526
526
  @router.get("/")
527
527
  async def list_products():
@@ -682,7 +682,7 @@ Vega projects follow a standard 4-layer structure:
682
682
  │ └── sendgrid_email_service.py # Sendgrid implementation
683
683
 
684
684
  ├── presentation/ # 🟠 PRESENTATION LAYER (Delivery Mechanisms)
685
- │ ├── web/ # FastAPI web interface (if enabled)
685
+ │ ├── web/ # Vega Web interface (if enabled)
686
686
  │ │ ├── __init__.py
687
687
  │ │ ├── routes/
688
688
  │ │ │ └── user_routes.py
@@ -833,7 +833,7 @@ async def create_user(name: str, email: str):
833
833
 
834
834
  **Benefits:**
835
835
  - Execute async interactors directly in CLI commands
836
- - Same business logic works in both CLI and Web (FastAPI) contexts
836
+ - Same business logic works in both CLI and Web (Vega Web) contexts
837
837
  - Clean async/await syntax
838
838
  - Automatic asyncio event loop management
839
839
 
@@ -20,9 +20,9 @@ Vega Framework application with Clean Architecture.
20
20
  │ └── services/ # Service implementations
21
21
 
22
22
  ├── presentation/ # Delivery mechanisms
23
- │ ├── web/ # FastAPI web interface (if added)
23
+ │ ├── web/ # Vega Web interface (if added)
24
24
  │ │ ├── routes/ # HTTP endpoints
25
- │ │ ├── app.py # FastAPI app factory
25
+ │ │ ├── app.py # Vega app factory
26
26
  │ │ └── main.py # ASGI entrypoint
27
27
  │ └── cli/ # CLI commands
28
28
 
@@ -45,7 +45,7 @@ cp .env.example .env
45
45
  python main.py hello
46
46
  python main.py greet --name John
47
47
 
48
- # If using FastAPI template, run the web server
48
+ # If using web template, run the web server
49
49
  vega web run
50
50
  vega web run --reload # With auto-reload
51
51
  # Visit http://localhost:8000/api/health/status
@@ -81,7 +81,7 @@ vega generate command ListUsers --impl sync
81
81
 
82
82
  ### Add Features
83
83
 
84
- Add FastAPI web support to your project:
84
+ Add Vega Web support to your project:
85
85
 
86
86
  ```bash
87
87
  vega add web
@@ -140,7 +140,7 @@ async def create_user(name: str):
140
140
  click.echo(f"Created: {user.name}")
141
141
  ```
142
142
 
143
- This allows the same async business logic to work in both CLI and web contexts (FastAPI).
143
+ This allows the same async business logic to work in both CLI and web contexts (Vega Web).
144
144
 
145
145
  ## Project Commands Quick Reference
146
146
 
@@ -1,5 +1,4 @@
1
- """FastAPI ASGI entrypoint for {{ project_name }}"""
2
- from fastapi import FastAPI
1
+ """Vega Web ASGI entrypoint for {{ project_name }}"""
3
2
  import config # noqa: F401 - Import to initialize DI container
4
3
 
5
4
  # Auto-discover event subscribers so @subscribe handlers are ready
@@ -12,7 +11,7 @@ else:
12
11
 
13
12
  from .app import create_app
14
13
 
15
- app: FastAPI = create_app()
14
+ app = create_app()
16
15
 
17
16
 
18
17
  if __name__ == "__main__":
@@ -1,5 +1,5 @@
1
- """{{ class_name }} middleware for FastAPI application"""
2
- from fastapi import Request, Response
1
+ """{{ class_name }} middleware for Vega Web application"""
2
+ from vega.web import Request, Response
3
3
  from starlette.middleware.base import BaseHTTPMiddleware
4
4
  from starlette.types import ASGIApp
5
5
  import time
@@ -14,7 +14,7 @@ class {{ class_name }}Middleware(BaseHTTPMiddleware):
14
14
  and responses before they're returned to clients.
15
15
 
16
16
  Usage:
17
- Add to your FastAPI app in app.py:
17
+ Add to your Vega Web app in app.py:
18
18
  from .middleware.{{ file_name }} import {{ class_name }}Middleware
19
19
  app.add_middleware({{ class_name }}Middleware)
20
20
  """
@@ -1,5 +1,5 @@
1
1
  """API routers aggregation"""
2
- from fastapi import APIRouter
2
+ from vega.web import Router
3
3
 
4
4
  from . import health, users
5
5
 
@@ -7,9 +7,9 @@ from . import health, users
7
7
  API_PREFIX = "/api"
8
8
 
9
9
 
10
- def get_api_router() -> APIRouter:
10
+ def get_api_router() -> Router:
11
11
  """Return application API router"""
12
- router = APIRouter(prefix=API_PREFIX)
12
+ router = Router(prefix=API_PREFIX)
13
13
  router.include_router(health.router, tags=["health"], prefix="/health")
14
14
  router.include_router(users.router, tags=["users"], prefix="/users")
15
15
  return router
File without changes
File without changes