fastapi-spawn 0.5.1__tar.gz → 0.5.3__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 (78) hide show
  1. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/PKG-INFO +1 -1
  2. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/cli.py +109 -0
  3. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/docker/docker-compose.yml.j2 +8 -0
  4. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/pyproject.toml +1 -1
  5. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/.gitignore +0 -0
  6. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/LICENSE +0 -0
  7. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/README.md +0 -0
  8. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/__init__.py +0 -0
  9. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/config.py +0 -0
  10. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/constants.py +0 -0
  11. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/generator.py +0 -0
  12. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/interactive.py +0 -0
  13. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/steps.py +0 -0
  14. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/alembic/alembic.ini.j2 +0 -0
  15. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/alembic/env.py.j2 +0 -0
  16. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/__init__.py.j2 +0 -0
  17. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/admin/setup.py.j2 +0 -0
  18. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/deps.py.j2 +0 -0
  19. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/graphql.py.j2 +0 -0
  20. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/auth/router.py.j2 +0 -0
  21. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/auth/sso.py.j2 +0 -0
  22. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/health/router.py.j2 +0 -0
  23. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/pagination/router.py.j2 +0 -0
  24. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/payments/router.py.j2 +0 -0
  25. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/permissions/router.py.j2 +0 -0
  26. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/router.py.j2 +0 -0
  27. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/streaming/router.py.j2 +0 -0
  28. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/uploads/router.py.j2 +0 -0
  29. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/api/v1/ws/router.py.j2 +0 -0
  30. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/ai.py.j2 +0 -0
  31. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/cache.py.j2 +0 -0
  32. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/config.py.j2 +0 -0
  33. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/email.py.j2 +0 -0
  34. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/exceptions.py.j2 +0 -0
  35. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/logger.py.j2 +0 -0
  36. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/logging.py.j2 +0 -0
  37. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/monitoring.py.j2 +0 -0
  38. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/notifications.py.j2 +0 -0
  39. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/ocr.py.j2 +0 -0
  40. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/permissions.py.j2 +0 -0
  41. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/search.py.j2 +0 -0
  42. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/security.py.j2 +0 -0
  43. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/storage.py.j2 +0 -0
  44. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/vector_db.py.j2 +0 -0
  45. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/core/ws_manager.py.j2 +0 -0
  46. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/db/session.py.j2 +0 -0
  47. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/frontend/index.html.j2 +0 -0
  48. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/main.py.j2 +0 -0
  49. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/middleware/__init__.py.j2 +0 -0
  50. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/middleware/rate_limit.py.j2 +0 -0
  51. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/middleware/request_logger.py.j2 +0 -0
  52. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/app/middleware/response_format.py.j2 +0 -0
  53. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/base/Makefile.j2 +0 -0
  54. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/base/README.md.j2 +0 -0
  55. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/base/env.j2 +0 -0
  56. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/base/env_example.j2 +0 -0
  57. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/base/gitignore.j2 +0 -0
  58. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/base/pre_commit.j2 +0 -0
  59. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/base/pyproject.toml.j2 +0 -0
  60. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/ci/github/publish.yml.j2 +0 -0
  61. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/ci/github/tests.yml.j2 +0 -0
  62. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/ci/gitlab/gitlab-ci.yml.j2 +0 -0
  63. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/db/seed.py.j2 +0 -0
  64. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/docker/Dockerfile.j2 +0 -0
  65. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/docker/dockerignore.j2 +0 -0
  66. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/infra/docker/docker-compose.prod.yml.j2 +0 -0
  67. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/infra/helm/Chart.yaml.j2 +0 -0
  68. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/infra/helm/values.yaml.j2 +0 -0
  69. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/infra/terraform/main.tf.j2 +0 -0
  70. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/infra/terraform/variables.tf.j2 +0 -0
  71. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/root/main.py.j2 +0 -0
  72. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/tasks/arq_worker.py.j2 +0 -0
  73. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/tasks/celery_app.py.j2 +0 -0
  74. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/tasks/sample_tasks.py.j2 +0 -0
  75. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/tests/conftest.py.j2 +0 -0
  76. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/templates/tests/test_health.py.j2 +0 -0
  77. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/utils.py +0 -0
  78. {fastapi_spawn-0.5.1 → fastapi_spawn-0.5.3}/fastapi_spawn/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-spawn
3
- Version: 0.5.1
3
+ Version: 0.5.3
4
4
  Summary: A powerful CLI tool to scaffold production-ready FastAPI projects with flexible database, auth, broker, and deployment options.
5
5
  Project-URL: Homepage, https://github.com/Bishwajitgarai/fastapi-spawn
6
6
  Project-URL: Documentation, https://github.com/Bishwajitgarai/fastapi-spawn#readme
@@ -470,6 +470,115 @@ def validate_config(
470
470
  console.print("[dim]Full TOML validation coming in a future release.[/dim]")
471
471
 
472
472
 
473
+ @app.command("inspect", help="Inspect and fix corrupted or missing tracking files.")
474
+ def inspect_project(
475
+ project_dir: Path = typer.Option(Path("."), "--dir", "-d", help="Path to the existing project"),
476
+ ) -> None:
477
+ """Inspect and fix corrupted or missing tracking files."""
478
+ import json
479
+ _print_banner()
480
+
481
+ if not project_dir.exists():
482
+ console.print(f"[bold red]✗ Directory not found:[/bold red] {project_dir.resolve()}")
483
+ raise typer.Exit(1)
484
+
485
+ config_path = project_dir / ".fastapi-spawn.json"
486
+ project_status: dict = {}
487
+ corrupted = False
488
+
489
+ if config_path.exists():
490
+ try:
491
+ project_status = json.loads(config_path.read_text(encoding="utf-8"))
492
+ console.print("[bold green]✓ Found .fastapi-spawn.json[/bold green]")
493
+ except Exception:
494
+ console.print("[bold yellow]⚠ .fastapi-spawn.json is corrupted.[/bold yellow]")
495
+ corrupted = True
496
+ else:
497
+ console.print("[bold yellow]⚠ .fastapi-spawn.json is missing.[/bold yellow]")
498
+ corrupted = True
499
+
500
+ if corrupted:
501
+ console.print("[cyan]Attempting to reconstruct project state...[/cyan]")
502
+ inferred_features = []
503
+
504
+ # Check pyproject.toml for deps
505
+ pyproject_path = project_dir / "pyproject.toml"
506
+ content = ""
507
+ if pyproject_path.exists():
508
+ content = pyproject_path.read_text(encoding="utf-8")
509
+ if "fastapi-sso" in content or "pyjwt" in content:
510
+ inferred_features.append("auth")
511
+ if "boto3" in content:
512
+ inferred_features.append("s3")
513
+ if "google-cloud-storage" in content:
514
+ inferred_features.append("gcs")
515
+ if "cloudinary" in content:
516
+ inferred_features.append("cloudinary")
517
+ if "openai" in content:
518
+ inferred_features.append("openai")
519
+ if "anthropic" in content:
520
+ inferred_features.append("anthropic")
521
+ if "google-genai" in content or "google-generativeai" in content:
522
+ inferred_features.append("gemini")
523
+ if "ollama" in content:
524
+ inferred_features.append("ollama")
525
+ if "alembic" in content:
526
+ inferred_features.append("alembic")
527
+ if "celery" in content:
528
+ inferred_features.append("celery")
529
+ if "arq" in content:
530
+ inferred_features.append("arq")
531
+ if "redis" in content:
532
+ inferred_features.append("redis")
533
+ if "aiokafka" in content:
534
+ inferred_features.append("kafka")
535
+ if "sentry-sdk" in content:
536
+ inferred_features.append("sentry")
537
+ if "prometheus-fastapi-instrumentator" in content:
538
+ inferred_features.append("prometheus")
539
+ if "opentelemetry" in content:
540
+ inferred_features.append("opentelemetry")
541
+ if "sendgrid" in content:
542
+ inferred_features.append("sendgrid")
543
+ if "resend" in content:
544
+ inferred_features.append("resend")
545
+ if "qdrant" in content:
546
+ inferred_features.append("qdrant")
547
+
548
+ # Check for files
549
+ if (project_dir / "app" / "core" / "security.py").exists():
550
+ if "auth" not in inferred_features:
551
+ inferred_features.append("auth")
552
+ if (project_dir / "migrations" / "env.py").exists():
553
+ if "alembic" not in inferred_features:
554
+ inferred_features.append("alembic")
555
+
556
+ project_status["installed_features"] = list(set(inferred_features))
557
+ project_status["project_name"] = project_dir.name
558
+
559
+ # Guess DB
560
+ if "asyncpg" in content or "psycopg" in content:
561
+ project_status["db"] = "postgresql"
562
+ elif "aiomysql" in content or "pymysql" in content:
563
+ project_status["db"] = "mysql"
564
+ elif "motor" in content:
565
+ project_status["db"] = "mongodb"
566
+ else:
567
+ project_status["db"] = "sqlite"
568
+
569
+ try:
570
+ config_path.write_text(json.dumps(project_status, indent=2), encoding="utf-8")
571
+ console.print("[bold green]✓ Reconstructed and saved .fastapi-spawn.json[/bold green]")
572
+ except Exception as e:
573
+ console.print(f"[bold red]✗ Failed to save tracking file: {e}[/bold red]")
574
+ raise typer.Exit(1)
575
+
576
+ console.print(f"\n[bold cyan]Project Status:[/bold cyan]")
577
+ console.print(f" Name: {project_status.get('project_name', 'Unknown')}")
578
+ console.print(f" DB: {project_status.get('db', 'Unknown')}")
579
+ console.print(f" Installed Features: {', '.join(project_status.get('installed_features', [])) or 'None'}")
580
+
581
+
473
582
  # ── `add` command ──────────────────────────────────────────────────────────────
474
583
 
475
584
  _ADDABLE_FEATURES = {
@@ -30,6 +30,7 @@ services:
30
30
  {% endif %}
31
31
  volumes:
32
32
  - .:/app
33
+ - /app/.venv
33
34
  {% if (has_relational_db and db != "sqlite") or has_mongo or broker == "redis" or cache == "redis" or broker == "rabbitmq" or vector_db == "qdrant" or vector_db == "elasticsearch" or vector_db == "opensearch" or ai == "ollama" %}
34
35
  environment:
35
36
  {% if has_relational_db and db == "postgresql" %}
@@ -59,6 +60,13 @@ services:
59
60
  {% if ai == "ollama" %}
60
61
  - OLLAMA_HOST=ollama
61
62
  {% endif %}
63
+ {% if broker == "kafka" or "kafka" in extras %}
64
+ - KAFKA_HOST=kafka
65
+ {% endif %}
66
+ {% if broker == "celery" or "celery" in extras %}
67
+ - CELERY_BROKER_URL=redis://redis:6379/0
68
+ - CELERY_RESULT_BACKEND=redis://redis:6379/0
69
+ {% endif %}
62
70
  {% endif %}
63
71
  restart: unless-stopped
64
72
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fastapi-spawn"
7
- version = "0.5.1"
7
+ version = "0.5.3"
8
8
  description = "A powerful CLI tool to scaffold production-ready FastAPI projects with flexible database, auth, broker, and deployment options."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
File without changes
File without changes
File without changes