fastapi-fullstack 0.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. fastapi_fullstack-0.1.7.dist-info/METADATA +739 -0
  2. fastapi_fullstack-0.1.7.dist-info/RECORD +241 -0
  3. fastapi_fullstack-0.1.7.dist-info/WHEEL +4 -0
  4. fastapi_fullstack-0.1.7.dist-info/entry_points.txt +2 -0
  5. fastapi_fullstack-0.1.7.dist-info/licenses/LICENSE +21 -0
  6. fastapi_gen/__init__.py +3 -0
  7. fastapi_gen/cli.py +442 -0
  8. fastapi_gen/config.py +356 -0
  9. fastapi_gen/generator.py +207 -0
  10. fastapi_gen/prompts.py +874 -0
  11. fastapi_gen/template/VARIABLES.md +276 -0
  12. fastapi_gen/template/cookiecutter.json +93 -0
  13. fastapi_gen/template/hooks/post_gen_project.py +355 -0
  14. fastapi_gen/template/{{cookiecutter.project_slug}}/.env.prod.example +56 -0
  15. fastapi_gen/template/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +150 -0
  16. fastapi_gen/template/{{cookiecutter.project_slug}}/.gitignore +109 -0
  17. fastapi_gen/template/{{cookiecutter.project_slug}}/AGENTS.md +55 -0
  18. fastapi_gen/template/{{cookiecutter.project_slug}}/CLAUDE.md +99 -0
  19. fastapi_gen/template/{{cookiecutter.project_slug}}/Makefile +315 -0
  20. fastapi_gen/template/{{cookiecutter.project_slug}}/README.md +768 -0
  21. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/.dockerignore +60 -0
  22. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/.env.example +155 -0
  23. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/.pre-commit-config.yaml +32 -0
  24. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/Dockerfile +56 -0
  25. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic/env.py +76 -0
  26. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic/script.py.mako +30 -0
  27. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic/versions/.gitkeep +0 -0
  28. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic.ini +48 -0
  29. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/__init__.py +3 -0
  30. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/admin.py +447 -0
  31. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/__init__.py +23 -0
  32. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/assistant.py +226 -0
  33. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/langchain_assistant.py +226 -0
  34. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/prompts.py +10 -0
  35. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/tools/__init__.py +13 -0
  36. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/tools/datetime_tool.py +17 -0
  37. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/__init__.py +1 -0
  38. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/deps.py +541 -0
  39. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/exception_handlers.py +98 -0
  40. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/router.py +10 -0
  41. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/__init__.py +9 -0
  42. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/__init__.py +87 -0
  43. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/agent.py +902 -0
  44. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/auth.py +395 -0
  45. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/conversations.py +498 -0
  46. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/health.py +227 -0
  47. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/items.py +275 -0
  48. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/oauth.py +205 -0
  49. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/sessions.py +168 -0
  50. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/users.py +333 -0
  51. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/webhooks.py +477 -0
  52. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/ws.py +46 -0
  53. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/versioning.py +221 -0
  54. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/clients/__init__.py +14 -0
  55. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/clients/redis.py +88 -0
  56. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/__init__.py +117 -0
  57. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/cleanup.py +75 -0
  58. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/example.py +28 -0
  59. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/seed.py +266 -0
  60. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/__init__.py +5 -0
  61. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/cache.py +23 -0
  62. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/config.py +267 -0
  63. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/csrf.py +153 -0
  64. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/exceptions.py +122 -0
  65. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/logfire_setup.py +101 -0
  66. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/middleware.py +99 -0
  67. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/oauth.py +23 -0
  68. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/rate_limit.py +58 -0
  69. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/sanitize.py +271 -0
  70. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/security.py +102 -0
  71. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/__init__.py +7 -0
  72. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/base.py +41 -0
  73. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/__init__.py +31 -0
  74. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/conversation.py +319 -0
  75. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/item.py +96 -0
  76. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/session.py +126 -0
  77. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/user.py +218 -0
  78. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/webhook.py +244 -0
  79. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/session.py +130 -0
  80. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/main.py +334 -0
  81. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/pipelines/__init__.py +9 -0
  82. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/pipelines/base.py +73 -0
  83. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/__init__.py +49 -0
  84. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/base.py +154 -0
  85. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/conversation.py +838 -0
  86. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/item.py +222 -0
  87. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/session.py +318 -0
  88. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/user.py +322 -0
  89. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/webhook.py +358 -0
  90. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/__init__.py +50 -0
  91. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/base.py +57 -0
  92. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/conversation.py +192 -0
  93. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/item.py +52 -0
  94. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/session.py +42 -0
  95. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/token.py +31 -0
  96. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/user.py +64 -0
  97. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/webhook.py +89 -0
  98. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/__init__.py +38 -0
  99. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/conversation.py +850 -0
  100. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/item.py +246 -0
  101. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/session.py +333 -0
  102. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/user.py +432 -0
  103. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/webhook.py +561 -0
  104. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/__init__.py +5 -0
  105. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/celery_app.py +64 -0
  106. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/taskiq_app.py +38 -0
  107. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/__init__.py +25 -0
  108. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/examples.py +106 -0
  109. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/schedules.py +29 -0
  110. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/taskiq_examples.py +92 -0
  111. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/cli/__init__.py +1 -0
  112. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/cli/commands.py +438 -0
  113. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/pyproject.toml +180 -0
  114. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/scripts/.gitkeep +0 -0
  115. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/__init__.py +1 -0
  116. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/__init__.py +1 -0
  117. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_auth.py +242 -0
  118. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_exceptions.py +151 -0
  119. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_health.py +113 -0
  120. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_items.py +310 -0
  121. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_users.py +253 -0
  122. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/conftest.py +151 -0
  123. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_admin.py +890 -0
  124. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_agents.py +261 -0
  125. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_clients.py +183 -0
  126. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_commands.py +173 -0
  127. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_core.py +143 -0
  128. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_pipelines.py +118 -0
  129. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_repositories.py +181 -0
  130. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_security.py +124 -0
  131. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_services.py +363 -0
  132. fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_worker.py +85 -0
  133. fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.dev.yml +242 -0
  134. fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.frontend.yml +31 -0
  135. fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.prod.yml +435 -0
  136. fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.yml +241 -0
  137. fastapi_gen/template/{{cookiecutter.project_slug}}/docs/adding_features.md +132 -0
  138. fastapi_gen/template/{{cookiecutter.project_slug}}/docs/architecture.md +63 -0
  139. fastapi_gen/template/{{cookiecutter.project_slug}}/docs/patterns.md +161 -0
  140. fastapi_gen/template/{{cookiecutter.project_slug}}/docs/testing.md +120 -0
  141. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.dockerignore +40 -0
  142. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.env.example +12 -0
  143. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.gitignore +45 -0
  144. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.prettierignore +19 -0
  145. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.prettierrc +11 -0
  146. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/Dockerfile +44 -0
  147. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/README.md +648 -0
  148. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/e2e/auth.setup.ts +49 -0
  149. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/e2e/auth.spec.ts +134 -0
  150. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/e2e/chat.spec.ts +207 -0
  151. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/e2e/home.spec.ts +73 -0
  152. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/instrumentation.ts +14 -0
  153. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/messages/en.json +84 -0
  154. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/messages/pl.json +84 -0
  155. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/next.config.ts +76 -0
  156. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/package.json +69 -0
  157. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/playwright.config.ts +101 -0
  158. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/postcss.config.mjs +7 -0
  159. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(auth)/layout.tsx +11 -0
  160. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(auth)/login/page.tsx +5 -0
  161. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(auth)/register/page.tsx +5 -0
  162. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(dashboard)/chat/page.tsx +48 -0
  163. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(dashboard)/dashboard/page.tsx +99 -0
  164. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(dashboard)/layout.tsx +17 -0
  165. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(dashboard)/profile/page.tsx +152 -0
  166. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/auth/callback/page.tsx +113 -0
  167. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/layout.tsx +46 -0
  168. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/page.tsx +73 -0
  169. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/login/route.ts +58 -0
  170. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/logout/route.ts +24 -0
  171. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/me/route.ts +39 -0
  172. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/oauth-callback/route.ts +50 -0
  173. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/refresh/route.ts +54 -0
  174. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/register/route.ts +26 -0
  175. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/conversations/[id]/messages/route.ts +41 -0
  176. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/conversations/[id]/route.ts +108 -0
  177. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/conversations/route.ts +73 -0
  178. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/health/route.ts +21 -0
  179. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/globals.css +323 -0
  180. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/layout.tsx +22 -0
  181. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/providers.tsx +29 -0
  182. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/auth/index.ts +2 -0
  183. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/auth/login-form.tsx +120 -0
  184. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/auth/register-form.tsx +153 -0
  185. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/chat-container.tsx +234 -0
  186. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/chat-input.tsx +72 -0
  187. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/conversation-sidebar.tsx +328 -0
  188. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/copy-button.tsx +46 -0
  189. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/index.ts +11 -0
  190. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/local-conversation-sidebar.tsx +295 -0
  191. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/markdown-content.tsx +167 -0
  192. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/message-item.tsx +79 -0
  193. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/message-list.tsx +18 -0
  194. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/tool-call-card.tsx +79 -0
  195. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/icons/google-icon.tsx +32 -0
  196. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/icons/index.ts +3 -0
  197. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/language-switcher.tsx +97 -0
  198. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/layout/header.tsx +65 -0
  199. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/layout/index.ts +2 -0
  200. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/layout/sidebar.tsx +82 -0
  201. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/theme/index.ts +7 -0
  202. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/theme/theme-provider.tsx +53 -0
  203. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/theme/theme-toggle.tsx +105 -0
  204. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/badge.tsx +35 -0
  205. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/button.test.tsx +75 -0
  206. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/button.tsx +56 -0
  207. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/card.tsx +82 -0
  208. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/index.ts +13 -0
  209. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/input.tsx +21 -0
  210. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/label.tsx +21 -0
  211. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/sheet.tsx +109 -0
  212. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/index.ts +7 -0
  213. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-auth.ts +97 -0
  214. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-chat.ts +203 -0
  215. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-conversations.ts +181 -0
  216. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-local-chat.ts +165 -0
  217. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-websocket.ts +105 -0
  218. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/i18n.ts +37 -0
  219. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/api-client.ts +90 -0
  220. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/constants.ts +39 -0
  221. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/server-api.ts +78 -0
  222. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/utils.test.ts +44 -0
  223. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/utils.ts +44 -0
  224. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/middleware.ts +31 -0
  225. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/auth-store.test.ts +72 -0
  226. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/auth-store.ts +64 -0
  227. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/chat-sidebar-store.ts +17 -0
  228. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/chat-store.ts +65 -0
  229. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/conversation-store.ts +76 -0
  230. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/index.ts +9 -0
  231. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/local-chat-store.ts +255 -0
  232. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/sidebar-store.ts +17 -0
  233. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/theme-store.ts +44 -0
  234. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/api.ts +27 -0
  235. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/auth.ts +52 -0
  236. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/chat.ts +83 -0
  237. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/conversation.ts +49 -0
  238. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/index.ts +10 -0
  239. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/tsconfig.json +28 -0
  240. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/vitest.config.ts +36 -0
  241. fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/vitest.setup.ts +56 -0
@@ -0,0 +1,768 @@
1
+ # Full-Stack FastAPI + Next.js Template for AI/LLM Applications
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/stargazers"><img src="https://img.shields.io/github/stars/vstorm-co/full-stack-fastapi-nextjs-llm-template?style=flat&logo=github&color=yellow" alt="GitHub Stars"></a>
5
+ <a href="https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/LICENSE"><img src="https://img.shields.io/github/license/vstorm-co/full-stack-fastapi-nextjs-llm-template?color=blue" alt="License"></a>
6
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue?logo=python&logoColor=white" alt="Python"></a>
7
+ <a href="https://pypi.org/project/fastapi-fullstack/"><img src="https://img.shields.io/pypi/v/fastapi-fullstack?color=green&logo=pypi&logoColor=white" alt="PyPI"></a>
8
+ <img src="https://img.shields.io/badge/coverage-100%25-brightgreen" alt="Coverage">
9
+ <img src="https://img.shields.io/badge/integrations-20%2B-brightgreen" alt="20+ Integrations">
10
+ </p>
11
+
12
+ <p align="center">
13
+ <b>Production-ready project generator for AI/LLM applications with 20+ enterprise integrations.</b><br>
14
+ <sub>Built with FastAPI, Next.js 15, PydanticAI/LangChain, and everything you need for professional business applications.</sub>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <a href="#-why-this-template">Why This Template</a> •
19
+ <a href="#-features">Features</a> •
20
+ <a href="#-demo">Demo</a> •
21
+ <a href="#-quick-start">Quick Start</a> •
22
+ <a href="#-architecture">Architecture</a> •
23
+ <a href="#-ai-agent">AI Agent</a> •
24
+ <a href="#-observability-with-logfire">Logfire</a> •
25
+ <a href="#-documentation">Documentation</a>
26
+ </p>
27
+
28
+ ## Related Projects
29
+
30
+ > **Building advanced AI agents?** Check out [pydantic-deep](https://github.com/vstorm-co/pydantic-deepagents) - a deep agent framework built on pydantic-ai with planning, filesystem, and subagent capabilities.
31
+
32
+ ---
33
+
34
+ ## 🎯 Why This Template
35
+
36
+ Building AI/LLM applications requires more than just an API wrapper. You need:
37
+
38
+ - **Type-safe AI agents** with tool/function calling
39
+ - **Real-time streaming** responses via WebSocket
40
+ - **Conversation persistence** and history management
41
+ - **Production infrastructure** - auth, rate limiting, observability
42
+ - **Enterprise integrations** - background tasks, webhooks, admin panels
43
+
44
+ This template gives you all of that out of the box, with **20+ configurable integrations** so you can focus on building your AI product, not boilerplate.
45
+
46
+ ### Perfect For
47
+
48
+ - 🤖 **AI Chatbots & Assistants** - PydanticAI or LangChain agents with streaming responses
49
+ - 📊 **ML Applications** - Background task processing with Celery/Taskiq
50
+ - 🏢 **Enterprise SaaS** - Full auth, admin panel, webhooks, and more
51
+ - 🚀 **Startups** - Ship fast with production-ready infrastructure
52
+
53
+ ---
54
+
55
+ ## ✨ Features
56
+
57
+ ### 🤖 AI/LLM First
58
+
59
+ - **[PydanticAI](https://ai.pydantic.dev)** or **[LangChain](https://python.langchain.com)** - Choose your preferred AI framework
60
+ - **WebSocket Streaming** - Real-time responses with full event access
61
+ - **Conversation Persistence** - Save chat history to database
62
+ - **Custom Tools** - Easily extend agent capabilities
63
+ - **Multi-model Support** - OpenAI, Anthropic, and more
64
+ - **Observability** - Logfire for PydanticAI, LangSmith for LangChain
65
+
66
+ ### ⚡ Backend (FastAPI)
67
+
68
+ - **[FastAPI](https://fastapi.tiangolo.com)** + **[Pydantic v2](https://docs.pydantic.dev)** - High-performance async API
69
+ - **Multiple Databases** - PostgreSQL (async), MongoDB (async), SQLite
70
+ - **Authentication** - JWT + Refresh tokens, API Keys, OAuth2 (Google)
71
+ - **Background Tasks** - Celery, Taskiq, or ARQ
72
+ - **Django-style CLI** - Custom management commands with auto-discovery
73
+
74
+ ### 🎨 Frontend (Next.js 15)
75
+
76
+ - **React 19** + **TypeScript** + **Tailwind CSS v4**
77
+ - **AI Chat Interface** - WebSocket streaming, tool call visualization
78
+ - **Authentication** - HTTP-only cookies, auto-refresh
79
+ - **Dark Mode** + **i18n** (optional)
80
+
81
+ ### 🔌 20+ Enterprise Integrations
82
+
83
+ | Category | Integrations |
84
+ |----------|-------------|
85
+ | **AI Frameworks** | PydanticAI, LangChain |
86
+ | **Caching & State** | Redis, fastapi-cache2 |
87
+ | **Security** | Rate limiting, CORS, CSRF protection |
88
+ | **Observability** | Logfire, LangSmith, Sentry, Prometheus |
89
+ | **Admin** | SQLAdmin panel with auth |
90
+ | **Events** | Webhooks, WebSockets |
91
+ | **DevOps** | Docker, GitHub Actions, GitLab CI, Kubernetes |
92
+
93
+ ---
94
+
95
+ ## 🎬 Demo
96
+
97
+ <p align="center">
98
+ <img src="https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/app_start.gif" alt="FastAPI Fullstack Generator Demo">
99
+ </p>
100
+
101
+ ---
102
+
103
+ ## 🚀 Quick Start
104
+
105
+ ### Installation
106
+
107
+ ```bash
108
+ # pip
109
+ pip install fastapi-fullstack
110
+
111
+ # uv (recommended)
112
+ uv tool install fastapi-fullstack
113
+
114
+ # pipx
115
+ pipx install fastapi-fullstack
116
+ ```
117
+
118
+ ### Create Your Project
119
+
120
+ ```bash
121
+ # Interactive wizard (recommended)
122
+ fastapi-fullstack new
123
+
124
+ # Quick mode with options
125
+ fastapi-fullstack create my_ai_app \
126
+ --database postgresql \
127
+ --auth jwt \
128
+ --frontend nextjs
129
+
130
+ # Use presets for common setups
131
+ fastapi-fullstack create my_ai_app --preset production # Full production setup
132
+ fastapi-fullstack create my_ai_app --preset ai-agent # AI agent with streaming
133
+
134
+ # Minimal project (no extras)
135
+ fastapi-fullstack create my_ai_app --minimal
136
+ ```
137
+
138
+ ### Start Development
139
+
140
+ #### Step 1: Install Dependencies
141
+
142
+ ```bash
143
+ cd my_ai_app
144
+ make install
145
+ ```
146
+
147
+ #### Step 2: Start the Database
148
+ {%- if cookiecutter.use_postgresql %}
149
+
150
+ ```bash
151
+ # Start PostgreSQL with Docker
152
+ make docker-db
153
+
154
+ # Wait a few seconds for the database to be ready
155
+ ```
156
+ {%- elif cookiecutter.use_mongodb %}
157
+
158
+ ```bash
159
+ # Start MongoDB with Docker
160
+ docker-compose up -d mongo
161
+ ```
162
+ {%- endif %}
163
+
164
+ {%- if cookiecutter.use_postgresql or cookiecutter.use_sqlite %}
165
+
166
+ #### Step 3: Create and Apply Database Migrations
167
+
168
+ The project uses Alembic for database migrations. After generating a new project, you need to create the initial migration:
169
+
170
+ ```bash
171
+ # Create the initial migration (generates migration file based on your models)
172
+ make db-migrate
173
+ # When prompted, enter a message like: "Initial migration"
174
+
175
+ # Apply the migration to create tables
176
+ make db-upgrade
177
+ ```
178
+
179
+ > **Note:** Run `make db-migrate` whenever you modify database models to generate new migrations.
180
+ {%- endif %}
181
+
182
+ {%- if cookiecutter.use_jwt %}
183
+
184
+ #### Step 4: Create Admin User
185
+
186
+ ```bash
187
+ # Create an admin user (required for SQLAdmin panel access)
188
+ make create-admin
189
+ # Enter email and password when prompted
190
+ ```
191
+ {%- endif %}
192
+
193
+ #### Step 5: Start the Backend
194
+
195
+ ```bash
196
+ make run
197
+ ```
198
+
199
+ The API will be available at:
200
+ - API: http://localhost:{{ cookiecutter.backend_port }}
201
+ - Docs: http://localhost:{{ cookiecutter.backend_port }}/docs
202
+ {%- if cookiecutter.enable_admin_panel %}
203
+ - Admin Panel: http://localhost:{{ cookiecutter.backend_port }}/admin
204
+ {%- endif %}
205
+
206
+ {%- if cookiecutter.use_frontend %}
207
+
208
+ #### Step 6: Start the Frontend (separate terminal)
209
+
210
+ ```bash
211
+ cd frontend
212
+ bun install
213
+ bun dev
214
+ ```
215
+
216
+ Frontend: http://localhost:{{ cookiecutter.frontend_port }}
217
+ {%- endif %}
218
+
219
+ ---
220
+
221
+ ### Quick Start with Docker
222
+
223
+ Alternatively, run everything with Docker:
224
+
225
+ ```bash
226
+ # Start all backend services (API, database, Redis, etc.)
227
+ make docker-up
228
+
229
+ {%- if cookiecutter.use_frontend %}
230
+ # Start frontend (separate command)
231
+ make docker-frontend
232
+ {%- endif %}
233
+ ```
234
+
235
+ ---
236
+
237
+ ### Using the Project CLI
238
+
239
+ Each generated project includes a CLI tool named `{{ cookiecutter.project_slug }}`. Run commands from the `backend/` directory:
240
+
241
+ ```bash
242
+ cd backend
243
+
244
+ # Server commands
245
+ uv run {{ cookiecutter.project_slug }} server run --reload # Start dev server
246
+ uv run {{ cookiecutter.project_slug }} server routes # Show all routes
247
+
248
+ {%- if cookiecutter.use_postgresql or cookiecutter.use_sqlite %}
249
+ # Database commands
250
+ uv run {{ cookiecutter.project_slug }} db migrate -m "message" # Create migration
251
+ uv run {{ cookiecutter.project_slug }} db upgrade # Apply migrations
252
+ uv run {{ cookiecutter.project_slug }} db downgrade # Rollback migration
253
+ {%- endif %}
254
+
255
+ {%- if cookiecutter.use_jwt %}
256
+ # User commands
257
+ uv run {{ cookiecutter.project_slug }} user create-admin # Create admin user
258
+ uv run {{ cookiecutter.project_slug }} user create # Create regular user
259
+ uv run {{ cookiecutter.project_slug }} user list # List all users
260
+ {%- endif %}
261
+ ```
262
+
263
+ Or use Makefile shortcuts from the project root:
264
+
265
+ ```bash
266
+ make help # Show all available commands
267
+ make run # Start dev server
268
+ {%- if cookiecutter.use_postgresql or cookiecutter.use_sqlite %}
269
+ make db-migrate # Create new migration
270
+ make db-upgrade # Apply migrations
271
+ {%- endif %}
272
+ {%- if cookiecutter.use_jwt %}
273
+ make create-admin # Create admin user
274
+ {%- endif %}
275
+ ```
276
+
277
+ **Access:**
278
+ - API: http://localhost:8000
279
+ - Docs: http://localhost:8000/docs
280
+ - Admin Panel: http://localhost:8000/admin
281
+ - Frontend: http://localhost:3000
282
+
283
+ ---
284
+
285
+ ## 📸 Screenshots
286
+
287
+ ### Chat Interface
288
+ | Light Mode | Dark Mode |
289
+ |:---:|:---:|
290
+ | ![Chat Light](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/new_chat_light.png) | ![Chat Dark](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/new_chat_dark.png) |
291
+
292
+ ### Authentication
293
+ | Register | Login |
294
+ |:---:|:---:|
295
+ | ![Register](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/new_register.png) | ![Login](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/new_login.png) |
296
+
297
+ ### Observability
298
+ | Logfire (PydanticAI) | LangSmith (LangChain) |
299
+ |:---:|:---:|
300
+ | ![Logfire](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/logfire.png) | ![LangSmith](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/langsmith.png) |
301
+
302
+ ### Admin, Monitoring & API
303
+ | Celery Flower | SQLAdmin Panel |
304
+ |:---:|:---:|
305
+ | ![Flower](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/flower.png) | ![Admin](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/admin.png) |
306
+
307
+ | API Documentation |
308
+ |:---:|
309
+ | ![API Docs](https://raw.githubusercontent.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/main/assets/docs_2.png) |
310
+
311
+ ---
312
+
313
+ ## 🏗️ Architecture
314
+
315
+ ```mermaid
316
+ graph TB
317
+ subgraph Frontend["Frontend (Next.js 15)"]
318
+ UI[React Components]
319
+ WS[WebSocket Client]
320
+ Store[Zustand Stores]
321
+ end
322
+
323
+ subgraph Backend["Backend (FastAPI)"]
324
+ API[API Routes]
325
+ Services[Services Layer]
326
+ Repos[Repositories]
327
+ Agent[AI Agent]
328
+ end
329
+
330
+ subgraph Infrastructure
331
+ DB[(PostgreSQL/MongoDB)]
332
+ Redis[(Redis)]
333
+ Queue[Celery/Taskiq]
334
+ end
335
+
336
+ subgraph External
337
+ LLM[OpenAI/Anthropic]
338
+ Webhook[Webhook Endpoints]
339
+ end
340
+
341
+ UI --> API
342
+ WS <--> Agent
343
+ API --> Services
344
+ Services --> Repos
345
+ Services --> Agent
346
+ Repos --> DB
347
+ Agent --> LLM
348
+ Services --> Redis
349
+ Services --> Queue
350
+ Services --> Webhook
351
+ ```
352
+
353
+ ### Layered Architecture
354
+
355
+ The backend follows a clean **Repository + Service** pattern:
356
+
357
+ ```mermaid
358
+ graph LR
359
+ A[API Routes] --> B[Services]
360
+ B --> C[Repositories]
361
+ C --> D[(Database)]
362
+
363
+ B --> E[External APIs]
364
+ B --> F[AI Agents]
365
+ ```
366
+
367
+ | Layer | Responsibility |
368
+ |-------|---------------|
369
+ | **Routes** | HTTP handling, validation, auth |
370
+ | **Services** | Business logic, orchestration |
371
+ | **Repositories** | Data access, queries |
372
+
373
+ See [Architecture Documentation](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/architecture.md) for details.
374
+
375
+ ---
376
+
377
+ ## 🤖 AI Agent
378
+
379
+ Choose between **PydanticAI** or **LangChain** when generating your project, with support for multiple LLM providers:
380
+
381
+ ```bash
382
+ # PydanticAI with OpenAI (default)
383
+ fastapi-fullstack create my_app --ai-agent --ai-framework pydantic_ai
384
+
385
+ # PydanticAI with Anthropic
386
+ fastapi-fullstack create my_app --ai-agent --ai-framework pydantic_ai --llm-provider anthropic
387
+
388
+ # PydanticAI with OpenRouter
389
+ fastapi-fullstack create my_app --ai-agent --ai-framework pydantic_ai --llm-provider openrouter
390
+
391
+ # LangChain with OpenAI
392
+ fastapi-fullstack create my_app --ai-agent --ai-framework langchain
393
+
394
+ # LangChain with Anthropic
395
+ fastapi-fullstack create my_app --ai-agent --ai-framework langchain --llm-provider anthropic
396
+ ```
397
+
398
+ ### Supported LLM Providers
399
+
400
+ | Framework | OpenAI | Anthropic | OpenRouter |
401
+ |-----------|:------:|:---------:|:----------:|
402
+ | **PydanticAI** | ✓ | ✓ | ✓ |
403
+ | **LangChain** | ✓ | ✓ | - |
404
+
405
+ ### PydanticAI Integration
406
+
407
+ Type-safe agents with full dependency injection:
408
+
409
+ ```python
410
+ # app/agents/assistant.py
411
+ from pydantic_ai import Agent, RunContext
412
+
413
+ @dataclass
414
+ class Deps:
415
+ user_id: str | None = None
416
+ db: AsyncSession | None = None
417
+
418
+ agent = Agent[Deps, str](
419
+ model="openai:gpt-4o-mini",
420
+ system_prompt="You are a helpful assistant.",
421
+ )
422
+
423
+ @agent.tool
424
+ async def search_database(ctx: RunContext[Deps], query: str) -> list[dict]:
425
+ """Search the database for relevant information."""
426
+ # Access user context and database via ctx.deps
427
+ ...
428
+ ```
429
+
430
+ ### LangChain Integration
431
+
432
+ Flexible agents with LangGraph:
433
+
434
+ ```python
435
+ # app/agents/langchain_assistant.py
436
+ from langchain.tools import tool
437
+ from langgraph.prebuilt import create_react_agent
438
+
439
+ @tool
440
+ def search_database(query: str) -> list[dict]:
441
+ """Search the database for relevant information."""
442
+ ...
443
+
444
+ agent = create_react_agent(
445
+ model=ChatOpenAI(model="gpt-4o-mini"),
446
+ tools=[search_database],
447
+ prompt="You are a helpful assistant.",
448
+ )
449
+ ```
450
+
451
+ ### WebSocket Streaming
452
+
453
+ Both frameworks use the same WebSocket endpoint with real-time streaming:
454
+
455
+ ```python
456
+ @router.websocket("/ws")
457
+ async def agent_ws(websocket: WebSocket):
458
+ await websocket.accept()
459
+
460
+ # Works with both PydanticAI and LangChain
461
+ async for event in agent.stream(user_input):
462
+ await websocket.send_json({
463
+ "type": "text_delta",
464
+ "content": event.content
465
+ })
466
+ ```
467
+
468
+ ### Observability
469
+
470
+ Each framework has its own observability solution:
471
+
472
+ | Framework | Observability | Dashboard |
473
+ |-----------|--------------|-----------|
474
+ | **PydanticAI** | [Logfire](https://logfire.pydantic.dev) | Agent runs, tool calls, token usage |
475
+ | **LangChain** | [LangSmith](https://smith.langchain.com) | Traces, feedback, datasets |
476
+
477
+ See [AI Agent Documentation](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/ai-agent.md) for more.
478
+
479
+ ---
480
+
481
+ ## 📊 Observability
482
+
483
+ ### Logfire (for PydanticAI)
484
+
485
+ [Logfire](https://logfire.pydantic.dev) provides complete observability for your application - from AI agents to database queries. Built by the Pydantic team, it offers first-class support for the entire Python ecosystem.
486
+
487
+ ```mermaid
488
+ graph LR
489
+ subgraph Your App
490
+ API[FastAPI]
491
+ Agent[PydanticAI]
492
+ DB[(Database)]
493
+ Cache[(Redis)]
494
+ Queue[Celery/Taskiq]
495
+ HTTP[HTTPX]
496
+ end
497
+
498
+ subgraph Logfire
499
+ Traces[Traces]
500
+ Metrics[Metrics]
501
+ Logs[Logs]
502
+ end
503
+
504
+ API --> Traces
505
+ Agent --> Traces
506
+ DB --> Traces
507
+ Cache --> Traces
508
+ Queue --> Traces
509
+ HTTP --> Traces
510
+ ```
511
+
512
+ | Component | What You See |
513
+ |-----------|-------------|
514
+ | **PydanticAI** | Agent runs, tool calls, LLM requests, token usage, streaming events |
515
+ | **FastAPI** | Request/response traces, latency, status codes, route performance |
516
+ | **PostgreSQL/MongoDB** | Query execution time, slow queries, connection pool stats |
517
+ | **Redis** | Cache hits/misses, command latency, key patterns |
518
+ | **Celery/Taskiq** | Task execution, queue depth, worker performance |
519
+ | **HTTPX** | External API calls, response times, error rates |
520
+
521
+ ### LangSmith (for LangChain)
522
+
523
+ [LangSmith](https://smith.langchain.com) provides observability specifically designed for LangChain applications:
524
+
525
+ | Feature | Description |
526
+ |---------|-------------|
527
+ | **Traces** | Full execution traces for agent runs and chains |
528
+ | **Feedback** | Collect user feedback on agent responses |
529
+ | **Datasets** | Build evaluation datasets from production data |
530
+ | **Monitoring** | Track latency, errors, and token usage |
531
+
532
+ LangSmith is automatically configured when you choose LangChain:
533
+
534
+ ```bash
535
+ # .env
536
+ LANGCHAIN_TRACING_V2=true
537
+ LANGCHAIN_API_KEY=your-api-key
538
+ LANGCHAIN_PROJECT=my_project
539
+ ```
540
+
541
+ ### Configuration
542
+
543
+ Enable Logfire and select which components to instrument:
544
+
545
+ ```bash
546
+ fastapi-fullstack new
547
+ # ✓ Enable Logfire observability
548
+ # ✓ Instrument FastAPI
549
+ # ✓ Instrument Database
550
+ # ✓ Instrument Redis
551
+ # ✓ Instrument Celery
552
+ # ✓ Instrument HTTPX
553
+ ```
554
+
555
+ ### Usage
556
+
557
+ ```python
558
+ # Automatic instrumentation in app/main.py
559
+ import logfire
560
+
561
+ logfire.configure()
562
+ logfire.instrument_fastapi(app)
563
+ logfire.instrument_asyncpg()
564
+ logfire.instrument_redis()
565
+ logfire.instrument_httpx()
566
+ ```
567
+
568
+ ```python
569
+ # Manual spans for custom logic
570
+ with logfire.span("process_order", order_id=order.id):
571
+ await validate_order(order)
572
+ await charge_payment(order)
573
+ await send_confirmation(order)
574
+ ```
575
+
576
+ For more details, see [Logfire Documentation](https://logfire.pydantic.dev/docs/integrations/).
577
+
578
+ ---
579
+
580
+ ## 🛠️ Django-style CLI
581
+
582
+ Each generated project includes a powerful CLI inspired by Django's management commands. The CLI name matches your project slug (e.g., if your project is `my_app`, the CLI command is `uv run my_app`).
583
+
584
+ ### Built-in Commands
585
+
586
+ ```bash
587
+ # Run commands from the backend directory:
588
+ cd backend
589
+
590
+ # Server
591
+ uv run {{ cookiecutter.project_slug }} server run --reload
592
+ uv run {{ cookiecutter.project_slug }} server routes
593
+
594
+ # Database (Alembic wrapper)
595
+ uv run {{ cookiecutter.project_slug }} db init
596
+ uv run {{ cookiecutter.project_slug }} db migrate -m "Add users"
597
+ uv run {{ cookiecutter.project_slug }} db upgrade
598
+
599
+ # Users
600
+ uv run {{ cookiecutter.project_slug }} user create-admin # Create admin (interactive)
601
+ uv run {{ cookiecutter.project_slug }} user create # Create user (interactive)
602
+ uv run {{ cookiecutter.project_slug }} user list # List all users
603
+ ```
604
+
605
+ > **Tip:** Use `make` commands as shortcuts - they handle the `uv run` prefix and directory automatically. Run `make help` to see all available commands.
606
+
607
+ ### Custom Commands
608
+
609
+ Create your own commands with auto-discovery:
610
+
611
+ ```python
612
+ # app/commands/seed.py
613
+ from app.commands import command, success, error
614
+ import click
615
+
616
+ @command("seed", help="Seed database with test data")
617
+ @click.option("--count", "-c", default=10, type=int)
618
+ @click.option("--dry-run", is_flag=True)
619
+ def seed_database(count: int, dry_run: bool):
620
+ """Seed the database with sample data."""
621
+ if dry_run:
622
+ info(f"[DRY RUN] Would create {count} records")
623
+ return
624
+
625
+ # Your logic here
626
+ success(f"Created {count} records!")
627
+ ```
628
+
629
+ Commands are **automatically discovered** from `app/commands/` - just create a file and use the `@command` decorator.
630
+
631
+ ```bash
632
+ uv run {{ cookiecutter.project_slug }} cmd seed --count 100
633
+ uv run {{ cookiecutter.project_slug }} cmd seed --dry-run
634
+ ```
635
+
636
+ ---
637
+
638
+ ## 📁 Generated Project Structure
639
+
640
+ ```
641
+ my_project/
642
+ ├── backend/
643
+ │ ├── app/
644
+ │ │ ├── main.py # FastAPI app with lifespan
645
+ │ │ ├── api/
646
+ │ │ │ ├── routes/v1/ # Versioned API endpoints
647
+ │ │ │ ├── deps.py # Dependency injection
648
+ │ │ │ └── router.py # Route aggregation
649
+ │ │ ├── core/ # Config, security, middleware
650
+ │ │ ├── db/models/ # SQLAlchemy/MongoDB models
651
+ │ │ ├── schemas/ # Pydantic schemas
652
+ │ │ ├── repositories/ # Data access layer
653
+ │ │ ├── services/ # Business logic
654
+ │ │ ├── agents/ # AI agents with centralized prompts
655
+ │ │ ├── commands/ # Django-style CLI commands
656
+ │ │ └── worker/ # Background tasks
657
+ │ ├── cli/ # Project CLI
658
+ │ ├── tests/ # pytest test suite
659
+ │ └── alembic/ # Database migrations
660
+ ├── frontend/
661
+ │ ├── src/
662
+ │ │ ├── app/ # Next.js App Router
663
+ │ │ ├── components/ # React components
664
+ │ │ ├── hooks/ # useChat, useWebSocket, etc.
665
+ │ │ └── stores/ # Zustand state management
666
+ │ └── e2e/ # Playwright tests
667
+ ├── docker-compose.yml
668
+ ├── Makefile
669
+ └── README.md
670
+ ```
671
+
672
+ Generated projects include version metadata in `pyproject.toml` for tracking:
673
+
674
+ ```toml
675
+ [tool.fastapi-fullstack]
676
+ generator_version = "0.1.5"
677
+ generated_at = "2024-12-21T10:30:00+00:00"
678
+ ```
679
+
680
+ ---
681
+
682
+ ## ⚙️ Configuration Options
683
+
684
+ ### Core Options
685
+
686
+ | Option | Values | Description |
687
+ |--------|--------|-------------|
688
+ | **Database** | `postgresql`, `mongodb`, `sqlite`, `none` | Async by default |
689
+ | **Auth** | `jwt`, `api_key`, `both`, `none` | JWT includes user management |
690
+ | **OAuth** | `none`, `google` | Social login |
691
+ | **AI Framework** | `pydantic_ai`, `langchain` | Choose your AI agent framework |
692
+ | **LLM Provider** | `openai`, `anthropic`, `openrouter` | OpenRouter only with PydanticAI |
693
+ | **Background Tasks** | `none`, `celery`, `taskiq`, `arq` | Distributed queues |
694
+ | **Frontend** | `none`, `nextjs` | Next.js 15 + React 19 |
695
+
696
+ ### Presets
697
+
698
+ | Preset | Description |
699
+ |--------|-------------|
700
+ | `--preset production` | Full production setup with Redis, Sentry, Kubernetes, Prometheus |
701
+ | `--preset ai-agent` | AI agent with WebSocket streaming and conversation persistence |
702
+ | `--minimal` | Minimal project with no extras |
703
+
704
+ ### Integrations
705
+
706
+ Select what you need:
707
+
708
+ ```bash
709
+ fastapi-fullstack new
710
+ # ✓ Redis (caching/sessions)
711
+ # ✓ Rate limiting (slowapi)
712
+ # ✓ Pagination (fastapi-pagination)
713
+ # ✓ Admin Panel (SQLAdmin)
714
+ # ✓ AI Agent (PydanticAI or LangChain)
715
+ # ✓ Webhooks
716
+ # ✓ Sentry
717
+ # ✓ Logfire / LangSmith
718
+ # ✓ Prometheus
719
+ # ... and more
720
+ ```
721
+
722
+ ---
723
+
724
+ ## 📚 Documentation
725
+
726
+ | Document | Description |
727
+ |----------|-------------|
728
+ | [Architecture](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/architecture.md) | Repository + Service pattern, layered design |
729
+ | [Frontend](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/frontend.md) | Next.js setup, auth, state management |
730
+ | [AI Agent](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/ai-agent.md) | PydanticAI, tools, WebSocket streaming |
731
+ | [Observability](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/observability.md) | Logfire integration, tracing, metrics |
732
+ | [Deployment](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/deployment.md) | Docker, Kubernetes, production setup |
733
+ | [Development](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/development.md) | Local setup, testing, debugging |
734
+
735
+ ---
736
+
737
+ ## Star History
738
+
739
+ [![Star History Chart](https://api.star-history.com/svg?repos=vstorm-co/full-stack-fastapi-nextjs-llm-template&type=date&legend=top-left)](https://www.star-history.com/#vstorm-co/full-stack-fastapi-nextjs-llm-template&type=date&legend=top-left)
740
+
741
+ ---
742
+
743
+ ## 🙏 Inspiration
744
+
745
+ This project is inspired by:
746
+
747
+ - [full-stack-fastapi-template](https://github.com/fastapi/full-stack-fastapi-template) by @tiangolo
748
+ - [fastapi-template](https://github.com/s3rius/fastapi-template) by @s3rius
749
+ - [FastAPI Best Practices](https://github.com/zhanymkanov/fastapi-best-practices) by @zhanymkanov
750
+ - Django's management commands system
751
+
752
+ ---
753
+
754
+ ## 🤝 Contributing
755
+
756
+ Contributions are welcome! Please read our [Contributing Guide](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/CONTRIBUTING.md) for details.
757
+
758
+ ---
759
+
760
+ ## 📄 License
761
+
762
+ MIT License - see [LICENSE](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/LICENSE) for details.
763
+
764
+ ---
765
+
766
+ <p align="center">
767
+ Made with ❤️ by <a href="https://github.com/vstorm-co">VStorm</a>
768
+ </p>