fastapi-fullstack 0.1.2__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.2.dist-info/METADATA +545 -0
- fastapi_fullstack-0.1.2.dist-info/RECORD +221 -0
- fastapi_fullstack-0.1.2.dist-info/WHEEL +4 -0
- fastapi_fullstack-0.1.2.dist-info/entry_points.txt +2 -0
- fastapi_fullstack-0.1.2.dist-info/licenses/LICENSE +21 -0
- fastapi_gen/__init__.py +3 -0
- fastapi_gen/cli.py +256 -0
- fastapi_gen/config.py +255 -0
- fastapi_gen/generator.py +181 -0
- fastapi_gen/prompts.py +648 -0
- fastapi_gen/template/cookiecutter.json +76 -0
- fastapi_gen/template/hooks/post_gen_project.py +111 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/.env.example +136 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +150 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/.gitignore +108 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/CLAUDE.md +357 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/Makefile +298 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/README.md +723 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/.dockerignore +60 -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 +115 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/__init__.py +13 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/assistant.py +202 -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 +528 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/exception_handlers.py +85 -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 +448 -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 +490 -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 +247 -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 +113 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/main.py +326 -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 +760 -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 +195 -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 +797 -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 +158 -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_agents.py +121 -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 +382 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.yml +241 -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 +693 -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 +66 -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/(auth)/layout.tsx +11 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/(auth)/login/page.tsx +5 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/(auth)/register/page.tsx +5 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/(dashboard)/chat/page.tsx +20 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/(dashboard)/dashboard/page.tsx +99 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/(dashboard)/layout.tsx +17 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/(dashboard)/profile/page.tsx +156 -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/auth/callback/page.tsx +96 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/globals.css +108 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/layout.tsx +25 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/app/page.tsx +73 -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 +135 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/chat-input.tsx +73 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/conversation-sidebar.tsx +261 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/index.ts +8 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/message-item.tsx +63 -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 +60 -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 +45 -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 +48 -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 +83 -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 +54 -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 +12 -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/hooks/index.ts +6 -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 +175 -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 +32 -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 +33 -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 +48 -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 +6 -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 +81 -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,357 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
**{{ cookiecutter.project_name }}** is a FastAPI application generated with [Full-Stack FastAPI + Next.js Template](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template).
|
|
8
|
+
|
|
9
|
+
**Stack:**
|
|
10
|
+
- FastAPI + Pydantic v2
|
|
11
|
+
{%- if cookiecutter.use_postgresql %}
|
|
12
|
+
- PostgreSQL (async with asyncpg + SQLAlchemy 2.0)
|
|
13
|
+
{%- endif %}
|
|
14
|
+
{%- if cookiecutter.use_mongodb %}
|
|
15
|
+
- MongoDB (async with motor)
|
|
16
|
+
{%- endif %}
|
|
17
|
+
{%- if cookiecutter.use_sqlite %}
|
|
18
|
+
- SQLite (sync with SQLAlchemy)
|
|
19
|
+
{%- endif %}
|
|
20
|
+
{%- if cookiecutter.use_jwt %}
|
|
21
|
+
- JWT authentication (access + refresh tokens)
|
|
22
|
+
{%- endif %}
|
|
23
|
+
{%- if cookiecutter.enable_redis %}
|
|
24
|
+
- Redis (caching, sessions)
|
|
25
|
+
{%- endif %}
|
|
26
|
+
{%- if cookiecutter.enable_ai_agent %}
|
|
27
|
+
- PydanticAI (AI agents with tool support)
|
|
28
|
+
{%- endif %}
|
|
29
|
+
{%- if cookiecutter.use_celery %}
|
|
30
|
+
- Celery (background tasks)
|
|
31
|
+
{%- endif %}
|
|
32
|
+
{%- if cookiecutter.use_taskiq %}
|
|
33
|
+
- Taskiq (async background tasks)
|
|
34
|
+
{%- endif %}
|
|
35
|
+
{%- if cookiecutter.use_frontend %}
|
|
36
|
+
- Next.js 15 + React 19 + TypeScript + Tailwind CSS v4
|
|
37
|
+
{%- endif %}
|
|
38
|
+
|
|
39
|
+
## Commands
|
|
40
|
+
|
|
41
|
+
### Backend
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cd backend
|
|
45
|
+
|
|
46
|
+
# Install dependencies
|
|
47
|
+
uv sync
|
|
48
|
+
|
|
49
|
+
# Run development server
|
|
50
|
+
uv run uvicorn app.main:app --reload --port {{ cookiecutter.backend_port }}
|
|
51
|
+
|
|
52
|
+
# Or use project CLI
|
|
53
|
+
uv run {{ cookiecutter.project_slug }} server run --reload
|
|
54
|
+
|
|
55
|
+
# Run tests
|
|
56
|
+
pytest
|
|
57
|
+
pytest tests/test_file.py::test_name -v
|
|
58
|
+
|
|
59
|
+
# Linting and formatting
|
|
60
|
+
ruff check .
|
|
61
|
+
ruff check . --fix
|
|
62
|
+
ruff format .
|
|
63
|
+
|
|
64
|
+
# Type checking
|
|
65
|
+
mypy app
|
|
66
|
+
```
|
|
67
|
+
{%- if cookiecutter.use_postgresql or cookiecutter.use_sqlite %}
|
|
68
|
+
|
|
69
|
+
### Database
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
cd backend
|
|
73
|
+
|
|
74
|
+
# Run all migrations
|
|
75
|
+
uv run alembic upgrade head
|
|
76
|
+
|
|
77
|
+
# Create new migration
|
|
78
|
+
uv run alembic revision --autogenerate -m "Description"
|
|
79
|
+
|
|
80
|
+
# Or use project CLI
|
|
81
|
+
uv run {{ cookiecutter.project_slug }} db upgrade
|
|
82
|
+
uv run {{ cookiecutter.project_slug }} db migrate -m "Description"
|
|
83
|
+
```
|
|
84
|
+
{%- endif %}
|
|
85
|
+
{%- if cookiecutter.use_jwt %}
|
|
86
|
+
|
|
87
|
+
### User Management
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cd backend
|
|
91
|
+
|
|
92
|
+
# Create admin user
|
|
93
|
+
uv run {{ cookiecutter.project_slug }} user create-admin --email admin@example.com
|
|
94
|
+
|
|
95
|
+
# List users
|
|
96
|
+
uv run {{ cookiecutter.project_slug }} user list
|
|
97
|
+
```
|
|
98
|
+
{%- endif %}
|
|
99
|
+
{%- if cookiecutter.use_frontend %}
|
|
100
|
+
|
|
101
|
+
### Frontend
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
cd frontend
|
|
105
|
+
|
|
106
|
+
# Install dependencies
|
|
107
|
+
bun install
|
|
108
|
+
|
|
109
|
+
# Run development server
|
|
110
|
+
bun dev
|
|
111
|
+
|
|
112
|
+
# Run tests
|
|
113
|
+
bun test
|
|
114
|
+
bun test:e2e
|
|
115
|
+
```
|
|
116
|
+
{%- endif %}
|
|
117
|
+
{%- if cookiecutter.enable_docker %}
|
|
118
|
+
|
|
119
|
+
### Docker
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Start all services
|
|
123
|
+
docker compose up -d
|
|
124
|
+
|
|
125
|
+
# View logs
|
|
126
|
+
docker compose logs -f
|
|
127
|
+
|
|
128
|
+
# Stop services
|
|
129
|
+
docker compose down
|
|
130
|
+
```
|
|
131
|
+
{%- endif %}
|
|
132
|
+
|
|
133
|
+
## Architecture
|
|
134
|
+
|
|
135
|
+
This project follows a **Repository + Service** layered architecture:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
API Routes → Services → Repositories → Database
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Directory Structure (`backend/app/`)
|
|
142
|
+
|
|
143
|
+
| Directory | Purpose |
|
|
144
|
+
|-----------|---------|
|
|
145
|
+
| `api/routes/v1/` | HTTP endpoints, request validation, auth |
|
|
146
|
+
| `api/deps.py` | Dependency injection (db session, current user) |
|
|
147
|
+
| `services/` | Business logic, orchestration |
|
|
148
|
+
| `repositories/` | Data access layer, database queries |
|
|
149
|
+
| `schemas/` | Pydantic models for request/response |
|
|
150
|
+
| `db/models/` | SQLAlchemy/MongoDB models |
|
|
151
|
+
| `core/config.py` | Settings via pydantic-settings |
|
|
152
|
+
{%- if cookiecutter.use_auth %}
|
|
153
|
+
| `core/security.py` | JWT/API key utilities |
|
|
154
|
+
{%- endif %}
|
|
155
|
+
{%- if cookiecutter.enable_ai_agent %}
|
|
156
|
+
| `agents/` | PydanticAI agents and tools |
|
|
157
|
+
{%- endif %}
|
|
158
|
+
| `commands/` | Django-style CLI commands |
|
|
159
|
+
{%- if cookiecutter.use_celery or cookiecutter.use_taskiq %}
|
|
160
|
+
| `worker/` | Background task definitions |
|
|
161
|
+
{%- endif %}
|
|
162
|
+
|
|
163
|
+
### Adding New Features
|
|
164
|
+
|
|
165
|
+
**1. Add a new API endpoint:**
|
|
166
|
+
```
|
|
167
|
+
1. Create schema in `schemas/`
|
|
168
|
+
2. Create model in `db/models/` (if new entity)
|
|
169
|
+
3. Create repository in `repositories/`
|
|
170
|
+
4. Create service in `services/`
|
|
171
|
+
5. Create route in `api/routes/v1/`
|
|
172
|
+
6. Register route in `api/routes/v1/__init__.py`
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**2. Add a custom CLI command:**
|
|
176
|
+
```python
|
|
177
|
+
# app/commands/my_command.py
|
|
178
|
+
from app.commands import command, success
|
|
179
|
+
import click
|
|
180
|
+
|
|
181
|
+
@command("my-command", help="Description")
|
|
182
|
+
@click.option("--option", "-o", help="Some option")
|
|
183
|
+
def my_command(option: str):
|
|
184
|
+
# Logic here
|
|
185
|
+
success(f"Done with {option}")
|
|
186
|
+
```
|
|
187
|
+
Commands are auto-discovered. Run with: `{{ cookiecutter.project_slug }} cmd my-command`
|
|
188
|
+
{%- if cookiecutter.enable_ai_agent %}
|
|
189
|
+
|
|
190
|
+
**3. Add an AI agent tool:**
|
|
191
|
+
```python
|
|
192
|
+
# app/agents/assistant.py
|
|
193
|
+
@agent.tool
|
|
194
|
+
async def my_tool(ctx: RunContext[Deps], param: str) -> dict:
|
|
195
|
+
"""Tool description for LLM."""
|
|
196
|
+
# Tool logic
|
|
197
|
+
return {"result": param}
|
|
198
|
+
```
|
|
199
|
+
{%- endif %}
|
|
200
|
+
|
|
201
|
+
## Key Patterns
|
|
202
|
+
|
|
203
|
+
### Dependency Injection
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
# In routes
|
|
207
|
+
from app.api.deps import get_db, get_current_user
|
|
208
|
+
|
|
209
|
+
@router.get("/items")
|
|
210
|
+
async def list_items(
|
|
211
|
+
db: AsyncSession = Depends(get_db),
|
|
212
|
+
current_user: User = Depends(get_current_user),
|
|
213
|
+
):
|
|
214
|
+
service = ItemService(db)
|
|
215
|
+
return await service.get_multi()
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Service Layer
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
# Services contain business logic
|
|
222
|
+
class ItemService:
|
|
223
|
+
def __init__(self, db: AsyncSession):
|
|
224
|
+
self.db = db
|
|
225
|
+
|
|
226
|
+
async def create(self, item_in: ItemCreate) -> Item:
|
|
227
|
+
# Business validation
|
|
228
|
+
# Repository calls
|
|
229
|
+
return await item_repo.create(self.db, **item_in.model_dump())
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Repository Layer
|
|
233
|
+
|
|
234
|
+
```python
|
|
235
|
+
# Repositories handle data access only
|
|
236
|
+
class ItemRepository:
|
|
237
|
+
async def get_by_id(self, db: AsyncSession, id: UUID) -> Item | None:
|
|
238
|
+
return await db.get(Item, id)
|
|
239
|
+
|
|
240
|
+
async def create(self, db: AsyncSession, **kwargs) -> Item:
|
|
241
|
+
item = Item(**kwargs)
|
|
242
|
+
db.add(item)
|
|
243
|
+
await db.flush()
|
|
244
|
+
await db.refresh(item)
|
|
245
|
+
return item
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Custom Exceptions
|
|
249
|
+
|
|
250
|
+
```python
|
|
251
|
+
from app.core.exceptions import NotFoundError, AlreadyExistsError
|
|
252
|
+
|
|
253
|
+
# In services
|
|
254
|
+
if not item:
|
|
255
|
+
raise NotFoundError(message="Item not found", details={"id": str(id)})
|
|
256
|
+
```
|
|
257
|
+
{%- if cookiecutter.use_frontend %}
|
|
258
|
+
|
|
259
|
+
## Frontend Patterns
|
|
260
|
+
|
|
261
|
+
### Authentication
|
|
262
|
+
|
|
263
|
+
Tokens stored in HTTP-only cookies. Use the auth hook:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
import { useAuth } from '@/hooks/use-auth';
|
|
267
|
+
|
|
268
|
+
function Component() {
|
|
269
|
+
const { user, isAuthenticated, login, logout } = useAuth();
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### State Management (Zustand)
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
import { useAuthStore } from '@/stores/auth-store';
|
|
277
|
+
|
|
278
|
+
const { user, setUser, logout } = useAuthStore();
|
|
279
|
+
```
|
|
280
|
+
{%- if cookiecutter.enable_ai_agent %}
|
|
281
|
+
|
|
282
|
+
### WebSocket Chat
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
import { useChat } from '@/hooks/use-chat';
|
|
286
|
+
|
|
287
|
+
function ChatPage() {
|
|
288
|
+
const { messages, sendMessage, isStreaming } = useChat();
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
{%- endif %}
|
|
292
|
+
{%- endif %}
|
|
293
|
+
|
|
294
|
+
## Environment Variables
|
|
295
|
+
|
|
296
|
+
Key variables in `.env`:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
ENVIRONMENT=local # local, staging, production
|
|
300
|
+
{%- if cookiecutter.use_postgresql %}
|
|
301
|
+
POSTGRES_HOST=localhost
|
|
302
|
+
POSTGRES_PASSWORD=secret
|
|
303
|
+
{%- endif %}
|
|
304
|
+
{%- if cookiecutter.use_jwt %}
|
|
305
|
+
SECRET_KEY=change-me-use-openssl-rand-hex-32
|
|
306
|
+
{%- endif %}
|
|
307
|
+
{%- if cookiecutter.enable_ai_agent %}
|
|
308
|
+
OPENAI_API_KEY=sk-...
|
|
309
|
+
{%- endif %}
|
|
310
|
+
{%- if cookiecutter.enable_logfire %}
|
|
311
|
+
LOGFIRE_TOKEN=your-token
|
|
312
|
+
{%- endif %}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Testing
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# Run all tests
|
|
319
|
+
pytest
|
|
320
|
+
|
|
321
|
+
# With coverage
|
|
322
|
+
pytest --cov=app --cov-report=term-missing
|
|
323
|
+
|
|
324
|
+
# Specific test
|
|
325
|
+
pytest tests/api/test_health.py -v
|
|
326
|
+
|
|
327
|
+
# Run only unit tests
|
|
328
|
+
pytest tests/unit/
|
|
329
|
+
|
|
330
|
+
# Run only integration tests
|
|
331
|
+
pytest tests/integration/
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Key Design Decisions
|
|
335
|
+
|
|
336
|
+
{%- if cookiecutter.use_postgresql or cookiecutter.use_mongodb %}
|
|
337
|
+
- Database operations are async
|
|
338
|
+
{%- endif %}
|
|
339
|
+
- Use `db.flush()` in repositories (not `commit`) - let the dependency manage transactions
|
|
340
|
+
- Services raise domain exceptions (`NotFoundError`, etc.) - routes convert to HTTP
|
|
341
|
+
- Schemas are separate for Create, Update, and Response
|
|
342
|
+
{%- if cookiecutter.enable_ai_agent %}
|
|
343
|
+
- AI Agent uses `iter()` for WebSocket streaming (not `run()`)
|
|
344
|
+
{%- endif %}
|
|
345
|
+
- Custom commands auto-discovered from `app/commands/`
|
|
346
|
+
|
|
347
|
+
## Documentation
|
|
348
|
+
|
|
349
|
+
- [Template Repository](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template)
|
|
350
|
+
- [Architecture Guide](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/architecture.md)
|
|
351
|
+
{%- if cookiecutter.use_frontend %}
|
|
352
|
+
- [Frontend Guide](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/frontend.md)
|
|
353
|
+
{%- endif %}
|
|
354
|
+
{%- if cookiecutter.enable_ai_agent %}
|
|
355
|
+
- [AI Agent Guide](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/ai-agent.md)
|
|
356
|
+
{%- endif %}
|
|
357
|
+
- [Deployment Guide](https://github.com/vstorm-co/full-stack-fastapi-nextjs-llm-template/blob/main/docs/deployment.md)
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
.PHONY: install format lint test run clean help db-init
|
|
2
|
+
|
|
3
|
+
# === Setup ===
|
|
4
|
+
install:
|
|
5
|
+
uv sync --directory backend --dev
|
|
6
|
+
{%- if cookiecutter.enable_precommit %}
|
|
7
|
+
uv run --directory backend pre-commit install
|
|
8
|
+
{%- endif %}
|
|
9
|
+
@echo ""
|
|
10
|
+
@echo "✅ Installation complete!"
|
|
11
|
+
@echo "Next steps:"
|
|
12
|
+
@echo " 1. cp .env.example .env"
|
|
13
|
+
@echo " 2. Edit .env with your settings"
|
|
14
|
+
{%- if cookiecutter.use_postgresql %}
|
|
15
|
+
@echo " 3. make docker-db"
|
|
16
|
+
@echo " 4. make db-migrate && make db-upgrade"
|
|
17
|
+
{%- endif %}
|
|
18
|
+
@echo " 5. make run"
|
|
19
|
+
|
|
20
|
+
# === Code Quality ===
|
|
21
|
+
format:
|
|
22
|
+
uv run --directory backend ruff format app tests cli
|
|
23
|
+
uv run --directory backend ruff check app tests cli --fix
|
|
24
|
+
|
|
25
|
+
lint:
|
|
26
|
+
uv run --directory backend ruff check app tests cli
|
|
27
|
+
uv run --directory backend ruff format app tests cli --check
|
|
28
|
+
uv run --directory backend mypy app
|
|
29
|
+
|
|
30
|
+
# === Testing ===
|
|
31
|
+
test:
|
|
32
|
+
uv run --directory backend pytest tests/ -v
|
|
33
|
+
|
|
34
|
+
test-cov:
|
|
35
|
+
uv run --directory backend pytest tests/ -v --cov=app --cov-report=html --cov-report=term-missing
|
|
36
|
+
|
|
37
|
+
{%- if cookiecutter.use_postgresql or cookiecutter.use_sqlite %}
|
|
38
|
+
|
|
39
|
+
# === Database ===
|
|
40
|
+
{%- if cookiecutter.use_postgresql and cookiecutter.enable_docker %}
|
|
41
|
+
db-init: docker-db
|
|
42
|
+
@echo "Waiting for PostgreSQL to be ready..."
|
|
43
|
+
@sleep 3
|
|
44
|
+
uv run --directory backend {{ cookiecutter.project_slug }} db upgrade
|
|
45
|
+
@echo ""
|
|
46
|
+
@echo "✅ Database initialized!"
|
|
47
|
+
{%- else %}
|
|
48
|
+
db-init:
|
|
49
|
+
uv run --directory backend {{ cookiecutter.project_slug }} db upgrade
|
|
50
|
+
@echo ""
|
|
51
|
+
@echo "✅ Database initialized!"
|
|
52
|
+
{%- endif %}
|
|
53
|
+
|
|
54
|
+
db-migrate:
|
|
55
|
+
@read -p "Migration message: " msg; \
|
|
56
|
+
uv run --directory backend {{ cookiecutter.project_slug }} db migrate -m "$$msg"
|
|
57
|
+
|
|
58
|
+
db-upgrade:
|
|
59
|
+
uv run --directory backend {{ cookiecutter.project_slug }} db upgrade
|
|
60
|
+
|
|
61
|
+
db-downgrade:
|
|
62
|
+
uv run --directory backend {{ cookiecutter.project_slug }} db downgrade
|
|
63
|
+
|
|
64
|
+
db-current:
|
|
65
|
+
uv run --directory backend {{ cookiecutter.project_slug }} db current
|
|
66
|
+
|
|
67
|
+
db-history:
|
|
68
|
+
uv run --directory backend {{ cookiecutter.project_slug }} db history
|
|
69
|
+
{%- endif %}
|
|
70
|
+
|
|
71
|
+
# === Server ===
|
|
72
|
+
run:
|
|
73
|
+
uv run --directory backend {{ cookiecutter.project_slug }} server run --reload
|
|
74
|
+
|
|
75
|
+
run-prod:
|
|
76
|
+
uv run --directory backend {{ cookiecutter.project_slug }} server run --host 0.0.0.0 --port 8000
|
|
77
|
+
|
|
78
|
+
routes:
|
|
79
|
+
uv run --directory backend {{ cookiecutter.project_slug }} server routes
|
|
80
|
+
|
|
81
|
+
{%- if cookiecutter.use_jwt %}
|
|
82
|
+
|
|
83
|
+
# === Users ===
|
|
84
|
+
user-create:
|
|
85
|
+
uv run --directory backend {{ cookiecutter.project_slug }} user create
|
|
86
|
+
|
|
87
|
+
user-list:
|
|
88
|
+
uv run --directory backend {{ cookiecutter.project_slug }} user list
|
|
89
|
+
{%- endif %}
|
|
90
|
+
|
|
91
|
+
{%- if cookiecutter.use_celery %}
|
|
92
|
+
|
|
93
|
+
# === Celery ===
|
|
94
|
+
celery-worker:
|
|
95
|
+
uv run --directory backend {{ cookiecutter.project_slug }} celery worker
|
|
96
|
+
|
|
97
|
+
celery-beat:
|
|
98
|
+
uv run --directory backend {{ cookiecutter.project_slug }} celery beat
|
|
99
|
+
|
|
100
|
+
celery-flower:
|
|
101
|
+
uv run --directory backend {{ cookiecutter.project_slug }} celery flower
|
|
102
|
+
@echo ""
|
|
103
|
+
@echo "✅ Flower started at http://localhost:5555"
|
|
104
|
+
{%- endif %}
|
|
105
|
+
|
|
106
|
+
{%- if cookiecutter.use_taskiq %}
|
|
107
|
+
|
|
108
|
+
# === Taskiq ===
|
|
109
|
+
taskiq-worker:
|
|
110
|
+
uv run --directory backend {{ cookiecutter.project_slug }} taskiq worker
|
|
111
|
+
|
|
112
|
+
taskiq-scheduler:
|
|
113
|
+
uv run --directory backend {{ cookiecutter.project_slug }} taskiq scheduler
|
|
114
|
+
{%- endif %}
|
|
115
|
+
|
|
116
|
+
{%- if cookiecutter.enable_docker %}
|
|
117
|
+
|
|
118
|
+
# === Docker: Backend (Development) ===
|
|
119
|
+
docker-up:
|
|
120
|
+
docker-compose up -d
|
|
121
|
+
@echo ""
|
|
122
|
+
@echo "✅ Backend services started!"
|
|
123
|
+
@echo " API: http://localhost:{{ cookiecutter.backend_port }}"
|
|
124
|
+
@echo " Docs: http://localhost:{{ cookiecutter.backend_port }}/docs"
|
|
125
|
+
{%- if cookiecutter.use_celery %}
|
|
126
|
+
@echo " Flower: http://localhost:5555"
|
|
127
|
+
{%- endif %}
|
|
128
|
+
{%- if cookiecutter.use_postgresql %}
|
|
129
|
+
@echo " PostgreSQL: localhost:5432"
|
|
130
|
+
{%- endif %}
|
|
131
|
+
{%- if cookiecutter.enable_redis %}
|
|
132
|
+
@echo " Redis: localhost:6379"
|
|
133
|
+
{%- endif %}
|
|
134
|
+
|
|
135
|
+
docker-down:
|
|
136
|
+
docker-compose down
|
|
137
|
+
{%- if cookiecutter.use_frontend %}
|
|
138
|
+
docker-compose -f docker-compose.frontend.yml down 2>/dev/null || true
|
|
139
|
+
{%- endif %}
|
|
140
|
+
|
|
141
|
+
docker-logs:
|
|
142
|
+
docker-compose logs -f
|
|
143
|
+
|
|
144
|
+
docker-build:
|
|
145
|
+
docker-compose build
|
|
146
|
+
|
|
147
|
+
docker-shell:
|
|
148
|
+
docker-compose exec app /bin/bash
|
|
149
|
+
|
|
150
|
+
{%- if cookiecutter.use_frontend %}
|
|
151
|
+
|
|
152
|
+
# === Docker: Frontend (Development) ===
|
|
153
|
+
docker-frontend:
|
|
154
|
+
docker-compose -f docker-compose.frontend.yml up -d
|
|
155
|
+
@echo ""
|
|
156
|
+
@echo "✅ Frontend started!"
|
|
157
|
+
@echo " URL: http://localhost:{{ cookiecutter.frontend_port }}"
|
|
158
|
+
@echo ""
|
|
159
|
+
@echo "Note: Backend must be running (make docker-up)"
|
|
160
|
+
|
|
161
|
+
docker-frontend-down:
|
|
162
|
+
docker-compose -f docker-compose.frontend.yml down
|
|
163
|
+
|
|
164
|
+
docker-frontend-logs:
|
|
165
|
+
docker-compose -f docker-compose.frontend.yml logs -f
|
|
166
|
+
|
|
167
|
+
docker-frontend-build:
|
|
168
|
+
docker-compose -f docker-compose.frontend.yml build
|
|
169
|
+
{%- endif %}
|
|
170
|
+
|
|
171
|
+
# === Docker: Production (with Traefik) ===
|
|
172
|
+
docker-prod:
|
|
173
|
+
docker-compose -f docker-compose.prod.yml up -d
|
|
174
|
+
@echo ""
|
|
175
|
+
@echo "✅ Production services started with Traefik!"
|
|
176
|
+
@echo ""
|
|
177
|
+
@echo "Endpoints (replace DOMAIN with your domain):"
|
|
178
|
+
{%- if cookiecutter.use_frontend %}
|
|
179
|
+
@echo " Frontend: https://$$DOMAIN"
|
|
180
|
+
{%- endif %}
|
|
181
|
+
@echo " API: https://api.$$DOMAIN"
|
|
182
|
+
{%- if cookiecutter.use_celery %}
|
|
183
|
+
@echo " Flower: https://flower.$$DOMAIN"
|
|
184
|
+
{%- endif %}
|
|
185
|
+
@echo " Traefik: https://traefik.$$DOMAIN"
|
|
186
|
+
|
|
187
|
+
docker-prod-down:
|
|
188
|
+
docker-compose -f docker-compose.prod.yml down
|
|
189
|
+
|
|
190
|
+
docker-prod-logs:
|
|
191
|
+
docker-compose -f docker-compose.prod.yml logs -f
|
|
192
|
+
|
|
193
|
+
docker-prod-build:
|
|
194
|
+
docker-compose -f docker-compose.prod.yml build
|
|
195
|
+
|
|
196
|
+
{%- if cookiecutter.use_postgresql %}
|
|
197
|
+
|
|
198
|
+
# === Docker: Individual Services ===
|
|
199
|
+
docker-db:
|
|
200
|
+
docker-compose up -d db
|
|
201
|
+
@echo ""
|
|
202
|
+
@echo "✅ PostgreSQL started on port 5432"
|
|
203
|
+
@echo " Connection: postgresql://postgres:postgres@localhost:5432/{{ cookiecutter.project_slug }}"
|
|
204
|
+
|
|
205
|
+
docker-db-stop:
|
|
206
|
+
docker-compose stop db
|
|
207
|
+
{%- endif %}
|
|
208
|
+
|
|
209
|
+
{%- if cookiecutter.enable_redis %}
|
|
210
|
+
|
|
211
|
+
docker-redis:
|
|
212
|
+
docker-compose up -d redis
|
|
213
|
+
@echo ""
|
|
214
|
+
@echo "✅ Redis started on port 6379"
|
|
215
|
+
|
|
216
|
+
docker-redis-stop:
|
|
217
|
+
docker-compose stop redis
|
|
218
|
+
{%- endif %}
|
|
219
|
+
{%- endif %}
|
|
220
|
+
|
|
221
|
+
# === Cleanup ===
|
|
222
|
+
clean:
|
|
223
|
+
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
|
224
|
+
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
|
|
225
|
+
find . -type d -name .ruff_cache -exec rm -rf {} + 2>/dev/null || true
|
|
226
|
+
find . -type d -name .mypy_cache -exec rm -rf {} + 2>/dev/null || true
|
|
227
|
+
rm -rf htmlcov/ .coverage coverage.xml
|
|
228
|
+
|
|
229
|
+
# === Help ===
|
|
230
|
+
help:
|
|
231
|
+
@echo ""
|
|
232
|
+
@echo "{{ cookiecutter.project_name }} - Available Commands"
|
|
233
|
+
@echo "======================================"
|
|
234
|
+
@echo ""
|
|
235
|
+
@echo "Setup:"
|
|
236
|
+
@echo " make install Install dependencies + pre-commit hooks"
|
|
237
|
+
@echo ""
|
|
238
|
+
@echo "Development:"
|
|
239
|
+
@echo " make run Start dev server (with hot reload)"
|
|
240
|
+
@echo " make test Run tests"
|
|
241
|
+
@echo " make lint Check code quality"
|
|
242
|
+
@echo " make format Auto-format code"
|
|
243
|
+
@echo ""
|
|
244
|
+
{%- if cookiecutter.use_postgresql or cookiecutter.use_sqlite %}
|
|
245
|
+
@echo "Database:"
|
|
246
|
+
@echo " make db-init Initialize database (start + migrate)"
|
|
247
|
+
@echo " make db-migrate Create new migration"
|
|
248
|
+
@echo " make db-upgrade Apply migrations"
|
|
249
|
+
@echo " make db-downgrade Rollback last migration"
|
|
250
|
+
@echo " make db-current Show current migration"
|
|
251
|
+
@echo ""
|
|
252
|
+
{%- endif %}
|
|
253
|
+
{%- if cookiecutter.use_jwt %}
|
|
254
|
+
@echo "Users:"
|
|
255
|
+
@echo " make user-create Create new user (interactive)"
|
|
256
|
+
@echo " make user-list List all users"
|
|
257
|
+
@echo ""
|
|
258
|
+
{%- endif %}
|
|
259
|
+
{%- if cookiecutter.use_celery %}
|
|
260
|
+
@echo "Celery:"
|
|
261
|
+
@echo " make celery-worker Start Celery worker"
|
|
262
|
+
@echo " make celery-beat Start Celery beat scheduler"
|
|
263
|
+
@echo " make celery-flower Start Flower monitoring UI"
|
|
264
|
+
@echo ""
|
|
265
|
+
{%- endif %}
|
|
266
|
+
{%- if cookiecutter.use_taskiq %}
|
|
267
|
+
@echo "Taskiq:"
|
|
268
|
+
@echo " make taskiq-worker Start Taskiq worker"
|
|
269
|
+
@echo " make taskiq-scheduler Start Taskiq scheduler"
|
|
270
|
+
@echo ""
|
|
271
|
+
{%- endif %}
|
|
272
|
+
{%- if cookiecutter.enable_docker %}
|
|
273
|
+
@echo "Docker (Development):"
|
|
274
|
+
@echo " make docker-up Start backend services"
|
|
275
|
+
@echo " make docker-down Stop all services"
|
|
276
|
+
@echo " make docker-logs View backend logs"
|
|
277
|
+
@echo " make docker-build Build backend images"
|
|
278
|
+
{%- if cookiecutter.use_frontend %}
|
|
279
|
+
@echo " make docker-frontend Start frontend (separate)"
|
|
280
|
+
@echo " make docker-frontend-down Stop frontend"
|
|
281
|
+
{%- endif %}
|
|
282
|
+
{%- if cookiecutter.use_postgresql %}
|
|
283
|
+
@echo " make docker-db Start only PostgreSQL"
|
|
284
|
+
{%- endif %}
|
|
285
|
+
{%- if cookiecutter.enable_redis %}
|
|
286
|
+
@echo " make docker-redis Start only Redis"
|
|
287
|
+
{%- endif %}
|
|
288
|
+
@echo ""
|
|
289
|
+
@echo "Docker (Production with Traefik):"
|
|
290
|
+
@echo " make docker-prod Start production stack"
|
|
291
|
+
@echo " make docker-prod-down Stop production stack"
|
|
292
|
+
@echo " make docker-prod-logs View production logs"
|
|
293
|
+
@echo ""
|
|
294
|
+
{%- endif %}
|
|
295
|
+
@echo "Other:"
|
|
296
|
+
@echo " make routes Show all API routes"
|
|
297
|
+
@echo " make clean Clean cache files"
|
|
298
|
+
@echo ""
|