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,295 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import { Button } from "@/components/ui";
5
+ import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetClose } from "@/components/ui";
6
+ import { cn } from "@/lib/utils";
7
+ import { useLocalChatStore, useChatSidebarStore } from "@/stores";
8
+ import type { LocalConversation } from "@/stores/local-chat-store";
9
+ import {
10
+ MessageSquarePlus,
11
+ MessageSquare,
12
+ Trash2,
13
+ MoreVertical,
14
+ Pencil,
15
+ ChevronLeft,
16
+ ChevronRight,
17
+ PanelLeftClose,
18
+ PanelLeft,
19
+ } from "lucide-react";
20
+
21
+ interface LocalConversationItemProps {
22
+ conversation: LocalConversation;
23
+ isActive: boolean;
24
+ onSelect: () => void;
25
+ onDelete: () => void;
26
+ onRename: (title: string) => void;
27
+ }
28
+
29
+ function LocalConversationItem({
30
+ conversation,
31
+ isActive,
32
+ onSelect,
33
+ onDelete,
34
+ onRename,
35
+ }: LocalConversationItemProps) {
36
+ const [showMenu, setShowMenu] = useState(false);
37
+ const [isEditing, setIsEditing] = useState(false);
38
+ const [editTitle, setEditTitle] = useState(conversation.title || "");
39
+
40
+ const handleRename = () => {
41
+ if (editTitle.trim()) {
42
+ onRename(editTitle.trim());
43
+ }
44
+ setIsEditing(false);
45
+ };
46
+
47
+ const displayTitle =
48
+ conversation.title ||
49
+ `Chat ${new Date(conversation.createdAt).toLocaleDateString()}`;
50
+
51
+ return (
52
+ <div
53
+ className={cn(
54
+ "group relative flex items-center gap-2 rounded-lg px-3 py-3 text-sm transition-colors cursor-pointer min-h-[44px]",
55
+ isActive
56
+ ? "bg-secondary text-secondary-foreground"
57
+ : "text-muted-foreground hover:bg-secondary/50 hover:text-secondary-foreground"
58
+ )}
59
+ onClick={onSelect}
60
+ >
61
+ <MessageSquare className="h-4 w-4 shrink-0" />
62
+ {isEditing ? (
63
+ <input
64
+ type="text"
65
+ value={editTitle}
66
+ onChange={(e) => setEditTitle(e.target.value)}
67
+ onBlur={handleRename}
68
+ onKeyDown={(e) => {
69
+ if (e.key === "Enter") handleRename();
70
+ if (e.key === "Escape") setIsEditing(false);
71
+ }}
72
+ className="flex-1 bg-transparent outline-none text-foreground"
73
+ autoFocus
74
+ onClick={(e) => e.stopPropagation()}
75
+ />
76
+ ) : (
77
+ <span className="flex-1 truncate">{displayTitle}</span>
78
+ )}
79
+
80
+ <div className="relative">
81
+ <Button
82
+ variant="ghost"
83
+ size="sm"
84
+ className={cn(
85
+ "h-8 w-8 p-0 opacity-0 group-hover:opacity-100 touch:opacity-100",
86
+ showMenu && "opacity-100"
87
+ )}
88
+ onClick={(e) => {
89
+ e.stopPropagation();
90
+ setShowMenu(!showMenu);
91
+ }}
92
+ >
93
+ <MoreVertical className="h-4 w-4" />
94
+ </Button>
95
+
96
+ {showMenu && (
97
+ <>
98
+ <div
99
+ className="fixed inset-0 z-10"
100
+ onClick={() => setShowMenu(false)}
101
+ />
102
+ <div className="absolute right-0 top-8 z-20 w-40 rounded-md border bg-popover shadow-lg">
103
+ <button
104
+ className="flex w-full items-center gap-2 px-3 py-3 text-sm hover:bg-secondary min-h-[44px]"
105
+ onClick={(e) => {
106
+ e.stopPropagation();
107
+ setIsEditing(true);
108
+ setShowMenu(false);
109
+ }}
110
+ >
111
+ <Pencil className="h-4 w-4" />
112
+ Rename
113
+ </button>
114
+ <button
115
+ className="flex w-full items-center gap-2 px-3 py-3 text-sm text-destructive hover:bg-destructive/10 min-h-[44px]"
116
+ onClick={(e) => {
117
+ e.stopPropagation();
118
+ onDelete();
119
+ setShowMenu(false);
120
+ }}
121
+ >
122
+ <Trash2 className="h-4 w-4" />
123
+ Delete
124
+ </button>
125
+ </div>
126
+ </>
127
+ )}
128
+ </div>
129
+ </div>
130
+ );
131
+ }
132
+
133
+ function ConversationList({ onNavigate }: { onNavigate?: () => void }) {
134
+ const {
135
+ conversations,
136
+ currentConversationId,
137
+ selectConversation,
138
+ deleteConversation,
139
+ renameConversation,
140
+ createConversation,
141
+ } = useLocalChatStore();
142
+
143
+ const handleSelect = (id: string) => {
144
+ selectConversation(id);
145
+ onNavigate?.();
146
+ };
147
+
148
+ const handleNewChat = () => {
149
+ createConversation();
150
+ onNavigate?.();
151
+ };
152
+
153
+ return (
154
+ <>
155
+ <div className="p-3">
156
+ <Button
157
+ variant="outline"
158
+ size="sm"
159
+ className="w-full justify-start gap-2 h-10"
160
+ onClick={handleNewChat}
161
+ >
162
+ <MessageSquarePlus className="h-4 w-4" />
163
+ New Chat
164
+ </Button>
165
+ </div>
166
+
167
+ <div className="flex-1 overflow-y-auto px-3 pb-3 scrollbar-thin">
168
+ {conversations.length === 0 ? (
169
+ <div className="flex flex-col items-center justify-center py-8 text-center text-sm text-muted-foreground">
170
+ <MessageSquare className="h-8 w-8 mb-2 opacity-50" />
171
+ <p>No conversations yet</p>
172
+ <p className="text-xs mt-1">Start a new chat to begin</p>
173
+ </div>
174
+ ) : (
175
+ <div className="space-y-1">
176
+ {conversations.map((conversation) => (
177
+ <LocalConversationItem
178
+ key={conversation.id}
179
+ conversation={conversation}
180
+ isActive={conversation.id === currentConversationId}
181
+ onSelect={() => handleSelect(conversation.id)}
182
+ onDelete={() => deleteConversation(conversation.id)}
183
+ onRename={(title) => renameConversation(conversation.id, title)}
184
+ />
185
+ ))}
186
+ </div>
187
+ )}
188
+ </div>
189
+
190
+ <div className="border-t px-3 py-2">
191
+ <p className="text-xs text-muted-foreground text-center">
192
+ Stored in browser
193
+ </p>
194
+ </div>
195
+ </>
196
+ );
197
+ }
198
+
199
+ interface LocalConversationSidebarProps {
200
+ className?: string;
201
+ }
202
+
203
+ export function LocalConversationSidebar({
204
+ className,
205
+ }: LocalConversationSidebarProps) {
206
+ const [isCollapsed, setIsCollapsed] = useState(false);
207
+ const { isOpen, close } = useChatSidebarStore();
208
+
209
+ if (isCollapsed) {
210
+ return (
211
+ <div
212
+ className={cn(
213
+ "hidden md:flex flex-col items-center border-r bg-background py-4 w-12",
214
+ className
215
+ )}
216
+ >
217
+ <Button
218
+ variant="ghost"
219
+ size="sm"
220
+ className="h-10 w-10 p-0 mb-4"
221
+ onClick={() => setIsCollapsed(false)}
222
+ >
223
+ <ChevronRight className="h-4 w-4" />
224
+ </Button>
225
+ <Button
226
+ variant="ghost"
227
+ size="sm"
228
+ className="h-10 w-10 p-0"
229
+ onClick={() => {
230
+ useLocalChatStore.getState().createConversation();
231
+ }}
232
+ title="New Chat"
233
+ >
234
+ <MessageSquarePlus className="h-4 w-4" />
235
+ </Button>
236
+ </div>
237
+ );
238
+ }
239
+
240
+ return (
241
+ <>
242
+ <aside
243
+ className={cn(
244
+ "hidden md:flex w-64 shrink-0 flex-col border-r bg-background",
245
+ className
246
+ )}
247
+ >
248
+ <div className="flex items-center justify-between border-b px-4 py-3 h-12">
249
+ <h2 className="font-semibold text-sm">Local Chats</h2>
250
+ <Button
251
+ variant="ghost"
252
+ size="sm"
253
+ className="h-8 w-8 p-0"
254
+ onClick={() => setIsCollapsed(true)}
255
+ >
256
+ <ChevronLeft className="h-4 w-4" />
257
+ </Button>
258
+ </div>
259
+ <ConversationList />
260
+ </aside>
261
+
262
+ <Sheet open={isOpen} onOpenChange={close}>
263
+ <SheetContent side="left" className="w-80 p-0">
264
+ <SheetHeader className="h-12 px-4">
265
+ <SheetTitle>Local Chats</SheetTitle>
266
+ <SheetClose onClick={close} />
267
+ </SheetHeader>
268
+ <div className="flex flex-col h-[calc(100%-48px)]">
269
+ <ConversationList onNavigate={close} />
270
+ </div>
271
+ </SheetContent>
272
+ </Sheet>
273
+ </>
274
+ );
275
+ }
276
+
277
+ export function ChatSidebarToggle() {
278
+ const { toggle, isOpen } = useChatSidebarStore();
279
+
280
+ return (
281
+ <Button
282
+ variant="ghost"
283
+ size="sm"
284
+ className="h-10 w-10 p-0 md:hidden"
285
+ onClick={toggle}
286
+ >
287
+ {isOpen ? (
288
+ <PanelLeftClose className="h-5 w-5" />
289
+ ) : (
290
+ <PanelLeft className="h-5 w-5" />
291
+ )}
292
+ <span className="sr-only">Toggle chat list</span>
293
+ </Button>
294
+ );
295
+ }
@@ -0,0 +1,167 @@
1
+ "use client";
2
+
3
+ import ReactMarkdown from "react-markdown";
4
+ import remarkGfm from "remark-gfm";
5
+ import rehypeHighlight from "rehype-highlight";
6
+ import { CopyButton } from "./copy-button";
7
+
8
+ interface MarkdownContentProps {
9
+ content: string;
10
+ }
11
+
12
+ export function MarkdownContent({ content }: MarkdownContentProps) {
13
+ return (
14
+ <ReactMarkdown
15
+ remarkPlugins={[remarkGfm]}
16
+ rehypePlugins={[rehypeHighlight]}
17
+ components={% raw %}{{{% endraw %}
18
+ pre({ children, ...props }) {
19
+ const codeElement = children as React.ReactElement<{
20
+ children?: string;
21
+ }>;
22
+ const codeContent =
23
+ typeof codeElement?.props?.children === "string"
24
+ ? codeElement.props.children
25
+ : "";
26
+
27
+ return (
28
+ <div className="group relative">
29
+ <pre
30
+ className="overflow-x-auto rounded-lg bg-muted/50 p-3 text-xs"
31
+ {...props}
32
+ >
33
+ {children}
34
+ </pre>
35
+ {codeContent && (
36
+ <div className="absolute right-2 top-2">
37
+ <CopyButton text={codeContent} className="opacity-100" />
38
+ </div>
39
+ )}
40
+ </div>
41
+ );
42
+ },
43
+ code({ className, children, ...props }) {
44
+ const isInline = !className;
45
+ if (isInline) {
46
+ return (
47
+ <code
48
+ className="rounded bg-muted px-1.5 py-0.5 text-xs font-mono"
49
+ {...props}
50
+ >
51
+ {children}
52
+ </code>
53
+ );
54
+ }
55
+ return (
56
+ <code className={className} {...props}>
57
+ {children}
58
+ </code>
59
+ );
60
+ },
61
+ a({ href, children, ...props }) {
62
+ return (
63
+ <a
64
+ href={href}
65
+ target="_blank"
66
+ rel="noopener noreferrer"
67
+ className="text-primary underline hover:text-primary/80"
68
+ {...props}
69
+ >
70
+ {children}
71
+ </a>
72
+ );
73
+ },
74
+ p({ children, ...props }) {
75
+ return (
76
+ <p className="mb-2 last:mb-0" {...props}>
77
+ {children}
78
+ </p>
79
+ );
80
+ },
81
+ ul({ children, ...props }) {
82
+ return (
83
+ <ul className="mb-2 ml-4 list-disc last:mb-0" {...props}>
84
+ {children}
85
+ </ul>
86
+ );
87
+ },
88
+ ol({ children, ...props }) {
89
+ return (
90
+ <ol className="mb-2 ml-4 list-decimal last:mb-0" {...props}>
91
+ {children}
92
+ </ol>
93
+ );
94
+ },
95
+ li({ children, ...props }) {
96
+ return (
97
+ <li className="mb-1" {...props}>
98
+ {children}
99
+ </li>
100
+ );
101
+ },
102
+ h1({ children, ...props }) {
103
+ return (
104
+ <h1 className="mb-2 text-lg font-bold" {...props}>
105
+ {children}
106
+ </h1>
107
+ );
108
+ },
109
+ h2({ children, ...props }) {
110
+ return (
111
+ <h2 className="mb-2 text-base font-bold" {...props}>
112
+ {children}
113
+ </h2>
114
+ );
115
+ },
116
+ h3({ children, ...props }) {
117
+ return (
118
+ <h3 className="mb-2 text-sm font-bold" {...props}>
119
+ {children}
120
+ </h3>
121
+ );
122
+ },
123
+ blockquote({ children, ...props }) {
124
+ return (
125
+ <blockquote
126
+ className="mb-2 border-l-2 border-muted-foreground/50 pl-3 italic"
127
+ {...props}
128
+ >
129
+ {children}
130
+ </blockquote>
131
+ );
132
+ },
133
+ table({ children, ...props }) {
134
+ return (
135
+ <div className="mb-2 overflow-x-auto">
136
+ <table className="min-w-full text-sm" {...props}>
137
+ {children}
138
+ </table>
139
+ </div>
140
+ );
141
+ },
142
+ th({ children, ...props }) {
143
+ return (
144
+ <th
145
+ className="border-b border-muted px-2 py-1 text-left font-semibold"
146
+ {...props}
147
+ >
148
+ {children}
149
+ </th>
150
+ );
151
+ },
152
+ td({ children, ...props }) {
153
+ return (
154
+ <td className="border-b border-muted/50 px-2 py-1" {...props}>
155
+ {children}
156
+ </td>
157
+ );
158
+ },
159
+ hr({ ...props }) {
160
+ return <hr className="my-3 border-muted" {...props} />;
161
+ },
162
+ {% raw %}}}{% endraw %}
163
+ >
164
+ {content}
165
+ </ReactMarkdown>
166
+ );
167
+ }
@@ -0,0 +1,79 @@
1
+ "use client";
2
+
3
+ import { cn } from "@/lib/utils";
4
+ import type { ChatMessage } from "@/types";
5
+ import { ToolCallCard } from "./tool-call-card";
6
+ import { MarkdownContent } from "./markdown-content";
7
+ import { CopyButton } from "./copy-button";
8
+ import { User, Bot } from "lucide-react";
9
+
10
+ interface MessageItemProps {
11
+ message: ChatMessage;
12
+ }
13
+
14
+ export function MessageItem({ message }: MessageItemProps) {
15
+ const isUser = message.role === "user";
16
+
17
+ return (
18
+ <div
19
+ className={cn(
20
+ "group flex gap-2 sm:gap-4 py-3 sm:py-4",
21
+ isUser && "flex-row-reverse"
22
+ )}
23
+ >
24
+ <div
25
+ className={cn(
26
+ "flex-shrink-0 w-8 h-8 sm:w-9 sm:h-9 rounded-full flex items-center justify-center",
27
+ isUser ? "bg-primary text-primary-foreground" : "bg-orange-500/10 text-orange-500"
28
+ )}
29
+ >
30
+ {isUser ? <User className="h-4 w-4" /> : <Bot className="h-4 w-4 sm:h-5 sm:w-5" />}
31
+ </div>
32
+
33
+ <div className={cn(
34
+ "flex-1 space-y-2 overflow-hidden max-w-[88%] sm:max-w-[85%]",
35
+ isUser && "flex flex-col items-end"
36
+ )}>
37
+ {/* Only show message bubble if there's content or if it's streaming without tool calls */}
38
+ {(message.content || (message.isStreaming && (!message.toolCalls || message.toolCalls.length === 0))) && (
39
+ <div className={cn(
40
+ "relative rounded-2xl px-3 py-2 sm:px-4 sm:py-2.5",
41
+ isUser
42
+ ? "bg-primary text-primary-foreground rounded-tr-sm"
43
+ : "bg-muted rounded-tl-sm"
44
+ )}>
45
+ {isUser ? (
46
+ <p className="whitespace-pre-wrap break-words text-sm">
47
+ {message.content}
48
+ </p>
49
+ ) : (
50
+ <div className="text-sm prose-sm max-w-none">
51
+ <MarkdownContent content={message.content} />
52
+ {message.isStreaming && (
53
+ <span className="inline-block w-1.5 h-4 ml-1 bg-current animate-pulse rounded-full" />
54
+ )}
55
+ </div>
56
+ )}
57
+
58
+ {!isUser && message.content && !message.isStreaming && (
59
+ <div className="absolute -right-1 -top-1 sm:opacity-0 sm:group-hover:opacity-100">
60
+ <CopyButton
61
+ text={message.content}
62
+ className="bg-background/80 hover:bg-background shadow-sm"
63
+ />
64
+ </div>
65
+ )}
66
+ </div>
67
+ )}
68
+
69
+ {message.toolCalls && message.toolCalls.length > 0 && (
70
+ <div className="space-y-2 w-full">
71
+ {message.toolCalls.map((toolCall) => (
72
+ <ToolCallCard key={toolCall.id} toolCall={toolCall} />
73
+ ))}
74
+ </div>
75
+ )}
76
+ </div>
77
+ </div>
78
+ );
79
+ }
@@ -0,0 +1,18 @@
1
+ "use client";
2
+
3
+ import type { ChatMessage } from "@/types";
4
+ import { MessageItem } from "./message-item";
5
+
6
+ interface MessageListProps {
7
+ messages: ChatMessage[];
8
+ }
9
+
10
+ export function MessageList({ messages }: MessageListProps) {
11
+ return (
12
+ <div className="space-y-4">
13
+ {messages.map((message) => (
14
+ <MessageItem key={message.id} message={message} />
15
+ ))}
16
+ </div>
17
+ );
18
+ }
@@ -0,0 +1,79 @@
1
+ "use client";
2
+
3
+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui";
4
+ import type { ToolCall } from "@/types";
5
+ import { Wrench, CheckCircle, Loader2, AlertCircle } from "lucide-react";
6
+ import { cn } from "@/lib/utils";
7
+ import { CopyButton } from "./copy-button";
8
+
9
+ interface ToolCallCardProps {
10
+ toolCall: ToolCall;
11
+ }
12
+
13
+ export function ToolCallCard({ toolCall }: ToolCallCardProps) {
14
+ const statusConfig = {
15
+ pending: { icon: Loader2, color: "text-muted-foreground", animate: true },
16
+ running: { icon: Loader2, color: "text-blue-500", animate: true },
17
+ completed: { icon: CheckCircle, color: "text-green-500", animate: false },
18
+ error: { icon: AlertCircle, color: "text-red-500", animate: false },
19
+ };
20
+
21
+ const { icon: StatusIcon, color, animate } = statusConfig[toolCall.status];
22
+
23
+ const argsText = JSON.stringify(toolCall.args, null, 2);
24
+ const resultText =
25
+ toolCall.result !== undefined
26
+ ? typeof toolCall.result === "string"
27
+ ? toolCall.result
28
+ : JSON.stringify(toolCall.result, null, 2)
29
+ : "";
30
+
31
+ return (
32
+ <Card className="bg-muted/50">
33
+ <CardHeader className="py-2 px-3">
34
+ <div className="flex items-center justify-between">
35
+ <div className="flex items-center gap-2">
36
+ <Wrench className="h-4 w-4 text-muted-foreground" />
37
+ <CardTitle className="text-sm font-medium">
38
+ {toolCall.name}
39
+ </CardTitle>
40
+ </div>
41
+ <StatusIcon
42
+ className={cn("h-4 w-4", color, animate && "animate-spin")}
43
+ />
44
+ </div>
45
+ </CardHeader>
46
+ <CardContent className="py-2 px-3 space-y-2">
47
+ {/* Arguments */}
48
+ <div className="group relative">
49
+ <div className="flex items-center justify-between mb-1">
50
+ <p className="text-xs text-muted-foreground">Arguments:</p>
51
+ <CopyButton
52
+ text={argsText}
53
+ className="opacity-0 group-hover:opacity-100"
54
+ />
55
+ </div>
56
+ <pre className="text-xs bg-background p-2 rounded overflow-x-auto">
57
+ {argsText}
58
+ </pre>
59
+ </div>
60
+
61
+ {/* Result */}
62
+ {toolCall.result !== undefined && (
63
+ <div className="group relative">
64
+ <div className="flex items-center justify-between mb-1">
65
+ <p className="text-xs text-muted-foreground">Result:</p>
66
+ <CopyButton
67
+ text={resultText}
68
+ className="opacity-0 group-hover:opacity-100"
69
+ />
70
+ </div>
71
+ <pre className="text-xs bg-background p-2 rounded overflow-x-auto max-h-48 overflow-y-auto">
72
+ {resultText}
73
+ </pre>
74
+ </div>
75
+ )}
76
+ </CardContent>
77
+ </Card>
78
+ );
79
+ }
@@ -0,0 +1,32 @@
1
+ {%- if cookiecutter.enable_oauth_google %}
2
+ import { SVGProps } from "react";
3
+
4
+ export function GoogleIcon(props: SVGProps<SVGSVGElement>) {
5
+ return (
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 24 24"
9
+ {...props}
10
+ >
11
+ <path
12
+ fill="#4285F4"
13
+ d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
14
+ />
15
+ <path
16
+ fill="#34A853"
17
+ d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
18
+ />
19
+ <path
20
+ fill="#FBBC05"
21
+ d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
22
+ />
23
+ <path
24
+ fill="#EA4335"
25
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
26
+ />
27
+ </svg>
28
+ );
29
+ }
30
+ {%- else %}
31
+ // Google icon component - OAuth not enabled
32
+ {%- endif %}
@@ -0,0 +1,3 @@
1
+ {%- if cookiecutter.enable_oauth_google %}
2
+ export { GoogleIcon } from "./google-icon";
3
+ {%- endif %}