vega-framework 0.1.35__py3-none-any.whl → 0.2.1__py3-none-any.whl

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 (35) hide show
  1. vega/cli/commands/add.py +9 -10
  2. vega/cli/commands/generate.py +15 -15
  3. vega/cli/commands/init.py +9 -8
  4. vega/cli/commands/web.py +8 -7
  5. vega/cli/main.py +4 -4
  6. vega/cli/scaffolds/__init__.py +6 -2
  7. vega/cli/scaffolds/vega_web.py +109 -0
  8. vega/cli/templates/__init__.py +34 -8
  9. vega/cli/templates/components.py +29 -13
  10. vega/cli/templates/project/ARCHITECTURE.md.j2 +13 -13
  11. vega/cli/templates/project/README.md.j2 +5 -5
  12. vega/cli/templates/web/app.py.j2 +5 -5
  13. vega/cli/templates/web/health_route.py.j2 +2 -2
  14. vega/cli/templates/web/main.py.j2 +2 -3
  15. vega/cli/templates/web/middleware.py.j2 +3 -3
  16. vega/cli/templates/web/router.py.j2 +2 -2
  17. vega/cli/templates/web/routes_init.py.j2 +3 -3
  18. vega/cli/templates/web/routes_init_autodiscovery.py.j2 +2 -2
  19. vega/cli/templates/web/users_route.py.j2 +2 -2
  20. vega/discovery/routes.py +13 -13
  21. vega/web/__init__.py +100 -0
  22. vega/web/application.py +234 -0
  23. vega/web/builtin_middlewares.py +288 -0
  24. vega/web/exceptions.py +151 -0
  25. vega/web/middleware.py +185 -0
  26. vega/web/request.py +120 -0
  27. vega/web/response.py +220 -0
  28. vega/web/route_middleware.py +266 -0
  29. vega/web/router.py +350 -0
  30. vega/web/routing.py +347 -0
  31. {vega_framework-0.1.35.dist-info → vega_framework-0.2.1.dist-info}/METADATA +10 -9
  32. {vega_framework-0.1.35.dist-info → vega_framework-0.2.1.dist-info}/RECORD +35 -24
  33. {vega_framework-0.1.35.dist-info → vega_framework-0.2.1.dist-info}/WHEEL +0 -0
  34. {vega_framework-0.1.35.dist-info → vega_framework-0.2.1.dist-info}/entry_points.txt +0 -0
  35. {vega_framework-0.1.35.dist-info → vega_framework-0.2.1.dist-info}/licenses/LICENSE +0 -0
vega/cli/commands/add.py CHANGED
@@ -3,7 +3,7 @@ from pathlib import Path
3
3
 
4
4
  import click
5
5
 
6
- from vega.cli.scaffolds import create_fastapi_scaffold, create_sqlalchemy_scaffold
6
+ from vega.cli.scaffolds import create_vega_web_scaffold, create_sqlalchemy_scaffold
7
7
 
8
8
 
9
9
  @click.command()
@@ -13,7 +13,7 @@ def add(feature: str, path: str):
13
13
  """Add features to an existing Vega project
14
14
 
15
15
  Features:
16
- web - Add FastAPI web scaffold to the project
16
+ web - Add Vega Web scaffold to the project
17
17
  sqlalchemy - Add SQLAlchemy database support (alias: db)
18
18
  db - Alias for sqlalchemy
19
19
 
@@ -40,13 +40,13 @@ def add(feature: str, path: str):
40
40
 
41
41
 
42
42
  def add_web_feature(project_path: Path, project_name: str):
43
- """Add FastAPI web scaffold to existing project"""
44
- click.echo(f"\n[*] Adding FastAPI web scaffold to: {click.style(project_name, fg='green', bold=True)}\n")
43
+ """Add Vega Web scaffold to existing project"""
44
+ click.echo(f"\n[*] Adding Vega Web scaffold to: {click.style(project_name, fg='green', bold=True)}\n")
45
45
 
46
46
  # Check if presentation/web already exists
47
47
  web_dir = project_path / "presentation" / "web"
48
48
  if web_dir.exists() and (web_dir / "main.py").exists():
49
- click.echo(click.style("WARNING: FastAPI scaffold already exists!", fg='yellow'))
49
+ click.echo(click.style("WARNING: Web scaffold already exists!", fg='yellow'))
50
50
  if not click.confirm("Do you want to overwrite existing files?"):
51
51
  click.echo("Aborted.")
52
52
  return
@@ -60,13 +60,12 @@ def add_web_feature(project_path: Path, project_name: str):
60
60
  presentation_dir.mkdir(parents=True, exist_ok=True)
61
61
  click.echo(f" + Created presentation/")
62
62
 
63
- # Create FastAPI scaffold
64
- create_fastapi_scaffold(project_path, project_name, overwrite=overwrite)
63
+ # Create Vega Web scaffold
64
+ create_vega_web_scaffold(project_path, project_name, overwrite=overwrite)
65
65
 
66
- click.echo(f"\n{click.style('SUCCESS: FastAPI web scaffold added!', fg='green', bold=True)}\n")
66
+ click.echo(f"\n{click.style('SUCCESS: Vega Web scaffold added!', fg='green', bold=True)}\n")
67
67
  click.echo("Next steps:")
68
- click.echo(" 1. Add FastAPI dependencies:")
69
- click.echo(" poetry add fastapi uvicorn[standard]")
68
+ click.echo(" 1. Dependencies are already included in vega-framework")
70
69
  click.echo(" 2. Run the server:")
71
70
  click.echo(" vega web run --reload")
72
71
  click.echo(" 3. Visit http://localhost:8000/api/health/status")
@@ -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
vega/cli/commands/init.py CHANGED
@@ -5,7 +5,7 @@ from pathlib import Path
5
5
 
6
6
  import click
7
7
 
8
- from vega.cli.scaffolds import create_fastapi_scaffold
8
+ from vega.cli.scaffolds import create_vega_web_scaffold
9
9
  from vega.cli.templates.loader import render_template
10
10
  import vega
11
11
 
@@ -104,14 +104,15 @@ def init_project(project_name: str, template: str, parent_path: str):
104
104
  click.echo(f" + Created ARCHITECTURE.md")
105
105
 
106
106
  # Create main.py based on template
107
- if template == "fastapi":
108
- click.echo("\n[*] Adding FastAPI scaffold (presentation/web/)")
109
- create_fastapi_scaffold(project_path, project_name)
107
+ # Support both "web" and "fastapi" (backward compat)
108
+ if template in ["web", "fastapi"]:
109
+ click.echo("\n[*] Adding Vega Web scaffold (presentation/web/)")
110
+ create_vega_web_scaffold(project_path, project_name)
110
111
 
111
- # Create main.py for FastAPI project
112
+ # Create main.py for web project
112
113
  main_content = render_template("main.py.j2", project_name=project_name, template="fastapi")
113
114
  (project_path / "main.py").write_text(main_content)
114
- click.echo(f" + Created main.py (FastAPI entrypoint)")
115
+ click.echo(f" + Created main.py (Vega Web entrypoint)")
115
116
  else:
116
117
  # Create standard main.py
117
118
  main_content = render_template("main.py.j2", project_name=project_name, template="standard")
@@ -126,9 +127,9 @@ def init_project(project_name: str, template: str, parent_path: str):
126
127
  click.echo(f" poetry install")
127
128
  click.echo(f" cp .env.example .env")
128
129
 
129
- if template == "fastapi":
130
+ if template in ["web", "fastapi"]:
130
131
  click.echo(f"\nRun commands:")
131
- click.echo(f" vega web run # Start FastAPI server (http://localhost:8000)")
132
+ click.echo(f" vega web run # Start Vega Web server (http://localhost:8000)")
132
133
  click.echo(f" vega web run --reload # Start with auto-reload")
133
134
  click.echo(f" python main.py hello # Run CLI command")
134
135
  click.echo(f" python main.py --help # Show all commands")
vega/cli/commands/web.py CHANGED
@@ -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")
vega/cli/main.py CHANGED
@@ -34,7 +34,7 @@ def cli():
34
34
 
35
35
  @cli.command()
36
36
  @click.argument('project_name')
37
- @click.option('--template', default='basic', help='Project template (basic, fastapi, ai-rag)')
37
+ @click.option('--template', default='basic', help='Project template (basic, web, ai-rag)')
38
38
  @click.option('--path', default='.', help='Parent directory for project')
39
39
  def init(project_name, template, path):
40
40
  """
@@ -49,7 +49,7 @@ def init(project_name, template, path):
49
49
 
50
50
  Examples:
51
51
  vega init my-app
52
- vega init my-api --template=fastapi
52
+ vega init my-api --template=web
53
53
  vega init my-ai --template=ai-rag --path=./projects
54
54
  """
55
55
  init_project(project_name, template, path)
@@ -88,8 +88,8 @@ def generate(component_type, name, path, impl, request, response):
88
88
  service - Service interface (domain layer)
89
89
  interactor - Use case (business logic)
90
90
  mediator - Workflow (orchestrates use cases)
91
- router - FastAPI router (requires web module)
92
- middleware - FastAPI middleware (requires web module)
91
+ router - Vega Web router (requires web module)
92
+ middleware - Vega Web middleware (requires web module)
93
93
  webmodel - Pydantic request/response models (requires web module)
94
94
  model - SQLAlchemy model (requires sqlalchemy module)
95
95
  command - CLI command (async by default)
@@ -1,9 +1,13 @@
1
1
  """Scaffolding helpers for Vega CLI."""
2
2
 
3
- from .fastapi import create_fastapi_scaffold
3
+ from .vega_web import create_vega_web_scaffold
4
4
  from .sqlalchemy import create_sqlalchemy_scaffold
5
5
 
6
+ # Backward compatibility alias
7
+ create_fastapi_scaffold = create_vega_web_scaffold
8
+
6
9
  __all__ = [
7
- "create_fastapi_scaffold",
10
+ "create_vega_web_scaffold",
11
+ "create_fastapi_scaffold", # Deprecated: use create_vega_web_scaffold
8
12
  "create_sqlalchemy_scaffold",
9
13
  ]
@@ -0,0 +1,109 @@
1
+ """Vega Web scaffolding for new projects"""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+ from typing import Callable, Iterable
7
+
8
+ import click
9
+
10
+ from vega.cli.templates import (
11
+ render_vega_app,
12
+ render_vega_health_route,
13
+ render_vega_main,
14
+ render_vega_routes_init_autodiscovery,
15
+ render_vega_user_route,
16
+ render_pydantic_models_init,
17
+ render_pydantic_user_models,
18
+ render_web_package_init,
19
+ )
20
+
21
+
22
+ def create_vega_web_scaffold(
23
+ project_root: Path,
24
+ project_name: str,
25
+ *,
26
+ overwrite: bool = False,
27
+ echo: Callable[[str], None] | None = None,
28
+ ) -> list[Path]:
29
+ """
30
+ Create Vega Web scaffolding under the project presentation/web/ directory.
31
+
32
+ This creates a complete web application structure using Vega's built-in
33
+ web framework (built on Starlette).
34
+
35
+ Args:
36
+ project_root: Root directory of the project
37
+ project_name: Name of the project
38
+ overwrite: Whether to overwrite existing files
39
+ echo: Function to print messages (defaults to click.echo)
40
+
41
+ Returns:
42
+ List of created file paths
43
+ """
44
+ if echo is None:
45
+ echo = click.echo
46
+
47
+ created: list[Path] = []
48
+ web_dir = project_root / "presentation" / "web"
49
+ routes_dir = web_dir / "routes"
50
+ models_dir = web_dir / "models"
51
+
52
+ files: Iterable[tuple[Path, str]] = (
53
+ (web_dir / "__init__.py", render_web_package_init()),
54
+ (web_dir / "app.py", render_vega_app(project_name)),
55
+ (web_dir / "main.py", render_vega_main(project_name)),
56
+ (routes_dir / "__init__.py", render_vega_routes_init_autodiscovery()),
57
+ (routes_dir / "health.py", render_vega_health_route()),
58
+ (routes_dir / "users.py", render_vega_user_route()),
59
+ (models_dir / "__init__.py", render_pydantic_models_init()),
60
+ (models_dir / "user_models.py", render_pydantic_user_models()),
61
+ )
62
+
63
+ web_dir.mkdir(parents=True, exist_ok=True)
64
+ routes_dir.mkdir(parents=True, exist_ok=True)
65
+ models_dir.mkdir(parents=True, exist_ok=True)
66
+
67
+ for path, content in files:
68
+ rel_path = path.relative_to(project_root)
69
+ if path.exists() and not overwrite:
70
+ echo(
71
+ click.style(
72
+ f"WARNING: {rel_path} already exists. Skipping.",
73
+ fg="yellow",
74
+ )
75
+ )
76
+ continue
77
+
78
+ path.parent.mkdir(parents=True, exist_ok=True)
79
+ path.write_text(content, encoding="utf-8")
80
+ created.append(rel_path)
81
+ echo(f"+ Created {click.style(str(rel_path), fg='green')}")
82
+
83
+ echo("\n[TIP] Vega Web scaffold ready:")
84
+ echo(" 1. poetry install # sync dependencies (or poetry update)")
85
+ echo(" 2. poetry run vega web run --reload")
86
+ echo(" 3. Or: poetry run uvicorn presentation.web.main:app --reload")
87
+
88
+ return created
89
+
90
+
91
+ def _ensure_dependency_line(lines: list[str], name: str, spec: str) -> bool:
92
+ """Insert dependency assignment into [tool.poetry.dependencies] if missing."""
93
+ header = "[tool.poetry.dependencies]"
94
+ try:
95
+ start = next(i for i, line in enumerate(lines) if line.strip() == header)
96
+ except StopIteration:
97
+ return False
98
+
99
+ end = start + 1
100
+ while end < len(lines) and not lines[end].startswith("["):
101
+ end += 1
102
+
103
+ block = lines[start + 1:end]
104
+ if any(line.strip().startswith(f"{name} =") for line in block):
105
+ return False
106
+
107
+ insertion = f"{name} = \"{spec}\"\n"
108
+ lines.insert(end, insertion)
109
+ return True
@@ -7,18 +7,32 @@ from .components import (
7
7
  render_repository_interface,
8
8
  render_service_interface,
9
9
  render_web_package_init,
10
+ # New Vega Web functions
11
+ render_vega_app,
12
+ render_vega_routes_init,
13
+ render_vega_health_route,
14
+ render_vega_user_route,
15
+ render_vega_dependencies,
16
+ render_vega_main,
17
+ render_vega_project_main,
18
+ render_vega_router,
19
+ render_vega_middleware,
20
+ render_vega_routes_init_autodiscovery,
21
+ # Backward compatibility (deprecated)
10
22
  render_fastapi_app,
11
23
  render_fastapi_routes_init,
12
24
  render_fastapi_health_route,
13
25
  render_fastapi_user_route,
14
26
  render_fastapi_dependencies,
15
27
  render_fastapi_main,
16
- render_standard_main,
17
28
  render_fastapi_project_main,
18
- render_pydantic_models_init,
19
- render_pydantic_user_models,
20
29
  render_fastapi_router,
21
30
  render_fastapi_middleware,
31
+ render_fastapi_routes_init_autodiscovery,
32
+ # Common
33
+ render_standard_main,
34
+ render_pydantic_models_init,
35
+ render_pydantic_user_models,
22
36
  render_database_manager,
23
37
  render_alembic_ini,
24
38
  render_alembic_env,
@@ -27,7 +41,6 @@ from .components import (
27
41
  render_cli_command,
28
42
  render_cli_command_simple,
29
43
  render_cli_commands_init,
30
- render_fastapi_routes_init_autodiscovery,
31
44
  render_event,
32
45
  render_event_handler,
33
46
  render_events_init,
@@ -43,18 +56,32 @@ __all__ = [
43
56
  "render_infrastructure_repository",
44
57
  "render_infrastructure_service",
45
58
  "render_web_package_init",
59
+ # Vega Web
60
+ "render_vega_app",
61
+ "render_vega_routes_init",
62
+ "render_vega_health_route",
63
+ "render_vega_user_route",
64
+ "render_vega_dependencies",
65
+ "render_vega_main",
66
+ "render_vega_project_main",
67
+ "render_vega_router",
68
+ "render_vega_middleware",
69
+ "render_vega_routes_init_autodiscovery",
70
+ # Backward compat (deprecated)
46
71
  "render_fastapi_app",
47
72
  "render_fastapi_routes_init",
48
73
  "render_fastapi_health_route",
49
74
  "render_fastapi_user_route",
50
75
  "render_fastapi_dependencies",
51
76
  "render_fastapi_main",
52
- "render_standard_main",
53
77
  "render_fastapi_project_main",
54
- "render_pydantic_models_init",
55
- "render_pydantic_user_models",
56
78
  "render_fastapi_router",
57
79
  "render_fastapi_middleware",
80
+ "render_fastapi_routes_init_autodiscovery",
81
+ # Common
82
+ "render_standard_main",
83
+ "render_pydantic_models_init",
84
+ "render_pydantic_user_models",
58
85
  "render_database_manager",
59
86
  "render_alembic_ini",
60
87
  "render_alembic_env",
@@ -63,7 +90,6 @@ __all__ = [
63
90
  "render_cli_command",
64
91
  "render_cli_command_simple",
65
92
  "render_cli_commands_init",
66
- "render_fastapi_routes_init_autodiscovery",
67
93
  "render_event",
68
94
  "render_event_handler",
69
95
  "render_events_init",
@@ -84,27 +84,27 @@ def render_web_package_init() -> str:
84
84
  return render_template("__init__.py.j2", subfolder="web")
85
85
 
86
86
 
87
- def render_fastapi_app(project_name: str) -> str:
87
+ def render_vega_app(project_name: str) -> str:
88
88
  """Return the template for web/app.py"""
89
89
  return render_template("app.py.j2", subfolder="web", project_name=project_name)
90
90
 
91
91
 
92
- def render_fastapi_routes_init() -> str:
92
+ def render_vega_routes_init() -> str:
93
93
  """Return the template for web/routes/__init__.py"""
94
94
  return render_template("routes_init.py.j2", subfolder="web")
95
95
 
96
96
 
97
- def render_fastapi_health_route() -> str:
97
+ def render_vega_health_route() -> str:
98
98
  """Return the template for web/routes/health.py"""
99
99
  return render_template("health_route.py.j2", subfolder="web")
100
100
 
101
101
 
102
- def render_fastapi_dependencies() -> str:
102
+ def render_vega_dependencies() -> str:
103
103
  """Return the template for web/dependencies.py"""
104
104
  return render_template("dependencies.py.j2", subfolder="web")
105
105
 
106
106
 
107
- def render_fastapi_main(project_name: str) -> str:
107
+ def render_vega_main(project_name: str) -> str:
108
108
  """Return the template for presentation/web/main.py"""
109
109
  return render_template("main.py.j2", subfolder="web", project_name=project_name)
110
110
 
@@ -116,8 +116,8 @@ def render_standard_main(project_name: str) -> str:
116
116
  )
117
117
 
118
118
 
119
- def render_fastapi_project_main(project_name: str) -> str:
120
- """Return the template for main.py (FastAPI project with Web and CLI)"""
119
+ def render_vega_project_main(project_name: str) -> str:
120
+ """Return the template for main.py (Vega Web project with Web and CLI)"""
121
121
  return render_template(
122
122
  "main_fastapi.py.j2", subfolder="project", project_name=project_name
123
123
  )
@@ -133,13 +133,13 @@ def render_pydantic_user_models() -> str:
133
133
  return render_template("user_models.py.j2", subfolder="web")
134
134
 
135
135
 
136
- def render_fastapi_user_route() -> str:
136
+ def render_vega_user_route() -> str:
137
137
  """Return the template for web/routes/users.py"""
138
138
  return render_template("users_route.py.j2", subfolder="web")
139
139
 
140
140
 
141
- def render_fastapi_router(resource_name: str, resource_file: str, project_name: str) -> str:
142
- """Return the template for a FastAPI router"""
141
+ def render_vega_router(resource_name: str, resource_file: str, project_name: str) -> str:
142
+ """Return the template for a Vega Web router"""
143
143
  return render_template(
144
144
  "router.py.j2",
145
145
  subfolder="web",
@@ -149,8 +149,8 @@ def render_fastapi_router(resource_name: str, resource_file: str, project_name:
149
149
  )
150
150
 
151
151
 
152
- def render_fastapi_middleware(class_name: str, file_name: str) -> str:
153
- """Return the template for a FastAPI middleware"""
152
+ def render_vega_middleware(class_name: str, file_name: str) -> str:
153
+ """Return the template for a Vega Web middleware"""
154
154
  return render_template(
155
155
  "middleware.py.j2",
156
156
  subfolder="web",
@@ -159,6 +159,18 @@ def render_fastapi_middleware(class_name: str, file_name: str) -> str:
159
159
  )
160
160
 
161
161
 
162
+ # Backward compatibility aliases (deprecated)
163
+ render_fastapi_app = render_vega_app
164
+ render_fastapi_routes_init = render_vega_routes_init
165
+ render_fastapi_health_route = render_vega_health_route
166
+ render_fastapi_dependencies = render_vega_dependencies
167
+ render_fastapi_main = render_vega_main
168
+ render_fastapi_project_main = render_vega_project_main
169
+ render_fastapi_user_route = render_vega_user_route
170
+ render_fastapi_router = render_vega_router
171
+ render_fastapi_middleware = render_vega_middleware
172
+
173
+
162
174
  def render_database_manager() -> str:
163
175
  """Return the template for database_manager.py"""
164
176
  return render_template("database_manager.py.j2", subfolder="sqlalchemy")
@@ -244,11 +256,15 @@ def render_cli_commands_init() -> str:
244
256
  return render_template("commands_init.py.j2", subfolder="cli")
245
257
 
246
258
 
247
- def render_fastapi_routes_init_autodiscovery() -> str:
259
+ def render_vega_routes_init_autodiscovery() -> str:
248
260
  """Return the template for web/routes/__init__.py with auto-discovery"""
249
261
  return render_template("routes_init_autodiscovery.py.j2", subfolder="web")
250
262
 
251
263
 
264
+ # Backward compatibility alias
265
+ render_fastapi_routes_init_autodiscovery = render_vega_routes_init_autodiscovery
266
+
267
+
252
268
  def render_event(class_name: str, fields: list[dict]) -> str:
253
269
  """Return the template for a domain event"""
254
270
  return render_template(