fastapi-spawn 0.4.2__tar.gz → 0.4.4__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.
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/PKG-INFO +60 -12
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/README.md +59 -11
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/__init__.py +1 -1
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/generator.py +13 -6
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/api/graphql.py.j2 +1 -1
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/api/v1/router.py.j2 +5 -4
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/config.py.j2 +4 -2
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/main.py.j2 +0 -2
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/base/pyproject.toml.j2 +1 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/pyproject.toml +1 -1
- fastapi_spawn-0.4.2/CHANGELOG.md +0 -36
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/.gitignore +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/LICENSE +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/cli.py +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/config.py +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/constants.py +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/interactive.py +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/alembic/alembic.ini.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/alembic/env.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/__init__.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/api/deps.py.j2 +0 -0
- /fastapi_spawn-0.4.2/fastapi_spawn/templates/app/api/v1/auth.py.j2 → /fastapi_spawn-0.4.4/fastapi_spawn/templates/app/api/v1/auth/router.py.j2 +0 -0
- /fastapi_spawn-0.4.2/fastapi_spawn/templates/app/api/v1/health.py.j2 → /fastapi_spawn-0.4.4/fastapi_spawn/templates/app/api/v1/health/router.py.j2 +0 -0
- /fastapi_spawn-0.4.2/fastapi_spawn/templates/app/api/v1/ws.py.j2 → /fastapi_spawn-0.4.4/fastapi_spawn/templates/app/api/v1/ws/router.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/ai.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/email.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/exceptions.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/logger.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/logging.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/monitoring.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/notifications.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/security.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/storage.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/vector_db.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/ws_manager.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/db/session.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/frontend/index.html.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/middleware/__init__.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/middleware/rate_limit.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/middleware/request_logger.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/base/Makefile.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/base/README.md.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/base/env.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/base/env_example.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/base/gitignore.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/base/pre_commit.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/ci/github/publish.yml.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/ci/github/tests.yml.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/ci/gitlab/gitlab-ci.yml.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/docker/Dockerfile.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/docker/docker-compose.yml.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/docker/dockerignore.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/docker/docker-compose.prod.yml.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/helm/Chart.yaml.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/helm/values.yaml.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/terraform/main.tf.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/terraform/variables.tf.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/root/main.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/tasks/arq_worker.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/tasks/celery_app.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/tasks/sample_tasks.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/tests/conftest.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/tests/test_health.py.j2 +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/utils.py +0 -0
- {fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/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.
|
|
3
|
+
Version: 0.4.4
|
|
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
|
|
@@ -110,9 +110,13 @@ my-api/
|
|
|
110
110
|
│ ├── api/
|
|
111
111
|
│ │ ├── graphql.py # Strawberry GraphQL schema + IDE (if graphql)
|
|
112
112
|
│ │ └── v1/
|
|
113
|
-
│ │ ├──
|
|
114
|
-
│ │ ├──
|
|
115
|
-
│ │ └──
|
|
113
|
+
│ │ ├── router.py # Central API router aggregating sub-routers
|
|
114
|
+
│ │ ├── health/
|
|
115
|
+
│ │ │ └── router.py # GET /health /readiness /liveness
|
|
116
|
+
│ │ ├── auth/
|
|
117
|
+
│ │ │ └── router.py # POST /auth/login /auth/refresh (if auth)
|
|
118
|
+
│ │ └── ws/
|
|
119
|
+
│ │ └── router.py # WebSocket /ws/connect (if websockets)
|
|
116
120
|
│ ├── core/
|
|
117
121
|
│ │ ├── config.py # Pydantic Settings v2 — individual env fields + @property URLs
|
|
118
122
|
│ │ ├── logger.py # Context-var logger — request ID, client IP, file rotation
|
|
@@ -436,20 +440,64 @@ GraphiQL IDE is enabled in `dev` mode. Subscriptions use `graphql-transport-ws`.
|
|
|
436
440
|
|
|
437
441
|
---
|
|
438
442
|
|
|
439
|
-
## Add Features to Existing Projects
|
|
443
|
+
## 🧩 Add Features to Existing Projects (Incremental Scaffolding)
|
|
444
|
+
|
|
445
|
+
Did you generate a minimal project and now realize you need WebSockets, AWS S3, or OpenAI? **No problem.**
|
|
446
|
+
|
|
447
|
+
`fastapi-spawn add` allows you to incrementally scale your project. Instead of re-generating your entire project or copying boilerplate manually, you can inject production-ready modules into your existing codebase.
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
fastapi-spawn add [FEATURE]
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### How it works:
|
|
454
|
+
1. **Generates the Module**: It creates the necessary file (e.g., `app/core/ai.py` or `app/api/v1/ws/router.py`) tailored to your project structure.
|
|
455
|
+
2. **Environment Variables**: It prompts you with the exact environment variables you need to append to your `.env` and `config.py`.
|
|
456
|
+
3. **Integration Guide**: It outputs a step-by-step UI snippet telling you *exactly* where to import and mount the new feature in your `main.py` or `router.py`.
|
|
457
|
+
|
|
458
|
+
### All Possibilities you can `add`:
|
|
459
|
+
|
|
460
|
+
You can run any of the following commands inside an existing project:
|
|
440
461
|
|
|
441
462
|
```bash
|
|
442
|
-
|
|
463
|
+
# Infrastructure & Deployment
|
|
464
|
+
fastapi-spawn add docker # Dockerfile and docker-compose.yml
|
|
465
|
+
fastapi-spawn add helm # Helm chart in infra/helm/
|
|
466
|
+
fastapi-spawn add terraform # Terraform in infra/terraform/
|
|
467
|
+
fastapi-spawn add github-actions # CI/CD pipeline (.github/workflows/tests.yml)
|
|
468
|
+
|
|
469
|
+
# AI & Vector DBs
|
|
443
470
|
fastapi-spawn add openai # OpenAI async client
|
|
444
|
-
fastapi-spawn add
|
|
445
|
-
fastapi-spawn add
|
|
471
|
+
fastapi-spawn add anthropic # Anthropic Claude async client
|
|
472
|
+
fastapi-spawn add gemini # Google Generative AI client
|
|
473
|
+
fastapi-spawn add qdrant # Qdrant vector DB
|
|
474
|
+
fastapi-spawn add chroma # ChromaDB local vector DB
|
|
475
|
+
fastapi-spawn add pinecone # Pinecone cloud vector DB
|
|
476
|
+
|
|
477
|
+
# Messaging & Async Workers
|
|
446
478
|
fastapi-spawn add celery # Celery worker + tasks/
|
|
479
|
+
fastapi-spawn add arq # Arq async job queues using Redis
|
|
447
480
|
fastapi-spawn add websockets # WebSocket connection manager
|
|
481
|
+
|
|
482
|
+
# Storage, APIs & Monitoring
|
|
483
|
+
fastapi-spawn add s3 # AWS S3 / MinIO storage
|
|
448
484
|
fastapi-spawn add graphql # Strawberry GraphQL schema
|
|
449
|
-
fastapi-spawn add
|
|
450
|
-
fastapi-spawn add
|
|
451
|
-
fastapi-spawn add
|
|
452
|
-
|
|
485
|
+
fastapi-spawn add alembic # Alembic async migrations
|
|
486
|
+
fastapi-spawn add sentry # Sentry APM integration
|
|
487
|
+
fastapi-spawn add prometheus # Prometheus metrics
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
*Example:*
|
|
491
|
+
```bash
|
|
492
|
+
$ fastapi-spawn add websockets
|
|
493
|
+
|
|
494
|
+
✓ Created app/core/ws_manager.py
|
|
495
|
+
✓ Created app/api/v1/ws/router.py
|
|
496
|
+
|
|
497
|
+
👉 Next Steps:
|
|
498
|
+
1. Mount the router in app/api/v1/router.py:
|
|
499
|
+
from app.api.v1.ws.router import router as ws_router
|
|
500
|
+
router.include_router(ws_router)
|
|
453
501
|
```
|
|
454
502
|
|
|
455
503
|
---
|
|
@@ -69,9 +69,13 @@ my-api/
|
|
|
69
69
|
│ ├── api/
|
|
70
70
|
│ │ ├── graphql.py # Strawberry GraphQL schema + IDE (if graphql)
|
|
71
71
|
│ │ └── v1/
|
|
72
|
-
│ │ ├──
|
|
73
|
-
│ │ ├──
|
|
74
|
-
│ │ └──
|
|
72
|
+
│ │ ├── router.py # Central API router aggregating sub-routers
|
|
73
|
+
│ │ ├── health/
|
|
74
|
+
│ │ │ └── router.py # GET /health /readiness /liveness
|
|
75
|
+
│ │ ├── auth/
|
|
76
|
+
│ │ │ └── router.py # POST /auth/login /auth/refresh (if auth)
|
|
77
|
+
│ │ └── ws/
|
|
78
|
+
│ │ └── router.py # WebSocket /ws/connect (if websockets)
|
|
75
79
|
│ ├── core/
|
|
76
80
|
│ │ ├── config.py # Pydantic Settings v2 — individual env fields + @property URLs
|
|
77
81
|
│ │ ├── logger.py # Context-var logger — request ID, client IP, file rotation
|
|
@@ -395,20 +399,64 @@ GraphiQL IDE is enabled in `dev` mode. Subscriptions use `graphql-transport-ws`.
|
|
|
395
399
|
|
|
396
400
|
---
|
|
397
401
|
|
|
398
|
-
## Add Features to Existing Projects
|
|
402
|
+
## 🧩 Add Features to Existing Projects (Incremental Scaffolding)
|
|
403
|
+
|
|
404
|
+
Did you generate a minimal project and now realize you need WebSockets, AWS S3, or OpenAI? **No problem.**
|
|
405
|
+
|
|
406
|
+
`fastapi-spawn add` allows you to incrementally scale your project. Instead of re-generating your entire project or copying boilerplate manually, you can inject production-ready modules into your existing codebase.
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
fastapi-spawn add [FEATURE]
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### How it works:
|
|
413
|
+
1. **Generates the Module**: It creates the necessary file (e.g., `app/core/ai.py` or `app/api/v1/ws/router.py`) tailored to your project structure.
|
|
414
|
+
2. **Environment Variables**: It prompts you with the exact environment variables you need to append to your `.env` and `config.py`.
|
|
415
|
+
3. **Integration Guide**: It outputs a step-by-step UI snippet telling you *exactly* where to import and mount the new feature in your `main.py` or `router.py`.
|
|
416
|
+
|
|
417
|
+
### All Possibilities you can `add`:
|
|
418
|
+
|
|
419
|
+
You can run any of the following commands inside an existing project:
|
|
399
420
|
|
|
400
421
|
```bash
|
|
401
|
-
|
|
422
|
+
# Infrastructure & Deployment
|
|
423
|
+
fastapi-spawn add docker # Dockerfile and docker-compose.yml
|
|
424
|
+
fastapi-spawn add helm # Helm chart in infra/helm/
|
|
425
|
+
fastapi-spawn add terraform # Terraform in infra/terraform/
|
|
426
|
+
fastapi-spawn add github-actions # CI/CD pipeline (.github/workflows/tests.yml)
|
|
427
|
+
|
|
428
|
+
# AI & Vector DBs
|
|
402
429
|
fastapi-spawn add openai # OpenAI async client
|
|
403
|
-
fastapi-spawn add
|
|
404
|
-
fastapi-spawn add
|
|
430
|
+
fastapi-spawn add anthropic # Anthropic Claude async client
|
|
431
|
+
fastapi-spawn add gemini # Google Generative AI client
|
|
432
|
+
fastapi-spawn add qdrant # Qdrant vector DB
|
|
433
|
+
fastapi-spawn add chroma # ChromaDB local vector DB
|
|
434
|
+
fastapi-spawn add pinecone # Pinecone cloud vector DB
|
|
435
|
+
|
|
436
|
+
# Messaging & Async Workers
|
|
405
437
|
fastapi-spawn add celery # Celery worker + tasks/
|
|
438
|
+
fastapi-spawn add arq # Arq async job queues using Redis
|
|
406
439
|
fastapi-spawn add websockets # WebSocket connection manager
|
|
440
|
+
|
|
441
|
+
# Storage, APIs & Monitoring
|
|
442
|
+
fastapi-spawn add s3 # AWS S3 / MinIO storage
|
|
407
443
|
fastapi-spawn add graphql # Strawberry GraphQL schema
|
|
408
|
-
fastapi-spawn add
|
|
409
|
-
fastapi-spawn add
|
|
410
|
-
fastapi-spawn add
|
|
411
|
-
|
|
444
|
+
fastapi-spawn add alembic # Alembic async migrations
|
|
445
|
+
fastapi-spawn add sentry # Sentry APM integration
|
|
446
|
+
fastapi-spawn add prometheus # Prometheus metrics
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
*Example:*
|
|
450
|
+
```bash
|
|
451
|
+
$ fastapi-spawn add websockets
|
|
452
|
+
|
|
453
|
+
✓ Created app/core/ws_manager.py
|
|
454
|
+
✓ Created app/api/v1/ws/router.py
|
|
455
|
+
|
|
456
|
+
👉 Next Steps:
|
|
457
|
+
1. Mount the router in app/api/v1/router.py:
|
|
458
|
+
from app.api.v1.ws.router import router as ws_router
|
|
459
|
+
router.include_router(ws_router)
|
|
412
460
|
```
|
|
413
461
|
|
|
414
462
|
---
|
|
@@ -174,11 +174,14 @@ class ProjectGenerator:
|
|
|
174
174
|
v1.mkdir()
|
|
175
175
|
self._render_to(v1 / "__init__.py", "app/__init__.py.j2")
|
|
176
176
|
self._render_to(v1 / "router.py", "app/api/v1/router.py.j2")
|
|
177
|
-
|
|
177
|
+
(v1 / "health").mkdir()
|
|
178
|
+
self._render_to(v1 / "health" / "router.py", "app/api/v1/health/router.py.j2")
|
|
178
179
|
if self.config.has_auth:
|
|
179
|
-
|
|
180
|
+
(v1 / "auth").mkdir()
|
|
181
|
+
self._render_to(v1 / "auth" / "router.py", "app/api/v1/auth/router.py.j2")
|
|
180
182
|
if self.config.has_websockets:
|
|
181
|
-
|
|
183
|
+
(v1 / "ws").mkdir()
|
|
184
|
+
self._render_to(v1 / "ws" / "router.py", "app/api/v1/ws/router.py.j2")
|
|
182
185
|
self._render_to(core / "ws_manager.py", "app/core/ws_manager.py.j2")
|
|
183
186
|
if self.config.has_graphql:
|
|
184
187
|
self._render_to(api / "graphql.py", "app/api/graphql.py.j2")
|
|
@@ -288,9 +291,13 @@ class ProjectGenerator:
|
|
|
288
291
|
if cfg.has_s3: core_items += " storage.py"
|
|
289
292
|
if cfg.has_ai: core_items += " ai.py"
|
|
290
293
|
app.add(f"[blue]core/[/blue] {core_items}")
|
|
291
|
-
api = app.add("[blue]api/[/blue] deps.py")
|
|
292
|
-
v1 =
|
|
293
|
-
|
|
294
|
+
api = app.add("[blue]api/[/blue] deps.py [dim]graphql.py[/dim]?")
|
|
295
|
+
v1 = api.add("[blue]v1/[/blue] router.py")
|
|
296
|
+
v1.add("[blue]health/[/blue] router.py")
|
|
297
|
+
if cfg.has_auth:
|
|
298
|
+
v1.add("[blue]auth/[/blue] router.py")
|
|
299
|
+
if cfg.has_websockets:
|
|
300
|
+
v1.add("[blue]ws/[/blue] router.py")
|
|
294
301
|
if cfg.db.value != "none":
|
|
295
302
|
app.add("[blue]db/[/blue] session.py")
|
|
296
303
|
for sub in ("models/", "schemas/", "services/", "repositories/"):
|
|
@@ -93,6 +93,6 @@ schema = strawberry.Schema(
|
|
|
93
93
|
# Mount with: app.include_router(graphql_router, prefix="/graphql")
|
|
94
94
|
graphql_router = GraphQLRouter(
|
|
95
95
|
schema,
|
|
96
|
-
graphiql
|
|
96
|
+
graphql_ide="graphiql",
|
|
97
97
|
subscription_protocols=["graphql-transport-ws", "graphql-ws"],
|
|
98
98
|
)
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
from fastapi import APIRouter
|
|
2
2
|
|
|
3
|
-
from app.api.v1.health import router as health_router
|
|
3
|
+
from app.api.v1.health.router import router as health_router
|
|
4
4
|
{% if has_auth %}
|
|
5
|
-
from app.api.v1.auth import router as auth_router
|
|
5
|
+
from app.api.v1.auth.router import router as auth_router
|
|
6
6
|
{% endif %}
|
|
7
7
|
{% if has_websockets %}
|
|
8
|
-
from app.api.v1.ws import router as ws_router
|
|
8
|
+
from app.api.v1.ws.router import router as ws_router
|
|
9
9
|
{% endif %}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
router = APIRouter()
|
|
12
13
|
|
|
13
14
|
router.include_router(health_router)
|
|
14
15
|
{% if has_auth %}
|
|
@@ -24,13 +24,15 @@ class Settings(BaseSettings):
|
|
|
24
24
|
ENVIRONMENT: str = "dev"
|
|
25
25
|
API_V1_PREFIX: str = "/api/v1"
|
|
26
26
|
SECRET_KEY: str = "change-me"
|
|
27
|
-
CORS_ORIGINS: list[str] = ["http://localhost:3000", "http://localhost:8000"]
|
|
27
|
+
CORS_ORIGINS: str | list[str] = ["http://localhost:3000", "http://localhost:8000"]
|
|
28
28
|
|
|
29
29
|
@field_validator("CORS_ORIGINS", mode="before")
|
|
30
30
|
def parse_cors(cls, v: Any) -> list[str]:
|
|
31
31
|
if isinstance(v, str) and not v.startswith("["):
|
|
32
32
|
return [i.strip() for i in v.split(",") if i.strip()]
|
|
33
|
-
|
|
33
|
+
if isinstance(v, list):
|
|
34
|
+
return v
|
|
35
|
+
return []
|
|
34
36
|
|
|
35
37
|
@property
|
|
36
38
|
def DEBUG(self) -> bool:
|
|
@@ -13,13 +13,11 @@ from app.api.graphql import graphql_router
|
|
|
13
13
|
{% endif %}
|
|
14
14
|
from app.core.config import settings
|
|
15
15
|
from app.core.exceptions import register_exception_handlers
|
|
16
|
-
from app.core.logging import configure_logging
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
@asynccontextmanager
|
|
20
19
|
async def lifespan(application: FastAPI) -> AsyncGenerator[None, None]:
|
|
21
20
|
"""Manage application startup and shutdown lifecycle."""
|
|
22
|
-
configure_logging()
|
|
23
21
|
{% if has_relational_db and orm == "sqlalchemy" %}
|
|
24
22
|
from app.db.session import engine, Base
|
|
25
23
|
async with engine.begin() as conn:
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fastapi-spawn"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.4"
|
|
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" }
|
fastapi_spawn-0.4.2/CHANGELOG.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to `fastapi-spawn` will be documented here.
|
|
4
|
-
|
|
5
|
-
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
-
Versioning follows [Semantic Versioning](https://semver.org/).
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## [0.1.0] — 2026-05-10
|
|
11
|
-
|
|
12
|
-
### Added
|
|
13
|
-
- Interactive TUI with questionary + Rich styling
|
|
14
|
-
- Database support: PostgreSQL, MySQL, MongoDB, SQLite
|
|
15
|
-
- ORM support: SQLAlchemy 2.x (async), Tortoise ORM, Beanie
|
|
16
|
-
- Migration support: Alembic (async-compatible), Aerich
|
|
17
|
-
- Auth: JWT, OAuth2, API Key
|
|
18
|
-
- Message brokers: Redis (Celery), RabbitMQ (Celery), Kafka (aiokafka)
|
|
19
|
-
- Cache layer: Redis, Memcached
|
|
20
|
-
- File storage: AWS S3 (boto3) with presigned URLs
|
|
21
|
-
- AI integration: OpenAI (chat + embeddings, custom base URL), Anthropic Claude
|
|
22
|
-
- Root-level `main.py` entry point (`uv run main.py`)
|
|
23
|
-
- Root-level `tasks/` directory for Celery workers
|
|
24
|
-
- Individual env fields per service with `@property` URL assembly
|
|
25
|
-
- `OPENAI_BASE_URL` support for Azure, LM Studio, local endpoints
|
|
26
|
-
- `--dry-run` flag with rich tree preview
|
|
27
|
-
- `--force` flag to overwrite existing projects
|
|
28
|
-
- Stack options: minimal, standard, full (Helm + Terraform)
|
|
29
|
-
- CI/CD: GitHub Actions, GitLab CI
|
|
30
|
-
- Logging: loguru, structlog, standard library
|
|
31
|
-
- Docker: multi-service compose with health checks
|
|
32
|
-
- infra/: docker/, helm/, terraform/ structure
|
|
33
|
-
- `uv`-compatible `pyproject.toml` with `[tool.uv]`
|
|
34
|
-
- `list-templates` and `validate` subcommands
|
|
35
|
-
- `ENVIRONMENT=dev` style env naming
|
|
36
|
-
- Professional README, CHANGELOG, CONTRIBUTING
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/exceptions.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/monitoring.py.j2
RENAMED
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/notifications.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/vector_db.py.j2
RENAMED
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/core/ws_manager.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/frontend/index.html.j2
RENAMED
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/middleware/__init__.py.j2
RENAMED
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/app/middleware/rate_limit.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/ci/github/publish.yml.j2
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/ci/gitlab/gitlab-ci.yml.j2
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/docker/docker-compose.yml.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/helm/Chart.yaml.j2
RENAMED
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/helm/values.yaml.j2
RENAMED
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/terraform/main.tf.j2
RENAMED
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/infra/terraform/variables.tf.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_spawn-0.4.2 → fastapi_spawn-0.4.4}/fastapi_spawn/templates/tasks/sample_tasks.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|