fastapi-struct 0.2.1__tar.gz → 0.4.0__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 (150) hide show
  1. fastapi_struct-0.4.0/PKG-INFO +307 -0
  2. fastapi_struct-0.4.0/README.md +293 -0
  3. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/pyproject.toml +9 -7
  4. fastapi_struct-0.4.0/src/create_fastapi_app/__init__.py +1 -0
  5. fastapi_struct-0.4.0/src/create_fastapi_app/cli.py +96 -0
  6. fastapi_struct-0.4.0/src/create_fastapi_app/generator.py +86 -0
  7. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/.env +6 -0
  8. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/.env.example +10 -0
  9. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/.gitignore +41 -0
  10. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/README.md +264 -0
  11. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/ai/llm.py +28 -0
  12. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/ai/prompt.py +2 -0
  13. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/ai/rag.py +19 -0
  14. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/api/v1/api.py +14 -0
  15. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/api/v1/routes/chat.py +21 -0
  16. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all}/app/api/v1/routes/health.py +16 -15
  17. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/api/v1/routes/items.py +23 -0
  18. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all}/app/api/v1/routes/predict.py +17 -16
  19. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/api/v1/routes/rag.py +11 -0
  20. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/api/v1/routes/users.py +26 -0
  21. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/core/config.py +30 -0
  22. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/core/database.py +8 -0
  23. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/core/security.py +11 -0
  24. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/main.py +48 -0
  25. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all}/app/ml/model.py +33 -34
  26. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/ml/pipeline.py +14 -0
  27. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/models/item.py +11 -0
  28. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/models/user.py +10 -0
  29. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/repositories/item_repository.py +24 -0
  30. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/repositories/user_repository.py +27 -0
  31. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/schemas/chat.py +19 -0
  32. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/schemas/item.py +18 -0
  33. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/schemas/predict.py +19 -0
  34. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/schemas/rag.py +20 -0
  35. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/schemas/user.py +16 -0
  36. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/services/ai_service.py +42 -0
  37. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all}/app/services/inference.py +25 -30
  38. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/services/item_service.py +26 -0
  39. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/services/user_service.py +27 -0
  40. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/pyproject.toml +7 -0
  41. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/requirements.txt +7 -0
  42. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/tests/conftest.py +9 -0
  43. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/tests/test_ai.py +37 -0
  44. fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/tests/test_web.py +47 -0
  45. fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/services/__init__.py +0 -0
  46. fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/utils/__init__.py +0 -0
  47. fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/tests/__init__.py +0 -0
  48. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/.env +4 -0
  49. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/.env.example +5 -0
  50. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/.gitignore +32 -0
  51. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/README.md +221 -0
  52. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/__init__.py +0 -0
  53. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/ai/__init__.py +0 -0
  54. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/ai/llm.py +28 -0
  55. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/ai/prompt.py +2 -0
  56. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/ai/rag.py +19 -0
  57. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/api/__init__.py +0 -0
  58. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/api/v1/__init__.py +0 -0
  59. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/api/v1/api.py +8 -0
  60. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/api/v1/routes/__init__.py +0 -0
  61. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/api/v1/routes/chat.py +21 -0
  62. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/api/v1/routes/health.py +16 -0
  63. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/api/v1/routes/predict.py +17 -0
  64. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/api/v1/routes/rag.py +11 -0
  65. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/core/__init__.py +0 -0
  66. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/ml/app/core/config.py +10 -4
  67. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/main.py +42 -0
  68. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/ml/__init__.py +0 -0
  69. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/ml/model.py +33 -0
  70. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/ml/pipeline.py +14 -0
  71. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/schemas/__init__.py +0 -0
  72. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/schemas/chat.py +20 -0
  73. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/ml/app/schemas/predict.py +4 -3
  74. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/schemas/rag.py +20 -0
  75. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/services/__init__.py +0 -0
  76. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/services/ai_service.py +42 -0
  77. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/app/services/inference.py +25 -0
  78. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/ml/pyproject.toml +2 -2
  79. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/tests/__init__.py +0 -0
  80. fastapi_struct-0.4.0/src/create_fastapi_app/templates/ml/tests/test_chat.py +18 -0
  81. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/ml/tests/test_predict.py +1 -1
  82. fastapi_struct-0.4.0/src/fastapi_struct.egg-info/PKG-INFO +307 -0
  83. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/fastapi_struct.egg-info/SOURCES.txt +60 -0
  84. fastapi_struct-0.4.0/tests/test_generator.py +84 -0
  85. fastapi_struct-0.2.1/PKG-INFO +0 -231
  86. fastapi_struct-0.2.1/README.md +0 -218
  87. fastapi_struct-0.2.1/src/create_fastapi_app/__init__.py +0 -1
  88. fastapi_struct-0.2.1/src/create_fastapi_app/cli.py +0 -55
  89. fastapi_struct-0.2.1/src/create_fastapi_app/generator.py +0 -49
  90. fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/.env +0 -4
  91. fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/.env.example +0 -4
  92. fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/.gitignore +0 -9
  93. fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/README.md +0 -31
  94. fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/api/v1/api.py +0 -6
  95. fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/main.py +0 -37
  96. fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/ml/pipeline.py +0 -17
  97. fastapi_struct-0.2.1/src/fastapi_struct.egg-info/PKG-INFO +0 -231
  98. fastapi_struct-0.2.1/tests/test_generator.py +0 -37
  99. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/MANIFEST.in +0 -0
  100. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/setup.cfg +0 -0
  101. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all}/app/__init__.py +0 -0
  102. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/api → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/ai}/__init__.py +0 -0
  103. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/api/v1 → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/api}/__init__.py +0 -0
  104. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/api/v1/routes → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/api/v1}/__init__.py +0 -0
  105. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/core → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/api/v1/routes}/__init__.py +0 -0
  106. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/models → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/core}/__init__.py +0 -0
  107. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/repositories → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/ml}/__init__.py +0 -0
  108. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/schemas → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/models}/__init__.py +0 -0
  109. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/services → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/repositories}/__init__.py +0 -0
  110. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/app/utils → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/schemas}/__init__.py +0 -0
  111. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/basic/tests → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/app/services}/__init__.py +0 -0
  112. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app → fastapi_struct-0.4.0/src/create_fastapi_app/templates/all/tests}/__init__.py +0 -0
  113. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/.env +0 -0
  114. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/.env.example +0 -0
  115. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/.gitignore +0 -0
  116. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/README.md +0 -0
  117. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/api → fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app}/__init__.py +0 -0
  118. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/api/v1 → fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/api}/__init__.py +0 -0
  119. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/api/v1/routes → fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/api/v1}/__init__.py +0 -0
  120. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/api/v1/api.py +0 -0
  121. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/core → fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/api/v1/routes}/__init__.py +0 -0
  122. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/api/v1/routes/items.py +0 -0
  123. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/api/v1/routes/users.py +0 -0
  124. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/ml → fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/core}/__init__.py +0 -0
  125. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/core/config.py +0 -0
  126. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/core/database.py +0 -0
  127. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/core/security.py +0 -0
  128. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/main.py +0 -0
  129. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/schemas → fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/models}/__init__.py +0 -0
  130. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/models/item.py +0 -0
  131. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/models/user.py +0 -0
  132. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/app/services → fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/repositories}/__init__.py +0 -0
  133. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/repositories/item_repository.py +0 -0
  134. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/repositories/user_repository.py +0 -0
  135. {fastapi_struct-0.2.1/src/create_fastapi_app/templates/ml/tests → fastapi_struct-0.4.0/src/create_fastapi_app/templates/basic/app/schemas}/__init__.py +0 -0
  136. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/schemas/item.py +0 -0
  137. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/schemas/user.py +0 -0
  138. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/services/item_service.py +0 -0
  139. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/services/user_service.py +0 -0
  140. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/app/utils/email.py +0 -0
  141. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/pyproject.toml +0 -0
  142. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/requirements.txt +0 -0
  143. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/tests/conftest.py +0 -0
  144. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/tests/test_items.py +0 -0
  145. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/basic/tests/test_users.py +0 -0
  146. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/ml/requirements.txt +0 -0
  147. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/create_fastapi_app/templates/ml/tests/conftest.py +0 -0
  148. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/fastapi_struct.egg-info/dependency_links.txt +0 -0
  149. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/fastapi_struct.egg-info/entry_points.txt +0 -0
  150. {fastapi_struct-0.2.1 → fastapi_struct-0.4.0}/src/fastapi_struct.egg-info/top_level.txt +0 -0
@@ -0,0 +1,307 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-struct
3
+ Version: 0.4.0
4
+ Summary: CLI tool to generate standard, production-ready FastAPI architectures for AI, GenAI & ML services.
5
+ License-Expression: MIT
6
+ Keywords: fastapi,ai,machine-learning,genai,llm,rag,inference,project-structure,boilerplate,scaffold,cli
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Framework :: FastAPI
9
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
10
+ Classifier: Topic :: Software Development :: Code Generators
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+
15
+ <p align="center">
16
+ <a href="https://pypi.org/project/fastapi-struct/"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" width="320" alt="fastapi-struct"></a>
17
+ </p>
18
+ <p align="center">
19
+ <em>Scaffold production-ready FastAPI architectures — AI/ML microservices, enterprise web APIs, or both combined.</em>
20
+ </p>
21
+ <p align="center">
22
+ <a href="https://pypi.org/project/fastapi-struct" target="_blank">
23
+ <img src="https://img.shields.io/pypi/v/fastapi-struct.svg?color=%2334D058" alt="Package version">
24
+ </a>
25
+ <a href="https://pypi.org/project/fastapi-struct" target="_blank">
26
+ <img src="https://img.shields.io/pypi/pyversions/fastapi-struct.svg?color=%2334D058" alt="Supported Python versions">
27
+ </a>
28
+ <a href="https://github.com/fastapi/fastapi" target="_blank">
29
+ <img src="https://img.shields.io/badge/FastAPI-0.115+-009688.svg?logo=fastapi&logoColor=white" alt="FastAPI">
30
+ </a>
31
+ <a href="https://github.com/pydantic/pydantic" target="_blank">
32
+ <img src="https://img.shields.io/badge/Pydantic-v2-E92063.svg?logo=pydantic&logoColor=white" alt="Pydantic v2">
33
+ </a>
34
+ <a href="https://opensource.org/licenses/MIT" target="_blank">
35
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT">
36
+ </a>
37
+ </p>
38
+
39
+ ---
40
+
41
+ **FastAPI Documentation:** [https://fastapi.tiangolo.com](https://fastapi.tiangolo.com)
42
+ **PyPI Package:** [https://pypi.org/project/fastapi-struct/](https://pypi.org/project/fastapi-struct/)
43
+
44
+ ---
45
+
46
+ ## 🗂️ Three Templates, One Tool
47
+
48
+ | Template | Flag | Best For |
49
+ |----------|------|----------|
50
+ | **`ml`** *(default)* | `-t ml` | AI/ML microservices — LLM chat, RAG, inference |
51
+ | **`basic`** | `-t basic` | Traditional enterprise web APIs — CRUD, users, items |
52
+ | **`all`** | `-t all` | Full-stack: AI/ML **+** traditional web API combined |
53
+
54
+ ---
55
+
56
+ ## ⚡ 60-Second Easy Setup Process
57
+
58
+ ### Step 1 — Install & Scaffold
59
+
60
+ ```bash
61
+ pip install fastapi-struct
62
+ ```
63
+
64
+ Pick your architecture:
65
+
66
+ ```bash
67
+ # Default: AI & ML microservice
68
+ fastapi-struct my_project
69
+
70
+ # Traditional enterprise web API
71
+ fastapi-struct my_project -t basic
72
+
73
+ # Everything combined (AI + Web API)
74
+ fastapi-struct my_project -t all
75
+
76
+ # Scaffold into the current directory
77
+ fastapi-struct .
78
+
79
+ # List all templates
80
+ fastapi-struct --list-templates
81
+ ```
82
+
83
+ ---
84
+
85
+ ### Step 2 — Activate Environment & Install Dependencies
86
+
87
+ #### Windows (PowerShell):
88
+ ```powershell
89
+ cd my_project
90
+ python -m venv .venv
91
+ .\.venv\Scripts\Activate.ps1
92
+ pip install -r requirements.txt
93
+ ```
94
+
95
+ #### Windows (Command Prompt):
96
+ ```cmd
97
+ cd my_project
98
+ python -m venv .venv
99
+ call .venv\Scripts\activate.bat
100
+ pip install -r requirements.txt
101
+ ```
102
+
103
+ #### macOS / Linux:
104
+ ```bash
105
+ cd my_project
106
+ python3 -m venv .venv
107
+ source .venv/bin/activate
108
+ pip install -r requirements.txt
109
+ ```
110
+
111
+ ---
112
+
113
+ ### Step 3 — Configure & Run
114
+
115
+ ```bash
116
+ cp .env.example .env # edit with your API keys / settings
117
+ python -m uvicorn app.main:app --reload
118
+ ```
119
+
120
+ Open **[http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)** → interactive Swagger UI, ready to use.
121
+
122
+ ---
123
+
124
+ ## 🤖 Template: `ml` — AI & ML Microservice *(default)*
125
+
126
+ > Lean, production-grade AI/ML service. No CRUD noise.
127
+
128
+ ```text
129
+ my_project/
130
+ ├── app/
131
+ │ ├── main.py # Lifespan model loader (GPU/CPU)
132
+ │ ├── api/v1/routes/
133
+ │ │ ├── health.py # GET /health — GPU & readiness probe
134
+ │ │ ├── chat.py # POST /chat, /chat/stream — LLM streaming
135
+ │ │ ├── rag.py # POST /rag/query — vector retrieval + LLM
136
+ │ │ └── predict.py # POST /predict — ML inference
137
+ │ ├── ai/
138
+ │ │ ├── llm.py # Async token streaming client
139
+ │ │ ├── prompt.py # System prompt templates
140
+ │ │ └── rag.py # VectorRetriever (Pinecone/Qdrant/ChromaDB ready)
141
+ │ ├── ml/
142
+ │ │ ├── model.py # MLModel wrapper (PyTorch/ONNX/HuggingFace)
143
+ │ │ └── pipeline.py # Pre/post-processing pipeline
144
+ │ ├── schemas/ # chat.py · rag.py · predict.py
145
+ │ ├── services/
146
+ │ │ ├── ai_service.py # GenAI orchestration (chat + RAG)
147
+ │ │ └── inference.py # ML inference + latency tracking
148
+ │ └── core/config.py # LLM_MODEL, DEVICE, OPENAI_API_KEY, etc.
149
+ └── tests/
150
+ ├── test_chat.py # Chat & RAG integration tests
151
+ └── test_predict.py # Health & predict integration tests
152
+ ```
153
+
154
+ **Capabilities:**
155
+
156
+ | Feature | Route |
157
+ |---------|-------|
158
+ | GenAI Chat | `POST /api/v1/chat/` |
159
+ | Token Streaming (SSE) | `POST /api/v1/chat/stream` |
160
+ | RAG Vector Search | `POST /api/v1/rag/query` |
161
+ | ML Inference | `POST /api/v1/predict/` |
162
+ | GPU Health Probe | `GET /api/v1/health` |
163
+
164
+ ---
165
+
166
+ ## 🏗️ Template: `basic` — Enterprise Web API
167
+
168
+ > Clean layered architecture for traditional REST APIs. Relational-DB ready.
169
+
170
+ ```text
171
+ my_project/
172
+ ├── app/
173
+ │ ├── main.py
174
+ │ ├── api/v1/routes/
175
+ │ │ ├── users.py # GET/POST /users — user CRUD
176
+ │ │ └── items.py # GET/POST /items — item CRUD
177
+ │ ├── core/
178
+ │ │ ├── config.py # PROJECT_NAME, SECRET_KEY, DEBUG
179
+ │ │ ├── database.py # SQLAlchemy/SQLModel engine (plug-in ready)
180
+ │ │ └── security.py # Password hashing helpers
181
+ │ ├── models/ # ORM models (item.py, user.py)
182
+ │ ├── schemas/ # Pydantic schemas (item.py, user.py)
183
+ │ ├── services/ # Business logic (item_service.py, user_service.py)
184
+ │ └── repositories/ # DB query layer (item_repository.py, user_repository.py)
185
+ └── tests/
186
+ ├── test_items.py
187
+ └── test_users.py
188
+ ```
189
+
190
+ **Capabilities:**
191
+
192
+ | Feature | Route |
193
+ |---------|-------|
194
+ | User CRUD | `GET/POST /api/v1/users/` |
195
+ | Item CRUD | `GET/POST /api/v1/items/` |
196
+ | Health check | `GET /health` |
197
+
198
+ ---
199
+
200
+ ## 🔀 Template: `all` — Full-Stack AI + Web API
201
+
202
+ > Everything in one project. AI/ML inference **and** traditional REST CRUD, security, repositories — unified under one FastAPI app.
203
+
204
+ ```text
205
+ my_project/
206
+ ├── app/
207
+ │ ├── main.py # Lifespan model loader + full app init
208
+ │ ├── api/v1/routes/
209
+ │ │ ├── health.py # GET /health — GPU & readiness probe
210
+ │ │ ├── chat.py # POST /chat, /chat/stream — LLM streaming
211
+ │ │ ├── rag.py # POST /rag/query — RAG + vector search
212
+ │ │ ├── predict.py # POST /predict — ML inference
213
+ │ │ ├── users.py # GET/POST /users — user CRUD
214
+ │ │ └── items.py # GET/POST /items — item CRUD
215
+ │ ├── ai/ # GenAI engine (llm.py, prompt.py, rag.py)
216
+ │ ├── ml/ # ML engine (model.py, pipeline.py)
217
+ │ ├── schemas/ # chat.py, rag.py, predict.py, user.py, item.py
218
+ │ ├── services/ # ai_service.py, inference.py, user_service.py, item_service.py
219
+ │ ├── repositories/ # user_repository.py, item_repository.py
220
+ │ ├── models/ # user.py, item.py (ORM-ready)
221
+ │ └── core/
222
+ │ ├── config.py # All settings — LLM, ML, Auth, DB
223
+ │ ├── database.py # DB engine (SQLAlchemy/SQLModel ready)
224
+ │ └── security.py # Password hashing
225
+ └── tests/
226
+ ├── test_ai.py # 4 AI/ML integration tests
227
+ └── test_web.py # 4 Web API integration tests
228
+ ```
229
+
230
+ **All Capabilities Combined:**
231
+
232
+ | Feature | Route |
233
+ |---------|-------|
234
+ | GenAI Chat | `POST /api/v1/chat/` |
235
+ | Token Streaming | `POST /api/v1/chat/stream` |
236
+ | RAG Vector Search | `POST /api/v1/rag/query` |
237
+ | ML Inference | `POST /api/v1/predict/` |
238
+ | GPU Health Probe | `GET /api/v1/health` |
239
+ | User CRUD | `GET/POST /api/v1/users/` |
240
+ | Item CRUD | `GET/POST /api/v1/items/` |
241
+
242
+ ---
243
+
244
+ ## 🎯 Feature Highlights (All Templates)
245
+
246
+ - 🤖 **GenAI Token Streaming** — Real-time `StreamingResponse` (SSE) for LLM chat completions
247
+ - 📚 **RAG & Vector Search** — Plug in Pinecone, Qdrant, ChromaDB, or pgvector
248
+ - 🧠 **Lifespan Model Caching** — PyTorch/ONNX/HuggingFace weights loaded once at startup
249
+ - 🩺 **GPU & Readiness Probes** — `/health` reports `cpu`/`cuda` device status
250
+ - 🧹 **Zero `__pycache__` Clutter** — Byte-compiled files automatically excluded
251
+ - 🧪 **Preconfigured Pytest Suite** — Integration tests included for every template
252
+
253
+ ---
254
+
255
+ ## 🧪 Run Tests
256
+
257
+ ```bash
258
+ pytest
259
+ ```
260
+
261
+ Tests are in `tests/` and run against the live FastAPI app via `TestClient`.
262
+
263
+ ---
264
+
265
+ ## 📦 Installation
266
+
267
+ ```bash
268
+ pip install fastapi-struct
269
+ ```
270
+
271
+ Both entry points work identically:
272
+
273
+ ```bash
274
+ fastapi-struct my_project # recommended
275
+ create-fastapi-app my_project # alias
276
+ ```
277
+
278
+ ---
279
+
280
+ ## 🔑 Environment Configuration
281
+
282
+ Copy `.env.example` → `.env` and fill in your values:
283
+
284
+ ```env
285
+ # Common
286
+ PROJECT_NAME="My Service"
287
+ DEBUG=true
288
+ SECRET_KEY="your_secret_key_here" # basic / all only
289
+
290
+ # AI / GenAI (ml / all templates)
291
+ OPENAI_API_KEY="sk-..."
292
+ LLM_MODEL="gpt-4o-mini"
293
+ EMBEDDING_MODEL="text-embedding-3-small"
294
+
295
+ # ML Inference (ml / all templates)
296
+ ML_MODEL_NAME="classifier-v1"
297
+ ML_MODEL_PATH="models/weights.bin"
298
+ DEVICE="cpu" # or "cuda"
299
+ ```
300
+
301
+ ---
302
+
303
+ ## 📋 Requirements
304
+
305
+ - Python 3.10+
306
+ - FastAPI 0.115+
307
+ - Pydantic v2
@@ -0,0 +1,293 @@
1
+ <p align="center">
2
+ <a href="https://pypi.org/project/fastapi-struct/"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" width="320" alt="fastapi-struct"></a>
3
+ </p>
4
+ <p align="center">
5
+ <em>Scaffold production-ready FastAPI architectures — AI/ML microservices, enterprise web APIs, or both combined.</em>
6
+ </p>
7
+ <p align="center">
8
+ <a href="https://pypi.org/project/fastapi-struct" target="_blank">
9
+ <img src="https://img.shields.io/pypi/v/fastapi-struct.svg?color=%2334D058" alt="Package version">
10
+ </a>
11
+ <a href="https://pypi.org/project/fastapi-struct" target="_blank">
12
+ <img src="https://img.shields.io/pypi/pyversions/fastapi-struct.svg?color=%2334D058" alt="Supported Python versions">
13
+ </a>
14
+ <a href="https://github.com/fastapi/fastapi" target="_blank">
15
+ <img src="https://img.shields.io/badge/FastAPI-0.115+-009688.svg?logo=fastapi&logoColor=white" alt="FastAPI">
16
+ </a>
17
+ <a href="https://github.com/pydantic/pydantic" target="_blank">
18
+ <img src="https://img.shields.io/badge/Pydantic-v2-E92063.svg?logo=pydantic&logoColor=white" alt="Pydantic v2">
19
+ </a>
20
+ <a href="https://opensource.org/licenses/MIT" target="_blank">
21
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT">
22
+ </a>
23
+ </p>
24
+
25
+ ---
26
+
27
+ **FastAPI Documentation:** [https://fastapi.tiangolo.com](https://fastapi.tiangolo.com)
28
+ **PyPI Package:** [https://pypi.org/project/fastapi-struct/](https://pypi.org/project/fastapi-struct/)
29
+
30
+ ---
31
+
32
+ ## 🗂️ Three Templates, One Tool
33
+
34
+ | Template | Flag | Best For |
35
+ |----------|------|----------|
36
+ | **`ml`** *(default)* | `-t ml` | AI/ML microservices — LLM chat, RAG, inference |
37
+ | **`basic`** | `-t basic` | Traditional enterprise web APIs — CRUD, users, items |
38
+ | **`all`** | `-t all` | Full-stack: AI/ML **+** traditional web API combined |
39
+
40
+ ---
41
+
42
+ ## ⚡ 60-Second Easy Setup Process
43
+
44
+ ### Step 1 — Install & Scaffold
45
+
46
+ ```bash
47
+ pip install fastapi-struct
48
+ ```
49
+
50
+ Pick your architecture:
51
+
52
+ ```bash
53
+ # Default: AI & ML microservice
54
+ fastapi-struct my_project
55
+
56
+ # Traditional enterprise web API
57
+ fastapi-struct my_project -t basic
58
+
59
+ # Everything combined (AI + Web API)
60
+ fastapi-struct my_project -t all
61
+
62
+ # Scaffold into the current directory
63
+ fastapi-struct .
64
+
65
+ # List all templates
66
+ fastapi-struct --list-templates
67
+ ```
68
+
69
+ ---
70
+
71
+ ### Step 2 — Activate Environment & Install Dependencies
72
+
73
+ #### Windows (PowerShell):
74
+ ```powershell
75
+ cd my_project
76
+ python -m venv .venv
77
+ .\.venv\Scripts\Activate.ps1
78
+ pip install -r requirements.txt
79
+ ```
80
+
81
+ #### Windows (Command Prompt):
82
+ ```cmd
83
+ cd my_project
84
+ python -m venv .venv
85
+ call .venv\Scripts\activate.bat
86
+ pip install -r requirements.txt
87
+ ```
88
+
89
+ #### macOS / Linux:
90
+ ```bash
91
+ cd my_project
92
+ python3 -m venv .venv
93
+ source .venv/bin/activate
94
+ pip install -r requirements.txt
95
+ ```
96
+
97
+ ---
98
+
99
+ ### Step 3 — Configure & Run
100
+
101
+ ```bash
102
+ cp .env.example .env # edit with your API keys / settings
103
+ python -m uvicorn app.main:app --reload
104
+ ```
105
+
106
+ Open **[http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)** → interactive Swagger UI, ready to use.
107
+
108
+ ---
109
+
110
+ ## 🤖 Template: `ml` — AI & ML Microservice *(default)*
111
+
112
+ > Lean, production-grade AI/ML service. No CRUD noise.
113
+
114
+ ```text
115
+ my_project/
116
+ ├── app/
117
+ │ ├── main.py # Lifespan model loader (GPU/CPU)
118
+ │ ├── api/v1/routes/
119
+ │ │ ├── health.py # GET /health — GPU & readiness probe
120
+ │ │ ├── chat.py # POST /chat, /chat/stream — LLM streaming
121
+ │ │ ├── rag.py # POST /rag/query — vector retrieval + LLM
122
+ │ │ └── predict.py # POST /predict — ML inference
123
+ │ ├── ai/
124
+ │ │ ├── llm.py # Async token streaming client
125
+ │ │ ├── prompt.py # System prompt templates
126
+ │ │ └── rag.py # VectorRetriever (Pinecone/Qdrant/ChromaDB ready)
127
+ │ ├── ml/
128
+ │ │ ├── model.py # MLModel wrapper (PyTorch/ONNX/HuggingFace)
129
+ │ │ └── pipeline.py # Pre/post-processing pipeline
130
+ │ ├── schemas/ # chat.py · rag.py · predict.py
131
+ │ ├── services/
132
+ │ │ ├── ai_service.py # GenAI orchestration (chat + RAG)
133
+ │ │ └── inference.py # ML inference + latency tracking
134
+ │ └── core/config.py # LLM_MODEL, DEVICE, OPENAI_API_KEY, etc.
135
+ └── tests/
136
+ ├── test_chat.py # Chat & RAG integration tests
137
+ └── test_predict.py # Health & predict integration tests
138
+ ```
139
+
140
+ **Capabilities:**
141
+
142
+ | Feature | Route |
143
+ |---------|-------|
144
+ | GenAI Chat | `POST /api/v1/chat/` |
145
+ | Token Streaming (SSE) | `POST /api/v1/chat/stream` |
146
+ | RAG Vector Search | `POST /api/v1/rag/query` |
147
+ | ML Inference | `POST /api/v1/predict/` |
148
+ | GPU Health Probe | `GET /api/v1/health` |
149
+
150
+ ---
151
+
152
+ ## 🏗️ Template: `basic` — Enterprise Web API
153
+
154
+ > Clean layered architecture for traditional REST APIs. Relational-DB ready.
155
+
156
+ ```text
157
+ my_project/
158
+ ├── app/
159
+ │ ├── main.py
160
+ │ ├── api/v1/routes/
161
+ │ │ ├── users.py # GET/POST /users — user CRUD
162
+ │ │ └── items.py # GET/POST /items — item CRUD
163
+ │ ├── core/
164
+ │ │ ├── config.py # PROJECT_NAME, SECRET_KEY, DEBUG
165
+ │ │ ├── database.py # SQLAlchemy/SQLModel engine (plug-in ready)
166
+ │ │ └── security.py # Password hashing helpers
167
+ │ ├── models/ # ORM models (item.py, user.py)
168
+ │ ├── schemas/ # Pydantic schemas (item.py, user.py)
169
+ │ ├── services/ # Business logic (item_service.py, user_service.py)
170
+ │ └── repositories/ # DB query layer (item_repository.py, user_repository.py)
171
+ └── tests/
172
+ ├── test_items.py
173
+ └── test_users.py
174
+ ```
175
+
176
+ **Capabilities:**
177
+
178
+ | Feature | Route |
179
+ |---------|-------|
180
+ | User CRUD | `GET/POST /api/v1/users/` |
181
+ | Item CRUD | `GET/POST /api/v1/items/` |
182
+ | Health check | `GET /health` |
183
+
184
+ ---
185
+
186
+ ## 🔀 Template: `all` — Full-Stack AI + Web API
187
+
188
+ > Everything in one project. AI/ML inference **and** traditional REST CRUD, security, repositories — unified under one FastAPI app.
189
+
190
+ ```text
191
+ my_project/
192
+ ├── app/
193
+ │ ├── main.py # Lifespan model loader + full app init
194
+ │ ├── api/v1/routes/
195
+ │ │ ├── health.py # GET /health — GPU & readiness probe
196
+ │ │ ├── chat.py # POST /chat, /chat/stream — LLM streaming
197
+ │ │ ├── rag.py # POST /rag/query — RAG + vector search
198
+ │ │ ├── predict.py # POST /predict — ML inference
199
+ │ │ ├── users.py # GET/POST /users — user CRUD
200
+ │ │ └── items.py # GET/POST /items — item CRUD
201
+ │ ├── ai/ # GenAI engine (llm.py, prompt.py, rag.py)
202
+ │ ├── ml/ # ML engine (model.py, pipeline.py)
203
+ │ ├── schemas/ # chat.py, rag.py, predict.py, user.py, item.py
204
+ │ ├── services/ # ai_service.py, inference.py, user_service.py, item_service.py
205
+ │ ├── repositories/ # user_repository.py, item_repository.py
206
+ │ ├── models/ # user.py, item.py (ORM-ready)
207
+ │ └── core/
208
+ │ ├── config.py # All settings — LLM, ML, Auth, DB
209
+ │ ├── database.py # DB engine (SQLAlchemy/SQLModel ready)
210
+ │ └── security.py # Password hashing
211
+ └── tests/
212
+ ├── test_ai.py # 4 AI/ML integration tests
213
+ └── test_web.py # 4 Web API integration tests
214
+ ```
215
+
216
+ **All Capabilities Combined:**
217
+
218
+ | Feature | Route |
219
+ |---------|-------|
220
+ | GenAI Chat | `POST /api/v1/chat/` |
221
+ | Token Streaming | `POST /api/v1/chat/stream` |
222
+ | RAG Vector Search | `POST /api/v1/rag/query` |
223
+ | ML Inference | `POST /api/v1/predict/` |
224
+ | GPU Health Probe | `GET /api/v1/health` |
225
+ | User CRUD | `GET/POST /api/v1/users/` |
226
+ | Item CRUD | `GET/POST /api/v1/items/` |
227
+
228
+ ---
229
+
230
+ ## 🎯 Feature Highlights (All Templates)
231
+
232
+ - 🤖 **GenAI Token Streaming** — Real-time `StreamingResponse` (SSE) for LLM chat completions
233
+ - 📚 **RAG & Vector Search** — Plug in Pinecone, Qdrant, ChromaDB, or pgvector
234
+ - 🧠 **Lifespan Model Caching** — PyTorch/ONNX/HuggingFace weights loaded once at startup
235
+ - 🩺 **GPU & Readiness Probes** — `/health` reports `cpu`/`cuda` device status
236
+ - 🧹 **Zero `__pycache__` Clutter** — Byte-compiled files automatically excluded
237
+ - 🧪 **Preconfigured Pytest Suite** — Integration tests included for every template
238
+
239
+ ---
240
+
241
+ ## 🧪 Run Tests
242
+
243
+ ```bash
244
+ pytest
245
+ ```
246
+
247
+ Tests are in `tests/` and run against the live FastAPI app via `TestClient`.
248
+
249
+ ---
250
+
251
+ ## 📦 Installation
252
+
253
+ ```bash
254
+ pip install fastapi-struct
255
+ ```
256
+
257
+ Both entry points work identically:
258
+
259
+ ```bash
260
+ fastapi-struct my_project # recommended
261
+ create-fastapi-app my_project # alias
262
+ ```
263
+
264
+ ---
265
+
266
+ ## 🔑 Environment Configuration
267
+
268
+ Copy `.env.example` → `.env` and fill in your values:
269
+
270
+ ```env
271
+ # Common
272
+ PROJECT_NAME="My Service"
273
+ DEBUG=true
274
+ SECRET_KEY="your_secret_key_here" # basic / all only
275
+
276
+ # AI / GenAI (ml / all templates)
277
+ OPENAI_API_KEY="sk-..."
278
+ LLM_MODEL="gpt-4o-mini"
279
+ EMBEDDING_MODEL="text-embedding-3-small"
280
+
281
+ # ML Inference (ml / all templates)
282
+ ML_MODEL_NAME="classifier-v1"
283
+ ML_MODEL_PATH="models/weights.bin"
284
+ DEVICE="cpu" # or "cuda"
285
+ ```
286
+
287
+ ---
288
+
289
+ ## 📋 Requirements
290
+
291
+ - Python 3.10+
292
+ - FastAPI 0.115+
293
+ - Pydantic v2
@@ -4,26 +4,28 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fastapi-struct"
7
- version = "0.2.1"
8
- description = "CLI tool to generate standard, layered enterprise folder structures for FastAPI applications."
7
+ version = "0.4.0"
8
+ description = "CLI tool to generate standard, production-ready FastAPI architectures for AI, GenAI & ML services."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  license = "MIT"
12
12
  keywords = [
13
13
  "fastapi",
14
+ "ai",
15
+ "machine-learning",
16
+ "genai",
17
+ "llm",
18
+ "rag",
19
+ "inference",
14
20
  "project-structure",
15
21
  "boilerplate",
16
22
  "scaffold",
17
23
  "cli",
18
- "template",
19
- "folder-structure",
20
- "architecture",
21
- "repository-pattern",
22
- "rest-api",
23
24
  ]
24
25
  classifiers = [
25
26
  "Programming Language :: Python :: 3",
26
27
  "Framework :: FastAPI",
28
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
27
29
  "Topic :: Software Development :: Code Generators",
28
30
  "Operating System :: OS Independent",
29
31
  ]
@@ -0,0 +1 @@
1
+ __version__ = "0.4.0"