fastapi-spawn 0.4.30__tar.gz → 0.4.32__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 (77) hide show
  1. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/PKG-INFO +4 -14
  2. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/README.md +3 -13
  3. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/cli.py +6 -4
  4. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/config.py +2 -1
  5. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/generator.py +6 -3
  6. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/logging.py.j2 +33 -1
  7. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/main.py.j2 +0 -2
  8. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/pyproject.toml +1 -1
  9. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/.gitignore +0 -0
  10. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/LICENSE +0 -0
  11. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/__init__.py +0 -0
  12. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/constants.py +0 -0
  13. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/interactive.py +0 -0
  14. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/alembic/alembic.ini.j2 +0 -0
  15. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/alembic/env.py.j2 +0 -0
  16. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/__init__.py.j2 +0 -0
  17. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/admin/setup.py.j2 +0 -0
  18. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/deps.py.j2 +0 -0
  19. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/graphql.py.j2 +0 -0
  20. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/auth/router.py.j2 +0 -0
  21. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/auth/sso.py.j2 +0 -0
  22. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/health/router.py.j2 +0 -0
  23. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/pagination/router.py.j2 +0 -0
  24. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/payments/router.py.j2 +0 -0
  25. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/permissions/router.py.j2 +0 -0
  26. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/router.py.j2 +0 -0
  27. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/streaming/router.py.j2 +0 -0
  28. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/uploads/router.py.j2 +0 -0
  29. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/api/v1/ws/router.py.j2 +0 -0
  30. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/ai.py.j2 +0 -0
  31. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/cache.py.j2 +0 -0
  32. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/config.py.j2 +0 -0
  33. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/email.py.j2 +0 -0
  34. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/exceptions.py.j2 +0 -0
  35. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/logger.py.j2 +0 -0
  36. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/monitoring.py.j2 +0 -0
  37. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/notifications.py.j2 +0 -0
  38. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/ocr.py.j2 +0 -0
  39. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/permissions.py.j2 +0 -0
  40. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/search.py.j2 +0 -0
  41. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/security.py.j2 +0 -0
  42. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/storage.py.j2 +0 -0
  43. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/vector_db.py.j2 +0 -0
  44. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/core/ws_manager.py.j2 +0 -0
  45. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/db/session.py.j2 +0 -0
  46. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/frontend/index.html.j2 +0 -0
  47. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/middleware/__init__.py.j2 +0 -0
  48. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/middleware/rate_limit.py.j2 +0 -0
  49. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/middleware/request_logger.py.j2 +0 -0
  50. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/app/middleware/response_format.py.j2 +0 -0
  51. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/base/Makefile.j2 +0 -0
  52. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/base/README.md.j2 +0 -0
  53. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/base/env.j2 +0 -0
  54. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/base/env_example.j2 +0 -0
  55. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/base/gitignore.j2 +0 -0
  56. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/base/pre_commit.j2 +0 -0
  57. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/base/pyproject.toml.j2 +0 -0
  58. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/ci/github/publish.yml.j2 +0 -0
  59. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/ci/github/tests.yml.j2 +0 -0
  60. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/ci/gitlab/gitlab-ci.yml.j2 +0 -0
  61. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/db/seed.py.j2 +0 -0
  62. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/docker/Dockerfile.j2 +0 -0
  63. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/docker/docker-compose.yml.j2 +0 -0
  64. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/docker/dockerignore.j2 +0 -0
  65. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/infra/docker/docker-compose.prod.yml.j2 +0 -0
  66. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/infra/helm/Chart.yaml.j2 +0 -0
  67. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/infra/helm/values.yaml.j2 +0 -0
  68. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/infra/terraform/main.tf.j2 +0 -0
  69. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/infra/terraform/variables.tf.j2 +0 -0
  70. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/root/main.py.j2 +0 -0
  71. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/tasks/arq_worker.py.j2 +0 -0
  72. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/tasks/celery_app.py.j2 +0 -0
  73. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/tasks/sample_tasks.py.j2 +0 -0
  74. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/tests/conftest.py.j2 +0 -0
  75. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/templates/tests/test_health.py.j2 +0 -0
  76. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/utils.py +0 -0
  77. {fastapi_spawn-0.4.30 → fastapi_spawn-0.4.32}/fastapi_spawn/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-spawn
3
- Version: 0.4.30
3
+ Version: 0.4.32
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
@@ -117,11 +117,9 @@ To avoid confusion with nested projects (e.g., having a `pyproject.toml` in both
117
117
 
118
118
  #### Option B: Generate directly in the CURRENT folder
119
119
  If you already created a folder and opened it in VS Code:
120
- 1. Make sure the folder is empty.
121
- 2. Run the command with `--output .`:
122
- ```bash
123
- fastapi-spawn start custom my_project_name --output .
124
- ```
120
+ 1. Run `fastapi-spawn start`.
121
+ 2. When it asks *"Do you want to generate files directly in the current directory?"*, select **Yes**.
122
+ 3. It will generate all files directly in your current folder without creating a subfolder! (New in 0.4.29!)
125
123
 
126
124
  ---
127
125
 
@@ -608,14 +606,6 @@ $ fastapi-spawn add websockets
608
606
  | `beanie` | mongodb |
609
607
  | `none` | any |
610
608
 
611
- ## Recent Updates (v0.4.22)
612
-
613
- - **Ollama Integration**: Updated default model to `tinyllama` for faster testing.
614
- - **Supabase Fixes**: Fixed missing environment variables in configuration templates.
615
- - **Frontend & Admin Mounted**: Automatically mounts the static frontend at `/` and the `sqladmin` dashboard at `/admin` (if enabled).
616
- - **Service Health Checks**: Added connection checks for Elasticsearch, OpenSearch, Kafka, Vespa, Ollama, DuckDB, Chroma, and Supabase in the generated `/health/services` endpoint.
617
-
618
- ---
619
609
 
620
610
  ## Contributing
621
611
 
@@ -76,11 +76,9 @@ To avoid confusion with nested projects (e.g., having a `pyproject.toml` in both
76
76
 
77
77
  #### Option B: Generate directly in the CURRENT folder
78
78
  If you already created a folder and opened it in VS Code:
79
- 1. Make sure the folder is empty.
80
- 2. Run the command with `--output .`:
81
- ```bash
82
- fastapi-spawn start custom my_project_name --output .
83
- ```
79
+ 1. Run `fastapi-spawn start`.
80
+ 2. When it asks *"Do you want to generate files directly in the current directory?"*, select **Yes**.
81
+ 3. It will generate all files directly in your current folder without creating a subfolder! (New in 0.4.29!)
84
82
 
85
83
  ---
86
84
 
@@ -567,14 +565,6 @@ $ fastapi-spawn add websockets
567
565
  | `beanie` | mongodb |
568
566
  | `none` | any |
569
567
 
570
- ## Recent Updates (v0.4.22)
571
-
572
- - **Ollama Integration**: Updated default model to `tinyllama` for faster testing.
573
- - **Supabase Fixes**: Fixed missing environment variables in configuration templates.
574
- - **Frontend & Admin Mounted**: Automatically mounts the static frontend at `/` and the `sqladmin` dashboard at `/admin` (if enabled).
575
- - **Service Health Checks**: Added connection checks for Elasticsearch, OpenSearch, Kafka, Vespa, Ollama, DuckDB, Chroma, and Supabase in the generated `/health/services` endpoint.
576
-
577
- ---
578
568
 
579
569
  ## Contributing
580
570
 
@@ -277,6 +277,7 @@ def start(
277
277
 
278
278
  if use_current:
279
279
  output_dir = Path(".")
280
+ config.create_project_folder = False
280
281
  import os
281
282
  if os.listdir("."):
282
283
  confirm = questionary.confirm(
@@ -396,6 +397,7 @@ def start(
396
397
 
397
398
  if use_current:
398
399
  output_dir = Path(".")
400
+ config.create_project_folder = False
399
401
  # Check if directory is not empty
400
402
  import os
401
403
  if os.listdir("."):
@@ -623,10 +625,10 @@ def _print_summary(config: ProjectConfig) -> None:
623
625
 
624
626
 
625
627
  def _print_next_steps(config: ProjectConfig) -> None:
626
- steps = [
627
- f" [bold cyan]cd {config.project_name}[/bold cyan]",
628
- " [bold cyan]uv sync[/bold cyan]",
629
- ]
628
+ steps = []
629
+ if config.create_project_folder:
630
+ steps.append(f" [bold cyan]cd {config.project_name}[/bold cyan]")
631
+ steps.append(" [bold cyan]uv sync[/bold cyan]")
630
632
  if config.has_alembic:
631
633
  steps.append(" [bold cyan]uv run migrate[/bold cyan]")
632
634
  if config.has_docker:
@@ -47,6 +47,7 @@ class ProjectConfig:
47
47
  include_makefile: bool = True
48
48
  dry_run: bool = False
49
49
  force: bool = False
50
+ create_project_folder: bool = True
50
51
  extras: list[str] = field(default_factory=list)
51
52
  # Derived (post-init)
52
53
  package_name: str = field(default="", init=False)
@@ -80,7 +81,7 @@ class ProjectConfig:
80
81
 
81
82
  @property
82
83
  def has_docker(self) -> bool:
83
- return self.include_docker and self.stack != Stack.minimal
84
+ return self.include_docker
84
85
 
85
86
  @property
86
87
  def has_infra(self) -> bool:
@@ -64,9 +64,12 @@ class ProjectGenerator:
64
64
  def generate(self) -> Path:
65
65
  if self.config.dry_run:
66
66
  self._dry_run_display()
67
- return self.output_dir / self.config.project_name
67
+ return self.output_dir if not self.config.create_project_folder else self.output_dir / self.config.project_name
68
68
 
69
- project_path = self.output_dir / self.config.project_name
69
+ if self.config.create_project_folder:
70
+ project_path = self.output_dir / self.config.project_name
71
+ else:
72
+ project_path = self.output_dir
70
73
 
71
74
  if project_path.exists() and self.config.force:
72
75
  shutil.rmtree(project_path)
@@ -115,7 +118,7 @@ class ProjectGenerator:
115
118
  if self.config.include_makefile:
116
119
  self._render_to(staging / "Makefile", "base/Makefile.j2")
117
120
 
118
- shutil.copytree(str(staging), str(project_path))
121
+ shutil.copytree(str(staging), str(project_path), dirs_exist_ok=True)
119
122
 
120
123
  return project_path
121
124
 
@@ -18,6 +18,17 @@ def configure_logging() -> None:
18
18
  backtrace=True,
19
19
  diagnose=True,
20
20
  )
21
+ {% if log_dest == "local" %}
22
+ import os
23
+ os.makedirs("logs", exist_ok=True)
24
+ logger.add(
25
+ "logs/app.log",
26
+ rotation="10 MB",
27
+ retention="1 week",
28
+ level="DEBUG",
29
+ format="{time:YYYY-MM-DD HH:mm:ss} | {level: <8} | {name}:{function}:{line} - {message}",
30
+ )
31
+ {% endif %}
21
32
 
22
33
  # Intercept standard library logging
23
34
  class InterceptHandler(logging.Handler):
@@ -58,13 +69,34 @@ def configure_logging() -> None:
58
69
  cache_logger_on_first_use=True,
59
70
  )
60
71
 
72
+ handlers = [logging.StreamHandler(sys.stdout)]
73
+ {% if log_dest == "local" %}
74
+ import os
75
+ os.makedirs("logs", exist_ok=True)
76
+ handlers.append(logging.FileHandler("logs/app.log"))
77
+ {% endif %}
78
+
79
+ logging.basicConfig(
80
+ handlers=handlers,
81
+ level=logging.INFO,
82
+ force=True,
83
+ )
84
+
61
85
  {% else %}
62
86
  def configure_logging() -> None:
63
87
  """Configure standard library logging."""
88
+ handlers = [logging.StreamHandler(sys.stdout)]
89
+ {% if log_dest == "local" %}
90
+ import os
91
+ os.makedirs("logs", exist_ok=True)
92
+ handlers.append(logging.FileHandler("logs/app.log"))
93
+ {% endif %}
94
+
64
95
  logging.basicConfig(
65
96
  level=logging.INFO,
66
97
  format="%(asctime)s | %(levelname)-8s | %(name)s:%(funcName)s:%(lineno)d - %(message)s",
67
98
  datefmt="%Y-%m-%d %H:%M:%S",
68
- stream=sys.stdout,
99
+ handlers=handlers,
100
+ force=True,
69
101
  )
70
102
  {% endif %}
@@ -5,7 +5,6 @@ from typing import AsyncGenerator
5
5
 
6
6
  from fastapi import FastAPI
7
7
  from fastapi.middleware.cors import CORSMiddleware
8
- from fastapi.responses import ORJSONResponse
9
8
 
10
9
  from app.api.v1.router import router as api_v1_router
11
10
  {% if has_graphql %}
@@ -41,7 +40,6 @@ def create_application() -> FastAPI:
41
40
  docs_url="/docs",
42
41
  redoc_url="/redoc",
43
42
  openapi_url="/openapi.json",
44
- default_response_class=ORJSONResponse,
45
43
  lifespan=lifespan,
46
44
  )
47
45
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fastapi-spawn"
7
- version = "0.4.30"
7
+ version = "0.4.32"
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