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.
- fastapi_fullstack-0.1.7.dist-info/METADATA +739 -0
- fastapi_fullstack-0.1.7.dist-info/RECORD +241 -0
- fastapi_fullstack-0.1.7.dist-info/WHEEL +4 -0
- fastapi_fullstack-0.1.7.dist-info/entry_points.txt +2 -0
- fastapi_fullstack-0.1.7.dist-info/licenses/LICENSE +21 -0
- fastapi_gen/__init__.py +3 -0
- fastapi_gen/cli.py +442 -0
- fastapi_gen/config.py +356 -0
- fastapi_gen/generator.py +207 -0
- fastapi_gen/prompts.py +874 -0
- fastapi_gen/template/VARIABLES.md +276 -0
- fastapi_gen/template/cookiecutter.json +93 -0
- fastapi_gen/template/hooks/post_gen_project.py +355 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/.env.prod.example +56 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +150 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/.gitignore +109 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/AGENTS.md +55 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/CLAUDE.md +99 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/Makefile +315 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/README.md +768 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/.dockerignore +60 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/.env.example +155 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/.pre-commit-config.yaml +32 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/Dockerfile +56 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic/env.py +76 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic/script.py.mako +30 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic/versions/.gitkeep +0 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic.ini +48 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/__init__.py +3 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/admin.py +447 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/__init__.py +23 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/assistant.py +226 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/langchain_assistant.py +226 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/prompts.py +10 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/tools/__init__.py +13 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/tools/datetime_tool.py +17 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/__init__.py +1 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/deps.py +541 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/exception_handlers.py +98 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/router.py +10 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/__init__.py +9 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/__init__.py +87 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/agent.py +902 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/auth.py +395 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/conversations.py +498 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/health.py +227 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/items.py +275 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/oauth.py +205 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/sessions.py +168 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/users.py +333 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/webhooks.py +477 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/ws.py +46 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/versioning.py +221 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/clients/__init__.py +14 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/clients/redis.py +88 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/__init__.py +117 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/cleanup.py +75 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/example.py +28 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/seed.py +266 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/__init__.py +5 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/cache.py +23 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/config.py +267 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/csrf.py +153 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/exceptions.py +122 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/logfire_setup.py +101 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/middleware.py +99 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/oauth.py +23 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/rate_limit.py +58 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/sanitize.py +271 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/security.py +102 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/__init__.py +7 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/base.py +41 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/__init__.py +31 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/conversation.py +319 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/item.py +96 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/session.py +126 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/user.py +218 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/webhook.py +244 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/session.py +130 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/main.py +334 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/pipelines/__init__.py +9 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/pipelines/base.py +73 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/__init__.py +49 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/base.py +154 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/conversation.py +838 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/item.py +222 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/session.py +318 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/user.py +322 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/webhook.py +358 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/__init__.py +50 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/base.py +57 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/conversation.py +192 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/item.py +52 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/session.py +42 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/token.py +31 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/user.py +64 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/schemas/webhook.py +89 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/__init__.py +38 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/conversation.py +850 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/item.py +246 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/session.py +333 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/user.py +432 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/webhook.py +561 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/__init__.py +5 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/celery_app.py +64 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/taskiq_app.py +38 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/__init__.py +25 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/examples.py +106 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/schedules.py +29 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/taskiq_examples.py +92 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/cli/__init__.py +1 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/cli/commands.py +438 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/pyproject.toml +180 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/scripts/.gitkeep +0 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/__init__.py +1 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/__init__.py +1 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_auth.py +242 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_exceptions.py +151 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_health.py +113 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_items.py +310 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_users.py +253 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/conftest.py +151 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_admin.py +890 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_agents.py +261 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_clients.py +183 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_commands.py +173 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_core.py +143 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_pipelines.py +118 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_repositories.py +181 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_security.py +124 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_services.py +363 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_worker.py +85 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.dev.yml +242 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.frontend.yml +31 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.prod.yml +435 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.yml +241 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docs/adding_features.md +132 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docs/architecture.md +63 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docs/patterns.md +161 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docs/testing.md +120 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.dockerignore +40 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.env.example +12 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.gitignore +45 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.prettierignore +19 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.prettierrc +11 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/Dockerfile +44 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/README.md +648 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/e2e/auth.setup.ts +49 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/e2e/auth.spec.ts +134 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/e2e/chat.spec.ts +207 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/e2e/home.spec.ts +73 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/instrumentation.ts +14 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/messages/en.json +84 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/messages/pl.json +84 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/next.config.ts +76 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/package.json +69 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/playwright.config.ts +101 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/postcss.config.mjs +7 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(auth)/layout.tsx +11 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(auth)/login/page.tsx +5 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(auth)/register/page.tsx +5 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(dashboard)/chat/page.tsx +48 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(dashboard)/dashboard/page.tsx +99 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(dashboard)/layout.tsx +17 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/(dashboard)/profile/page.tsx +152 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/auth/callback/page.tsx +113 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/layout.tsx +46 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/[locale]/page.tsx +73 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/login/route.ts +58 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/logout/route.ts +24 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/me/route.ts +39 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/oauth-callback/route.ts +50 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/refresh/route.ts +54 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/auth/register/route.ts +26 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/conversations/[id]/messages/route.ts +41 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/conversations/[id]/route.ts +108 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/conversations/route.ts +73 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/api/health/route.ts +21 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/globals.css +323 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/layout.tsx +22 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/providers.tsx +29 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/auth/index.ts +2 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/auth/login-form.tsx +120 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/auth/register-form.tsx +153 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/chat-container.tsx +234 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/chat-input.tsx +72 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/conversation-sidebar.tsx +328 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/copy-button.tsx +46 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/index.ts +11 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/local-conversation-sidebar.tsx +295 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/markdown-content.tsx +167 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/message-item.tsx +79 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/message-list.tsx +18 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/tool-call-card.tsx +79 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/icons/google-icon.tsx +32 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/icons/index.ts +3 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/language-switcher.tsx +97 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/layout/header.tsx +65 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/layout/index.ts +2 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/layout/sidebar.tsx +82 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/theme/index.ts +7 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/theme/theme-provider.tsx +53 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/theme/theme-toggle.tsx +105 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/badge.tsx +35 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/button.test.tsx +75 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/button.tsx +56 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/card.tsx +82 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/index.ts +13 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/input.tsx +21 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/label.tsx +21 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/ui/sheet.tsx +109 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/index.ts +7 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-auth.ts +97 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-chat.ts +203 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-conversations.ts +181 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-local-chat.ts +165 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-websocket.ts +105 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/i18n.ts +37 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/api-client.ts +90 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/constants.ts +39 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/server-api.ts +78 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/utils.test.ts +44 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/utils.ts +44 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/middleware.ts +31 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/auth-store.test.ts +72 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/auth-store.ts +64 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/chat-sidebar-store.ts +17 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/chat-store.ts +65 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/conversation-store.ts +76 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/index.ts +9 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/local-chat-store.ts +255 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/sidebar-store.ts +17 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/stores/theme-store.ts +44 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/api.ts +27 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/auth.ts +52 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/chat.ts +83 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/conversation.ts +49 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/index.ts +10 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/tsconfig.json +28 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/vitest.config.ts +36 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/vitest.setup.ts +56 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_docker and cookiecutter.use_frontend %}
|
|
2
|
+
# Frontend development configuration
|
|
3
|
+
# Usage: docker-compose -f docker-compose.frontend.yml up -d
|
|
4
|
+
#
|
|
5
|
+
# Note: Backend must be running first (docker-compose up -d)
|
|
6
|
+
# Frontend connects to backend via host network
|
|
7
|
+
|
|
8
|
+
services:
|
|
9
|
+
frontend:
|
|
10
|
+
build:
|
|
11
|
+
context: ./frontend
|
|
12
|
+
dockerfile: Dockerfile
|
|
13
|
+
container_name: {{ cookiecutter.project_slug }}_frontend
|
|
14
|
+
ports:
|
|
15
|
+
- "{{ cookiecutter.frontend_port }}:{{ cookiecutter.frontend_port }}"
|
|
16
|
+
environment:
|
|
17
|
+
- NODE_ENV=development
|
|
18
|
+
- BACKEND_URL=http://host.docker.internal:{{ cookiecutter.backend_port }}
|
|
19
|
+
- BACKEND_WS_URL=ws://host.docker.internal:{{ cookiecutter.backend_port }}
|
|
20
|
+
extra_hosts:
|
|
21
|
+
- "host.docker.internal:host-gateway"
|
|
22
|
+
restart: unless-stopped
|
|
23
|
+
healthcheck:
|
|
24
|
+
test: ["CMD", "curl", "-f", "http://localhost:{{ cookiecutter.frontend_port }}/api/health"]
|
|
25
|
+
interval: 30s
|
|
26
|
+
timeout: 10s
|
|
27
|
+
start_period: 40s
|
|
28
|
+
retries: 3
|
|
29
|
+
{%- else %}
|
|
30
|
+
# Frontend is disabled for this project
|
|
31
|
+
{%- endif %}
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_docker %}
|
|
2
|
+
# Production configuration
|
|
3
|
+
{%- if cookiecutter.include_traefik_service %}
|
|
4
|
+
# with Traefik reverse proxy
|
|
5
|
+
{%- elif cookiecutter.include_traefik_labels %}
|
|
6
|
+
# with external Traefik (connect to traefik-public network)
|
|
7
|
+
{%- else %}
|
|
8
|
+
# without reverse proxy (ports exposed directly)
|
|
9
|
+
{%- endif %}
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# 1. Copy .env.prod.example to .env.prod and fill in values:
|
|
13
|
+
# cp .env.prod.example .env.prod
|
|
14
|
+
# 2. Run: docker-compose -f docker-compose.prod.yml up -d
|
|
15
|
+
{%- if cookiecutter.include_traefik_service %}
|
|
16
|
+
#
|
|
17
|
+
# Prerequisites:
|
|
18
|
+
# 1. Configure .env.prod with DOMAIN and ACME_EMAIL
|
|
19
|
+
# 2. Ensure ports 80 and 443 are available
|
|
20
|
+
# 3. Generate passwords: openssl rand -base64 32
|
|
21
|
+
{%- elif cookiecutter.include_traefik_labels %}
|
|
22
|
+
#
|
|
23
|
+
# Prerequisites:
|
|
24
|
+
# 1. Create external traefik-public network: docker network create traefik-public
|
|
25
|
+
# 2. Run your Traefik instance connected to traefik-public network
|
|
26
|
+
# 3. Configure .env.prod with DOMAIN
|
|
27
|
+
{%- endif %}
|
|
28
|
+
|
|
29
|
+
services:
|
|
30
|
+
{%- if cookiecutter.include_traefik_service %}
|
|
31
|
+
traefik:
|
|
32
|
+
image: traefik:v3.2
|
|
33
|
+
container_name: {{ cookiecutter.project_slug }}_traefik
|
|
34
|
+
command:
|
|
35
|
+
- "--api.dashboard=true"
|
|
36
|
+
- "--providers.docker=true"
|
|
37
|
+
- "--providers.docker.exposedbydefault=false"
|
|
38
|
+
- "--providers.docker.network=traefik-public"
|
|
39
|
+
- "--entrypoints.web.address=:80"
|
|
40
|
+
- "--entrypoints.websecure.address=:443"
|
|
41
|
+
# Redirect HTTP to HTTPS
|
|
42
|
+
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
|
|
43
|
+
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
|
|
44
|
+
# Let's Encrypt
|
|
45
|
+
- "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
|
|
46
|
+
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
|
|
47
|
+
- "--certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL:-admin@example.com}"
|
|
48
|
+
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
|
|
49
|
+
# Access logs
|
|
50
|
+
- "--accesslog=true"
|
|
51
|
+
- "--accesslog.bufferingsize=100"
|
|
52
|
+
ports:
|
|
53
|
+
- "80:80"
|
|
54
|
+
- "443:443"
|
|
55
|
+
volumes:
|
|
56
|
+
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
57
|
+
- traefik_letsencrypt:/letsencrypt
|
|
58
|
+
networks:
|
|
59
|
+
- traefik-public
|
|
60
|
+
labels:
|
|
61
|
+
# Dashboard
|
|
62
|
+
- "traefik.enable=true"
|
|
63
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-traefik.rule=Host(`traefik.${DOMAIN:-localhost}`)"
|
|
64
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-traefik.entrypoints=websecure"
|
|
65
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-traefik.tls.certresolver=letsencrypt"
|
|
66
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-traefik.service=api@internal"
|
|
67
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-traefik.middlewares={{ cookiecutter.project_slug }}-auth"
|
|
68
|
+
- "traefik.http.middlewares.{{ cookiecutter.project_slug }}-auth.basicauth.users=${TRAEFIK_DASHBOARD_AUTH:-admin:$$apr1$$xyz$$hash}"
|
|
69
|
+
# Security headers middleware
|
|
70
|
+
- "traefik.http.middlewares.{{ cookiecutter.project_slug }}-security-headers.headers.stsSeconds=31536000"
|
|
71
|
+
- "traefik.http.middlewares.{{ cookiecutter.project_slug }}-security-headers.headers.stsIncludeSubdomains=true"
|
|
72
|
+
- "traefik.http.middlewares.{{ cookiecutter.project_slug }}-security-headers.headers.stsPreload=true"
|
|
73
|
+
- "traefik.http.middlewares.{{ cookiecutter.project_slug }}-security-headers.headers.contentTypeNosniff=true"
|
|
74
|
+
- "traefik.http.middlewares.{{ cookiecutter.project_slug }}-security-headers.headers.browserXssFilter=true"
|
|
75
|
+
- "traefik.http.middlewares.{{ cookiecutter.project_slug }}-security-headers.headers.referrerPolicy=strict-origin-when-cross-origin"
|
|
76
|
+
- "traefik.http.middlewares.{{ cookiecutter.project_slug }}-security-headers.headers.frameDeny=true"
|
|
77
|
+
restart: unless-stopped
|
|
78
|
+
deploy:
|
|
79
|
+
resources:
|
|
80
|
+
limits:
|
|
81
|
+
cpus: '0.5'
|
|
82
|
+
memory: 256M
|
|
83
|
+
{%- endif %}
|
|
84
|
+
|
|
85
|
+
app:
|
|
86
|
+
build:
|
|
87
|
+
context: ./backend
|
|
88
|
+
dockerfile: Dockerfile
|
|
89
|
+
container_name: {{ cookiecutter.project_slug }}_backend
|
|
90
|
+
env_file:
|
|
91
|
+
- .env.prod
|
|
92
|
+
- ./backend/.env
|
|
93
|
+
environment:
|
|
94
|
+
- DEBUG=false
|
|
95
|
+
- ENVIRONMENT=production
|
|
96
|
+
{%- if cookiecutter.use_postgresql %}
|
|
97
|
+
- POSTGRES_HOST=db
|
|
98
|
+
{%- endif %}
|
|
99
|
+
{%- if cookiecutter.enable_redis %}
|
|
100
|
+
- REDIS_HOST=redis
|
|
101
|
+
{%- endif %}
|
|
102
|
+
{%- if cookiecutter.use_celery %}
|
|
103
|
+
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
104
|
+
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
105
|
+
{%- endif %}
|
|
106
|
+
{%- if cookiecutter.use_taskiq %}
|
|
107
|
+
- TASKIQ_BROKER_URL=redis://redis:6379/1
|
|
108
|
+
- TASKIQ_RESULT_BACKEND=redis://redis:6379/1
|
|
109
|
+
{%- endif %}
|
|
110
|
+
command: uvicorn app.main:app --host 0.0.0.0 --port {{ cookiecutter.backend_port }} --workers 4
|
|
111
|
+
{%- if cookiecutter.include_traefik_labels %}
|
|
112
|
+
networks:
|
|
113
|
+
- traefik-public
|
|
114
|
+
- backend-internal
|
|
115
|
+
labels:
|
|
116
|
+
- "traefik.enable=true"
|
|
117
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-api.rule=Host(`api.${DOMAIN:-localhost}`)"
|
|
118
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-api.entrypoints=websecure"
|
|
119
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-api.tls.certresolver=letsencrypt"
|
|
120
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-api.middlewares={{ cookiecutter.project_slug }}-security-headers@docker"
|
|
121
|
+
- "traefik.http.services.{{ cookiecutter.project_slug }}-api.loadbalancer.server.port={{ cookiecutter.backend_port }}"
|
|
122
|
+
- "traefik.docker.network=traefik-public"
|
|
123
|
+
{%- else %}
|
|
124
|
+
networks:
|
|
125
|
+
- backend-internal
|
|
126
|
+
ports:
|
|
127
|
+
- "{{ cookiecutter.backend_port }}:{{ cookiecutter.backend_port }}"
|
|
128
|
+
{%- endif %}
|
|
129
|
+
{%- if cookiecutter.use_postgresql or cookiecutter.enable_redis %}
|
|
130
|
+
depends_on:
|
|
131
|
+
{%- if cookiecutter.use_postgresql %}
|
|
132
|
+
db:
|
|
133
|
+
condition: service_healthy
|
|
134
|
+
{%- endif %}
|
|
135
|
+
{%- if cookiecutter.enable_redis %}
|
|
136
|
+
redis:
|
|
137
|
+
condition: service_healthy
|
|
138
|
+
{%- endif %}
|
|
139
|
+
{%- endif %}
|
|
140
|
+
restart: unless-stopped
|
|
141
|
+
deploy:
|
|
142
|
+
resources:
|
|
143
|
+
limits:
|
|
144
|
+
cpus: '1'
|
|
145
|
+
memory: 512M
|
|
146
|
+
reservations:
|
|
147
|
+
cpus: '0.5'
|
|
148
|
+
memory: 256M
|
|
149
|
+
|
|
150
|
+
{%- if cookiecutter.use_postgresql %}
|
|
151
|
+
|
|
152
|
+
db:
|
|
153
|
+
image: postgres:16-alpine
|
|
154
|
+
container_name: {{ cookiecutter.project_slug }}_db
|
|
155
|
+
environment:
|
|
156
|
+
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
|
157
|
+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
158
|
+
- POSTGRES_DB=${POSTGRES_DB:-{{ cookiecutter.project_slug }}}
|
|
159
|
+
volumes:
|
|
160
|
+
- postgres_data:/var/lib/postgresql/data
|
|
161
|
+
# NO external ports - only accessible within backend-internal network
|
|
162
|
+
networks:
|
|
163
|
+
- backend-internal
|
|
164
|
+
healthcheck:
|
|
165
|
+
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
166
|
+
interval: 10s
|
|
167
|
+
timeout: 5s
|
|
168
|
+
retries: 5
|
|
169
|
+
restart: unless-stopped
|
|
170
|
+
deploy:
|
|
171
|
+
resources:
|
|
172
|
+
limits:
|
|
173
|
+
cpus: '1'
|
|
174
|
+
memory: 512M
|
|
175
|
+
{%- endif %}
|
|
176
|
+
|
|
177
|
+
{%- if cookiecutter.enable_redis %}
|
|
178
|
+
|
|
179
|
+
redis:
|
|
180
|
+
image: redis:7-alpine
|
|
181
|
+
container_name: {{ cookiecutter.project_slug }}_redis
|
|
182
|
+
command: redis-server --requirepass ${REDIS_PASSWORD:?REDIS_PASSWORD is required}
|
|
183
|
+
# NO external ports - only accessible within backend-internal network
|
|
184
|
+
volumes:
|
|
185
|
+
- redis_data:/data
|
|
186
|
+
networks:
|
|
187
|
+
- backend-internal
|
|
188
|
+
healthcheck:
|
|
189
|
+
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
|
|
190
|
+
interval: 10s
|
|
191
|
+
timeout: 5s
|
|
192
|
+
retries: 5
|
|
193
|
+
restart: unless-stopped
|
|
194
|
+
deploy:
|
|
195
|
+
resources:
|
|
196
|
+
limits:
|
|
197
|
+
cpus: '0.5'
|
|
198
|
+
memory: 256M
|
|
199
|
+
{%- endif %}
|
|
200
|
+
|
|
201
|
+
{%- if cookiecutter.use_celery %}
|
|
202
|
+
|
|
203
|
+
celery_worker:
|
|
204
|
+
build:
|
|
205
|
+
context: ./backend
|
|
206
|
+
dockerfile: Dockerfile
|
|
207
|
+
container_name: {{ cookiecutter.project_slug }}_celery_worker
|
|
208
|
+
command: celery -A app.worker.celery_app worker --loglevel=warning --concurrency=4
|
|
209
|
+
env_file:
|
|
210
|
+
- .env.prod
|
|
211
|
+
- ./backend/.env
|
|
212
|
+
environment:
|
|
213
|
+
- DEBUG=false
|
|
214
|
+
{%- if cookiecutter.use_postgresql %}
|
|
215
|
+
- POSTGRES_HOST=db
|
|
216
|
+
{%- endif %}
|
|
217
|
+
- REDIS_HOST=redis
|
|
218
|
+
- CELERY_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/0
|
|
219
|
+
- CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/0
|
|
220
|
+
networks:
|
|
221
|
+
- backend-internal
|
|
222
|
+
depends_on:
|
|
223
|
+
redis:
|
|
224
|
+
condition: service_healthy
|
|
225
|
+
{%- if cookiecutter.use_postgresql %}
|
|
226
|
+
db:
|
|
227
|
+
condition: service_healthy
|
|
228
|
+
{%- endif %}
|
|
229
|
+
restart: unless-stopped
|
|
230
|
+
deploy:
|
|
231
|
+
replicas: 2
|
|
232
|
+
resources:
|
|
233
|
+
limits:
|
|
234
|
+
cpus: '0.5'
|
|
235
|
+
memory: 512M
|
|
236
|
+
reservations:
|
|
237
|
+
cpus: '0.25'
|
|
238
|
+
memory: 256M
|
|
239
|
+
|
|
240
|
+
celery_beat:
|
|
241
|
+
build:
|
|
242
|
+
context: ./backend
|
|
243
|
+
dockerfile: Dockerfile
|
|
244
|
+
container_name: {{ cookiecutter.project_slug }}_celery_beat
|
|
245
|
+
command: celery -A app.worker.celery_app beat --loglevel=warning
|
|
246
|
+
env_file:
|
|
247
|
+
- .env.prod
|
|
248
|
+
- ./backend/.env
|
|
249
|
+
environment:
|
|
250
|
+
- DEBUG=false
|
|
251
|
+
- REDIS_HOST=redis
|
|
252
|
+
- CELERY_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/0
|
|
253
|
+
- CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/0
|
|
254
|
+
networks:
|
|
255
|
+
- backend-internal
|
|
256
|
+
depends_on:
|
|
257
|
+
redis:
|
|
258
|
+
condition: service_healthy
|
|
259
|
+
restart: unless-stopped
|
|
260
|
+
deploy:
|
|
261
|
+
resources:
|
|
262
|
+
limits:
|
|
263
|
+
cpus: '0.25'
|
|
264
|
+
memory: 128M
|
|
265
|
+
|
|
266
|
+
flower:
|
|
267
|
+
build:
|
|
268
|
+
context: ./backend
|
|
269
|
+
dockerfile: Dockerfile
|
|
270
|
+
container_name: {{ cookiecutter.project_slug }}_flower
|
|
271
|
+
command: celery -A app.worker.celery_app flower --port=5555
|
|
272
|
+
env_file:
|
|
273
|
+
- .env.prod
|
|
274
|
+
- ./backend/.env
|
|
275
|
+
environment:
|
|
276
|
+
- DEBUG=false
|
|
277
|
+
- REDIS_HOST=redis
|
|
278
|
+
- CELERY_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/0
|
|
279
|
+
- CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/0
|
|
280
|
+
- FLOWER_BASIC_AUTH=${FLOWER_USER:-admin}:${FLOWER_PASSWORD:?FLOWER_PASSWORD is required}
|
|
281
|
+
{%- if cookiecutter.include_traefik_labels %}
|
|
282
|
+
networks:
|
|
283
|
+
- traefik-public
|
|
284
|
+
- backend-internal
|
|
285
|
+
labels:
|
|
286
|
+
- "traefik.enable=true"
|
|
287
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-flower.rule=Host(`flower.${DOMAIN:-localhost}`)"
|
|
288
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-flower.entrypoints=websecure"
|
|
289
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-flower.tls.certresolver=letsencrypt"
|
|
290
|
+
- "traefik.http.services.{{ cookiecutter.project_slug }}-flower.loadbalancer.server.port=5555"
|
|
291
|
+
- "traefik.docker.network=traefik-public"
|
|
292
|
+
{%- else %}
|
|
293
|
+
networks:
|
|
294
|
+
- backend-internal
|
|
295
|
+
ports:
|
|
296
|
+
- "5555:5555"
|
|
297
|
+
{%- endif %}
|
|
298
|
+
depends_on:
|
|
299
|
+
redis:
|
|
300
|
+
condition: service_healthy
|
|
301
|
+
restart: unless-stopped
|
|
302
|
+
deploy:
|
|
303
|
+
resources:
|
|
304
|
+
limits:
|
|
305
|
+
cpus: '0.25'
|
|
306
|
+
memory: 128M
|
|
307
|
+
{%- endif %}
|
|
308
|
+
|
|
309
|
+
{%- if cookiecutter.use_taskiq %}
|
|
310
|
+
|
|
311
|
+
taskiq_worker:
|
|
312
|
+
build:
|
|
313
|
+
context: ./backend
|
|
314
|
+
dockerfile: Dockerfile
|
|
315
|
+
container_name: {{ cookiecutter.project_slug }}_taskiq_worker
|
|
316
|
+
command: taskiq worker app.worker.taskiq_app:broker --workers 4
|
|
317
|
+
env_file:
|
|
318
|
+
- .env.prod
|
|
319
|
+
- ./backend/.env
|
|
320
|
+
environment:
|
|
321
|
+
- DEBUG=false
|
|
322
|
+
{%- if cookiecutter.use_postgresql %}
|
|
323
|
+
- POSTGRES_HOST=db
|
|
324
|
+
{%- endif %}
|
|
325
|
+
- REDIS_HOST=redis
|
|
326
|
+
- TASKIQ_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/1
|
|
327
|
+
- TASKIQ_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/1
|
|
328
|
+
networks:
|
|
329
|
+
- backend-internal
|
|
330
|
+
depends_on:
|
|
331
|
+
redis:
|
|
332
|
+
condition: service_healthy
|
|
333
|
+
{%- if cookiecutter.use_postgresql %}
|
|
334
|
+
db:
|
|
335
|
+
condition: service_healthy
|
|
336
|
+
{%- endif %}
|
|
337
|
+
restart: unless-stopped
|
|
338
|
+
deploy:
|
|
339
|
+
replicas: 2
|
|
340
|
+
resources:
|
|
341
|
+
limits:
|
|
342
|
+
cpus: '0.5'
|
|
343
|
+
memory: 512M
|
|
344
|
+
reservations:
|
|
345
|
+
cpus: '0.25'
|
|
346
|
+
memory: 256M
|
|
347
|
+
|
|
348
|
+
taskiq_scheduler:
|
|
349
|
+
build:
|
|
350
|
+
context: ./backend
|
|
351
|
+
dockerfile: Dockerfile
|
|
352
|
+
container_name: {{ cookiecutter.project_slug }}_taskiq_scheduler
|
|
353
|
+
command: taskiq scheduler app.worker.taskiq_app:scheduler
|
|
354
|
+
env_file:
|
|
355
|
+
- .env.prod
|
|
356
|
+
- ./backend/.env
|
|
357
|
+
environment:
|
|
358
|
+
- DEBUG=false
|
|
359
|
+
- REDIS_HOST=redis
|
|
360
|
+
- TASKIQ_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/1
|
|
361
|
+
- TASKIQ_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/1
|
|
362
|
+
networks:
|
|
363
|
+
- backend-internal
|
|
364
|
+
depends_on:
|
|
365
|
+
redis:
|
|
366
|
+
condition: service_healthy
|
|
367
|
+
restart: unless-stopped
|
|
368
|
+
deploy:
|
|
369
|
+
resources:
|
|
370
|
+
limits:
|
|
371
|
+
cpus: '0.25'
|
|
372
|
+
memory: 128M
|
|
373
|
+
{%- endif %}
|
|
374
|
+
|
|
375
|
+
{%- if cookiecutter.use_frontend %}
|
|
376
|
+
|
|
377
|
+
frontend:
|
|
378
|
+
build:
|
|
379
|
+
context: ./frontend
|
|
380
|
+
dockerfile: Dockerfile
|
|
381
|
+
container_name: {{ cookiecutter.project_slug }}_frontend
|
|
382
|
+
environment:
|
|
383
|
+
- NODE_ENV=production
|
|
384
|
+
- BACKEND_URL=http://app:{{ cookiecutter.backend_port }}
|
|
385
|
+
- BACKEND_WS_URL=ws://app:{{ cookiecutter.backend_port }}
|
|
386
|
+
{%- if cookiecutter.include_traefik_labels %}
|
|
387
|
+
networks:
|
|
388
|
+
- traefik-public
|
|
389
|
+
labels:
|
|
390
|
+
- "traefik.enable=true"
|
|
391
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-frontend.rule=Host(`${DOMAIN:-localhost}`)"
|
|
392
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-frontend.entrypoints=websecure"
|
|
393
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-frontend.tls.certresolver=letsencrypt"
|
|
394
|
+
- "traefik.http.routers.{{ cookiecutter.project_slug }}-frontend.middlewares={{ cookiecutter.project_slug }}-security-headers@docker"
|
|
395
|
+
- "traefik.http.services.{{ cookiecutter.project_slug }}-frontend.loadbalancer.server.port={{ cookiecutter.frontend_port }}"
|
|
396
|
+
- "traefik.docker.network=traefik-public"
|
|
397
|
+
{%- else %}
|
|
398
|
+
ports:
|
|
399
|
+
- "{{ cookiecutter.frontend_port }}:{{ cookiecutter.frontend_port }}"
|
|
400
|
+
{%- endif %}
|
|
401
|
+
depends_on:
|
|
402
|
+
- app
|
|
403
|
+
restart: unless-stopped
|
|
404
|
+
deploy:
|
|
405
|
+
resources:
|
|
406
|
+
limits:
|
|
407
|
+
cpus: '0.5'
|
|
408
|
+
memory: 256M
|
|
409
|
+
{%- endif %}
|
|
410
|
+
|
|
411
|
+
networks:
|
|
412
|
+
{%- if cookiecutter.include_traefik_service %}
|
|
413
|
+
traefik-public:
|
|
414
|
+
driver: bridge
|
|
415
|
+
{%- elif cookiecutter.include_traefik_labels %}
|
|
416
|
+
traefik-public:
|
|
417
|
+
external: true
|
|
418
|
+
{%- endif %}
|
|
419
|
+
backend-internal:
|
|
420
|
+
driver: bridge
|
|
421
|
+
internal: true
|
|
422
|
+
|
|
423
|
+
volumes:
|
|
424
|
+
{%- if cookiecutter.include_traefik_service %}
|
|
425
|
+
traefik_letsencrypt:
|
|
426
|
+
{%- endif %}
|
|
427
|
+
{%- if cookiecutter.use_postgresql %}
|
|
428
|
+
postgres_data:
|
|
429
|
+
{%- endif %}
|
|
430
|
+
{%- if cookiecutter.enable_redis %}
|
|
431
|
+
redis_data:
|
|
432
|
+
{%- endif %}
|
|
433
|
+
{%- else %}
|
|
434
|
+
# Docker is disabled for this project
|
|
435
|
+
{%- endif %}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_docker %}
|
|
2
|
+
# Backend development configuration
|
|
3
|
+
# Usage: docker-compose up -d
|
|
4
|
+
|
|
5
|
+
services:
|
|
6
|
+
app:
|
|
7
|
+
build:
|
|
8
|
+
context: ./backend
|
|
9
|
+
dockerfile: Dockerfile
|
|
10
|
+
container_name: {{ cookiecutter.project_slug }}_backend
|
|
11
|
+
ports:
|
|
12
|
+
- "{{ cookiecutter.backend_port }}:{{ cookiecutter.backend_port }}"
|
|
13
|
+
volumes:
|
|
14
|
+
- ./backend/app:/app/app:ro
|
|
15
|
+
- ./backend/cli:/app/cli:ro
|
|
16
|
+
env_file:
|
|
17
|
+
- ./backend/.env
|
|
18
|
+
environment:
|
|
19
|
+
- DEBUG=true
|
|
20
|
+
- ENVIRONMENT=local
|
|
21
|
+
{%- if cookiecutter.use_postgresql %}
|
|
22
|
+
- POSTGRES_HOST=db
|
|
23
|
+
{%- endif %}
|
|
24
|
+
{%- if cookiecutter.enable_redis %}
|
|
25
|
+
- REDIS_HOST=redis
|
|
26
|
+
{%- endif %}
|
|
27
|
+
{%- if cookiecutter.use_celery %}
|
|
28
|
+
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
29
|
+
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
30
|
+
{%- endif %}
|
|
31
|
+
{%- if cookiecutter.use_taskiq %}
|
|
32
|
+
- TASKIQ_BROKER_URL=redis://redis:6379/1
|
|
33
|
+
- TASKIQ_RESULT_BACKEND=redis://redis:6379/1
|
|
34
|
+
{%- endif %}
|
|
35
|
+
command: uvicorn app.main:app --host 0.0.0.0 --port {{ cookiecutter.backend_port }} --reload
|
|
36
|
+
networks:
|
|
37
|
+
- backend
|
|
38
|
+
{%- if cookiecutter.use_postgresql or cookiecutter.enable_redis %}
|
|
39
|
+
depends_on:
|
|
40
|
+
{%- if cookiecutter.use_postgresql %}
|
|
41
|
+
db:
|
|
42
|
+
condition: service_healthy
|
|
43
|
+
{%- endif %}
|
|
44
|
+
{%- if cookiecutter.enable_redis %}
|
|
45
|
+
redis:
|
|
46
|
+
condition: service_healthy
|
|
47
|
+
{%- endif %}
|
|
48
|
+
{%- endif %}
|
|
49
|
+
restart: unless-stopped
|
|
50
|
+
|
|
51
|
+
{%- if cookiecutter.use_postgresql %}
|
|
52
|
+
|
|
53
|
+
db:
|
|
54
|
+
image: postgres:16-alpine
|
|
55
|
+
container_name: {{ cookiecutter.project_slug }}_db
|
|
56
|
+
environment:
|
|
57
|
+
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
|
58
|
+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
|
|
59
|
+
- POSTGRES_DB=${POSTGRES_DB:-{{ cookiecutter.project_slug }}}
|
|
60
|
+
volumes:
|
|
61
|
+
- postgres_data:/var/lib/postgresql/data
|
|
62
|
+
# Port exposed only for local development - remove in production
|
|
63
|
+
ports:
|
|
64
|
+
- "5432:5432"
|
|
65
|
+
networks:
|
|
66
|
+
- backend
|
|
67
|
+
healthcheck:
|
|
68
|
+
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
69
|
+
interval: 10s
|
|
70
|
+
timeout: 5s
|
|
71
|
+
retries: 5
|
|
72
|
+
restart: unless-stopped
|
|
73
|
+
{%- endif %}
|
|
74
|
+
|
|
75
|
+
{%- if cookiecutter.enable_redis %}
|
|
76
|
+
|
|
77
|
+
redis:
|
|
78
|
+
image: redis:7-alpine
|
|
79
|
+
container_name: {{ cookiecutter.project_slug }}_redis
|
|
80
|
+
# Port exposed only for local development - remove in production
|
|
81
|
+
ports:
|
|
82
|
+
- "6379:6379"
|
|
83
|
+
volumes:
|
|
84
|
+
- redis_data:/data
|
|
85
|
+
networks:
|
|
86
|
+
- backend
|
|
87
|
+
healthcheck:
|
|
88
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
89
|
+
interval: 10s
|
|
90
|
+
timeout: 5s
|
|
91
|
+
retries: 5
|
|
92
|
+
restart: unless-stopped
|
|
93
|
+
{%- endif %}
|
|
94
|
+
|
|
95
|
+
{%- if cookiecutter.use_celery %}
|
|
96
|
+
|
|
97
|
+
celery_worker:
|
|
98
|
+
build:
|
|
99
|
+
context: ./backend
|
|
100
|
+
dockerfile: Dockerfile
|
|
101
|
+
container_name: {{ cookiecutter.project_slug }}_celery_worker
|
|
102
|
+
volumes:
|
|
103
|
+
- ./backend/app:/app/app:ro
|
|
104
|
+
command: celery -A app.worker.celery_app worker --loglevel=debug
|
|
105
|
+
env_file:
|
|
106
|
+
- ./backend/.env
|
|
107
|
+
environment:
|
|
108
|
+
- DEBUG=true
|
|
109
|
+
{%- if cookiecutter.use_postgresql %}
|
|
110
|
+
- POSTGRES_HOST=db
|
|
111
|
+
{%- endif %}
|
|
112
|
+
- REDIS_HOST=redis
|
|
113
|
+
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
114
|
+
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
115
|
+
networks:
|
|
116
|
+
- backend
|
|
117
|
+
depends_on:
|
|
118
|
+
redis:
|
|
119
|
+
condition: service_healthy
|
|
120
|
+
{%- if cookiecutter.use_postgresql %}
|
|
121
|
+
db:
|
|
122
|
+
condition: service_healthy
|
|
123
|
+
{%- endif %}
|
|
124
|
+
restart: unless-stopped
|
|
125
|
+
|
|
126
|
+
celery_beat:
|
|
127
|
+
build:
|
|
128
|
+
context: ./backend
|
|
129
|
+
dockerfile: Dockerfile
|
|
130
|
+
container_name: {{ cookiecutter.project_slug }}_celery_beat
|
|
131
|
+
volumes:
|
|
132
|
+
- ./backend/app:/app/app:ro
|
|
133
|
+
command: celery -A app.worker.celery_app beat --loglevel=debug
|
|
134
|
+
env_file:
|
|
135
|
+
- ./backend/.env
|
|
136
|
+
environment:
|
|
137
|
+
- DEBUG=true
|
|
138
|
+
- REDIS_HOST=redis
|
|
139
|
+
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
140
|
+
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
141
|
+
networks:
|
|
142
|
+
- backend
|
|
143
|
+
depends_on:
|
|
144
|
+
redis:
|
|
145
|
+
condition: service_healthy
|
|
146
|
+
restart: unless-stopped
|
|
147
|
+
|
|
148
|
+
flower:
|
|
149
|
+
build:
|
|
150
|
+
context: ./backend
|
|
151
|
+
dockerfile: Dockerfile
|
|
152
|
+
container_name: {{ cookiecutter.project_slug }}_flower
|
|
153
|
+
command: celery -A app.worker.celery_app flower --port=5555
|
|
154
|
+
ports:
|
|
155
|
+
- "5555:5555"
|
|
156
|
+
env_file:
|
|
157
|
+
- ./backend/.env
|
|
158
|
+
environment:
|
|
159
|
+
- DEBUG=true
|
|
160
|
+
- REDIS_HOST=redis
|
|
161
|
+
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
162
|
+
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
163
|
+
networks:
|
|
164
|
+
- backend
|
|
165
|
+
depends_on:
|
|
166
|
+
redis:
|
|
167
|
+
condition: service_healthy
|
|
168
|
+
restart: unless-stopped
|
|
169
|
+
{%- endif %}
|
|
170
|
+
|
|
171
|
+
{%- if cookiecutter.use_taskiq %}
|
|
172
|
+
|
|
173
|
+
taskiq_worker:
|
|
174
|
+
build:
|
|
175
|
+
context: ./backend
|
|
176
|
+
dockerfile: Dockerfile
|
|
177
|
+
container_name: {{ cookiecutter.project_slug }}_taskiq_worker
|
|
178
|
+
volumes:
|
|
179
|
+
- ./backend/app:/app/app:ro
|
|
180
|
+
command: taskiq worker app.worker.taskiq_app:broker --workers 1 --reload
|
|
181
|
+
env_file:
|
|
182
|
+
- ./backend/.env
|
|
183
|
+
environment:
|
|
184
|
+
- DEBUG=true
|
|
185
|
+
{%- if cookiecutter.use_postgresql %}
|
|
186
|
+
- POSTGRES_HOST=db
|
|
187
|
+
{%- endif %}
|
|
188
|
+
- REDIS_HOST=redis
|
|
189
|
+
- TASKIQ_BROKER_URL=redis://redis:6379/1
|
|
190
|
+
- TASKIQ_RESULT_BACKEND=redis://redis:6379/1
|
|
191
|
+
networks:
|
|
192
|
+
- backend
|
|
193
|
+
depends_on:
|
|
194
|
+
redis:
|
|
195
|
+
condition: service_healthy
|
|
196
|
+
{%- if cookiecutter.use_postgresql %}
|
|
197
|
+
db:
|
|
198
|
+
condition: service_healthy
|
|
199
|
+
{%- endif %}
|
|
200
|
+
restart: unless-stopped
|
|
201
|
+
|
|
202
|
+
taskiq_scheduler:
|
|
203
|
+
build:
|
|
204
|
+
context: ./backend
|
|
205
|
+
dockerfile: Dockerfile
|
|
206
|
+
container_name: {{ cookiecutter.project_slug }}_taskiq_scheduler
|
|
207
|
+
volumes:
|
|
208
|
+
- ./backend/app:/app/app:ro
|
|
209
|
+
command: taskiq scheduler app.worker.taskiq_app:scheduler
|
|
210
|
+
env_file:
|
|
211
|
+
- ./backend/.env
|
|
212
|
+
environment:
|
|
213
|
+
- DEBUG=true
|
|
214
|
+
- REDIS_HOST=redis
|
|
215
|
+
- TASKIQ_BROKER_URL=redis://redis:6379/1
|
|
216
|
+
- TASKIQ_RESULT_BACKEND=redis://redis:6379/1
|
|
217
|
+
networks:
|
|
218
|
+
- backend
|
|
219
|
+
depends_on:
|
|
220
|
+
redis:
|
|
221
|
+
condition: service_healthy
|
|
222
|
+
restart: unless-stopped
|
|
223
|
+
{%- endif %}
|
|
224
|
+
|
|
225
|
+
networks:
|
|
226
|
+
backend:
|
|
227
|
+
driver: bridge
|
|
228
|
+
|
|
229
|
+
{%- if cookiecutter.use_postgresql or cookiecutter.enable_redis %}
|
|
230
|
+
|
|
231
|
+
volumes:
|
|
232
|
+
{%- if cookiecutter.use_postgresql %}
|
|
233
|
+
postgres_data:
|
|
234
|
+
{%- endif %}
|
|
235
|
+
{%- if cookiecutter.enable_redis %}
|
|
236
|
+
redis_data:
|
|
237
|
+
{%- endif %}
|
|
238
|
+
{%- endif %}
|
|
239
|
+
{%- else %}
|
|
240
|
+
# Docker is disabled for this project
|
|
241
|
+
{%- endif %}
|