fastapi-fullstack 0.1.7__py3-none-any.whl → 0.1.15__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 → fastapi_fullstack-0.1.15.dist-info}/METADATA +9 -2
- {fastapi_fullstack-0.1.7.dist-info → fastapi_fullstack-0.1.15.dist-info}/RECORD +71 -55
- fastapi_gen/__init__.py +6 -1
- fastapi_gen/cli.py +9 -0
- fastapi_gen/config.py +154 -2
- fastapi_gen/generator.py +34 -14
- fastapi_gen/prompts.py +172 -31
- fastapi_gen/template/VARIABLES.md +33 -4
- fastapi_gen/template/cookiecutter.json +10 -0
- fastapi_gen/template/hooks/post_gen_project.py +87 -2
- fastapi_gen/template/{{cookiecutter.project_slug}}/.env.prod.example +9 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/.gitlab-ci.yml +178 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/CLAUDE.md +3 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/README.md +334 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/.env.example +32 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/alembic/env.py +10 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/admin.py +1 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/__init__.py +31 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/crewai_assistant.py +563 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/deepagents_assistant.py +526 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/langchain_assistant.py +4 -3
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/agents/langgraph_assistant.py +371 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/agent.py +1472 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/oauth.py +3 -7
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/cleanup.py +2 -2
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/commands/seed.py +7 -2
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/core/config.py +44 -7
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/__init__.py +7 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/base.py +42 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/conversation.py +262 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/item.py +76 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/session.py +118 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/user.py +158 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/db/models/webhook.py +185 -3
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/main.py +29 -2
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/base.py +6 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/repositories/session.py +4 -4
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/conversation.py +9 -9
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/session.py +6 -6
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/services/webhook.py +7 -7
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/__init__.py +1 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/arq_app.py +165 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/app/worker/tasks/__init__.py +10 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/pyproject.toml +40 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/api/test_metrics.py +53 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/backend/tests/test_agents.py +2 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.dev.yml +6 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.prod.yml +100 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/docker-compose.yml +39 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/.env.example +5 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/chat-container.tsx +28 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/index.ts +1 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/message-item.tsx +22 -4
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/message-list.tsx +23 -3
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/components/chat/tool-approval-dialog.tsx +138 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-chat.ts +242 -18
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/hooks/use-local-chat.ts +242 -17
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/lib/constants.ts +1 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/frontend/src/types/chat.ts +57 -1
- fastapi_gen/template/{{cookiecutter.project_slug}}/kubernetes/configmap.yaml +63 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/kubernetes/deployment.yaml +242 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/kubernetes/ingress.yaml +44 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/kubernetes/kustomization.yaml +28 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/kubernetes/namespace.yaml +12 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/kubernetes/secret.yaml +59 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/kubernetes/service.yaml +23 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/nginx/nginx.conf +225 -0
- fastapi_gen/template/{{cookiecutter.project_slug}}/nginx/ssl/.gitkeep +18 -0
- {fastapi_fullstack-0.1.7.dist-info → fastapi_fullstack-0.1.15.dist-info}/WHEEL +0 -0
- {fastapi_fullstack-0.1.7.dist-info → fastapi_fullstack-0.1.15.dist-info}/entry_points.txt +0 -0
- {fastapi_fullstack-0.1.7.dist-info → fastapi_fullstack-0.1.15.dist-info}/licenses/LICENSE +0 -0
|
@@ -11,6 +11,8 @@ export interface ChatMessage {
|
|
|
11
11
|
timestamp: Date;
|
|
12
12
|
toolCalls?: ToolCall[];
|
|
13
13
|
isStreaming?: boolean;
|
|
14
|
+
/** Group ID for related messages (e.g., CrewAI agent chain) */
|
|
15
|
+
groupId?: string;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export interface ToolCall {
|
|
@@ -23,6 +25,7 @@ export interface ToolCall {
|
|
|
23
25
|
|
|
24
26
|
// WebSocket event types from backend
|
|
25
27
|
export type WSEventType =
|
|
28
|
+
// PydanticAI / LangChain / LangGraph events
|
|
26
29
|
| "user_prompt"
|
|
27
30
|
| "user_prompt_processed"
|
|
28
31
|
| "model_request_start"
|
|
@@ -37,7 +40,21 @@ export type WSEventType =
|
|
|
37
40
|
| "complete"
|
|
38
41
|
| "error"
|
|
39
42
|
| "conversation_created"
|
|
40
|
-
| "message_saved"
|
|
43
|
+
| "message_saved"
|
|
44
|
+
// DeepAgents Human-in-the-Loop event
|
|
45
|
+
| "tool_approval_required"
|
|
46
|
+
// CrewAI-specific events
|
|
47
|
+
| "crew_start"
|
|
48
|
+
| "crew_started"
|
|
49
|
+
| "crew_complete"
|
|
50
|
+
| "agent_started"
|
|
51
|
+
| "agent_completed"
|
|
52
|
+
| "task_started"
|
|
53
|
+
| "task_completed"
|
|
54
|
+
| "tool_started"
|
|
55
|
+
| "tool_finished"
|
|
56
|
+
| "llm_started"
|
|
57
|
+
| "llm_completed";
|
|
41
58
|
|
|
42
59
|
export interface WSEvent {
|
|
43
60
|
type: WSEventType;
|
|
@@ -81,3 +98,42 @@ export interface ChatState {
|
|
|
81
98
|
isConnected: boolean;
|
|
82
99
|
isProcessing: boolean;
|
|
83
100
|
}
|
|
101
|
+
|
|
102
|
+
// Human-in-the-Loop (HITL) types for DeepAgents
|
|
103
|
+
export interface ActionRequest {
|
|
104
|
+
id: string;
|
|
105
|
+
tool_name: string;
|
|
106
|
+
args: Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface ReviewConfig {
|
|
110
|
+
tool_name: string;
|
|
111
|
+
/** Whether to allow editing the tool arguments */
|
|
112
|
+
allow_edit?: boolean;
|
|
113
|
+
/** Maximum time to wait for decision (seconds) */
|
|
114
|
+
timeout?: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface PendingApproval {
|
|
118
|
+
actionRequests: ActionRequest[];
|
|
119
|
+
reviewConfigs: ReviewConfig[];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type DecisionType = "approve" | "edit" | "reject";
|
|
123
|
+
|
|
124
|
+
export interface Decision {
|
|
125
|
+
type: DecisionType;
|
|
126
|
+
editedAction?: {
|
|
127
|
+
id: string;
|
|
128
|
+
tool_name: string;
|
|
129
|
+
args: Record<string, unknown>;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface ToolApprovalRequiredEvent {
|
|
134
|
+
type: "tool_approval_required";
|
|
135
|
+
data: {
|
|
136
|
+
action_requests: ActionRequest[];
|
|
137
|
+
review_configs: ReviewConfig[];
|
|
138
|
+
};
|
|
139
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_kubernetes %}
|
|
2
|
+
# ConfigMap for {{ cookiecutter.project_name }}
|
|
3
|
+
apiVersion: v1
|
|
4
|
+
kind: ConfigMap
|
|
5
|
+
metadata:
|
|
6
|
+
name: {{ cookiecutter.project_slug }}-config
|
|
7
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
8
|
+
labels:
|
|
9
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
10
|
+
app.kubernetes.io/component: backend
|
|
11
|
+
data:
|
|
12
|
+
# Application settings
|
|
13
|
+
ENVIRONMENT: "production"
|
|
14
|
+
DEBUG: "false"
|
|
15
|
+
PROJECT_NAME: "{{ cookiecutter.project_name }}"
|
|
16
|
+
API_V1_STR: "/api/v1"
|
|
17
|
+
|
|
18
|
+
{%- if cookiecutter.use_postgresql %}
|
|
19
|
+
# PostgreSQL settings
|
|
20
|
+
POSTGRES_HOST: "postgres-service"
|
|
21
|
+
POSTGRES_PORT: "5432"
|
|
22
|
+
POSTGRES_DB: "{{ cookiecutter.project_slug }}"
|
|
23
|
+
{%- endif %}
|
|
24
|
+
|
|
25
|
+
{%- if cookiecutter.enable_redis %}
|
|
26
|
+
# Redis settings
|
|
27
|
+
REDIS_HOST: "redis-service"
|
|
28
|
+
REDIS_PORT: "6379"
|
|
29
|
+
REDIS_DB: "0"
|
|
30
|
+
{%- endif %}
|
|
31
|
+
|
|
32
|
+
{%- if cookiecutter.use_celery %}
|
|
33
|
+
# Celery settings
|
|
34
|
+
CELERY_BROKER_URL: "redis://redis-service:6379/0"
|
|
35
|
+
CELERY_RESULT_BACKEND: "redis://redis-service:6379/0"
|
|
36
|
+
{%- endif %}
|
|
37
|
+
|
|
38
|
+
{%- if cookiecutter.use_taskiq %}
|
|
39
|
+
# Taskiq settings
|
|
40
|
+
TASKIQ_BROKER_URL: "redis://redis-service:6379/1"
|
|
41
|
+
TASKIQ_RESULT_BACKEND: "redis://redis-service:6379/1"
|
|
42
|
+
{%- endif %}
|
|
43
|
+
|
|
44
|
+
{%- if cookiecutter.use_arq %}
|
|
45
|
+
# ARQ settings
|
|
46
|
+
ARQ_REDIS_HOST: "redis-service"
|
|
47
|
+
ARQ_REDIS_PORT: "6379"
|
|
48
|
+
ARQ_REDIS_DB: "2"
|
|
49
|
+
{%- endif %}
|
|
50
|
+
|
|
51
|
+
{%- if cookiecutter.enable_logfire %}
|
|
52
|
+
# Logfire settings
|
|
53
|
+
LOGFIRE_SERVICE_NAME: "{{ cookiecutter.project_slug }}"
|
|
54
|
+
LOGFIRE_ENVIRONMENT: "production"
|
|
55
|
+
{%- endif %}
|
|
56
|
+
|
|
57
|
+
{%- if cookiecutter.enable_cors %}
|
|
58
|
+
# CORS settings (adjust for your domain)
|
|
59
|
+
CORS_ORIGINS: '["https://{{ cookiecutter.project_slug }}.example.com"]'
|
|
60
|
+
{%- endif %}
|
|
61
|
+
{%- else %}
|
|
62
|
+
# Kubernetes is disabled for this project
|
|
63
|
+
{%- endif %}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_kubernetes %}
|
|
2
|
+
# Deployment for {{ cookiecutter.project_name }} Backend
|
|
3
|
+
apiVersion: apps/v1
|
|
4
|
+
kind: Deployment
|
|
5
|
+
metadata:
|
|
6
|
+
name: {{ cookiecutter.project_slug }}-backend
|
|
7
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
8
|
+
labels:
|
|
9
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
10
|
+
app.kubernetes.io/component: backend
|
|
11
|
+
spec:
|
|
12
|
+
replicas: 2
|
|
13
|
+
selector:
|
|
14
|
+
matchLabels:
|
|
15
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
16
|
+
app.kubernetes.io/component: backend
|
|
17
|
+
template:
|
|
18
|
+
metadata:
|
|
19
|
+
labels:
|
|
20
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
21
|
+
app.kubernetes.io/component: backend
|
|
22
|
+
{%- if cookiecutter.enable_prometheus %}
|
|
23
|
+
annotations:
|
|
24
|
+
prometheus.io/scrape: "true"
|
|
25
|
+
prometheus.io/port: "{{ cookiecutter.backend_port }}"
|
|
26
|
+
prometheus.io/path: "/metrics"
|
|
27
|
+
{%- endif %}
|
|
28
|
+
spec:
|
|
29
|
+
containers:
|
|
30
|
+
- name: backend
|
|
31
|
+
image: {{ cookiecutter.project_slug }}:latest
|
|
32
|
+
imagePullPolicy: Always
|
|
33
|
+
ports:
|
|
34
|
+
- containerPort: {{ cookiecutter.backend_port }}
|
|
35
|
+
name: http
|
|
36
|
+
envFrom:
|
|
37
|
+
- configMapRef:
|
|
38
|
+
name: {{ cookiecutter.project_slug }}-config
|
|
39
|
+
- secretRef:
|
|
40
|
+
name: {{ cookiecutter.project_slug }}-secrets
|
|
41
|
+
resources:
|
|
42
|
+
requests:
|
|
43
|
+
memory: "256Mi"
|
|
44
|
+
cpu: "100m"
|
|
45
|
+
limits:
|
|
46
|
+
memory: "512Mi"
|
|
47
|
+
cpu: "500m"
|
|
48
|
+
livenessProbe:
|
|
49
|
+
httpGet:
|
|
50
|
+
path: /api/v1/health
|
|
51
|
+
port: {{ cookiecutter.backend_port }}
|
|
52
|
+
initialDelaySeconds: 10
|
|
53
|
+
periodSeconds: 30
|
|
54
|
+
timeoutSeconds: 5
|
|
55
|
+
failureThreshold: 3
|
|
56
|
+
readinessProbe:
|
|
57
|
+
httpGet:
|
|
58
|
+
path: /api/v1/ready
|
|
59
|
+
port: {{ cookiecutter.backend_port }}
|
|
60
|
+
initialDelaySeconds: 5
|
|
61
|
+
periodSeconds: 10
|
|
62
|
+
timeoutSeconds: 5
|
|
63
|
+
failureThreshold: 3
|
|
64
|
+
securityContext:
|
|
65
|
+
runAsNonRoot: true
|
|
66
|
+
runAsUser: 1000
|
|
67
|
+
allowPrivilegeEscalation: false
|
|
68
|
+
readOnlyRootFilesystem: true
|
|
69
|
+
restartPolicy: Always
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
{%- if cookiecutter.use_celery %}
|
|
73
|
+
# Celery Worker Deployment
|
|
74
|
+
apiVersion: apps/v1
|
|
75
|
+
kind: Deployment
|
|
76
|
+
metadata:
|
|
77
|
+
name: {{ cookiecutter.project_slug }}-celery-worker
|
|
78
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
79
|
+
labels:
|
|
80
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
81
|
+
app.kubernetes.io/component: celery-worker
|
|
82
|
+
spec:
|
|
83
|
+
replicas: 1
|
|
84
|
+
selector:
|
|
85
|
+
matchLabels:
|
|
86
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
87
|
+
app.kubernetes.io/component: celery-worker
|
|
88
|
+
template:
|
|
89
|
+
metadata:
|
|
90
|
+
labels:
|
|
91
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
92
|
+
app.kubernetes.io/component: celery-worker
|
|
93
|
+
spec:
|
|
94
|
+
containers:
|
|
95
|
+
- name: celery-worker
|
|
96
|
+
image: {{ cookiecutter.project_slug }}:latest
|
|
97
|
+
imagePullPolicy: Always
|
|
98
|
+
command: ["celery", "-A", "app.worker.celery_app", "worker", "--loglevel=info"]
|
|
99
|
+
envFrom:
|
|
100
|
+
- configMapRef:
|
|
101
|
+
name: {{ cookiecutter.project_slug }}-config
|
|
102
|
+
- secretRef:
|
|
103
|
+
name: {{ cookiecutter.project_slug }}-secrets
|
|
104
|
+
resources:
|
|
105
|
+
requests:
|
|
106
|
+
memory: "256Mi"
|
|
107
|
+
cpu: "100m"
|
|
108
|
+
limits:
|
|
109
|
+
memory: "512Mi"
|
|
110
|
+
cpu: "500m"
|
|
111
|
+
restartPolicy: Always
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
# Celery Beat Deployment
|
|
115
|
+
apiVersion: apps/v1
|
|
116
|
+
kind: Deployment
|
|
117
|
+
metadata:
|
|
118
|
+
name: {{ cookiecutter.project_slug }}-celery-beat
|
|
119
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
120
|
+
labels:
|
|
121
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
122
|
+
app.kubernetes.io/component: celery-beat
|
|
123
|
+
spec:
|
|
124
|
+
replicas: 1
|
|
125
|
+
selector:
|
|
126
|
+
matchLabels:
|
|
127
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
128
|
+
app.kubernetes.io/component: celery-beat
|
|
129
|
+
template:
|
|
130
|
+
metadata:
|
|
131
|
+
labels:
|
|
132
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
133
|
+
app.kubernetes.io/component: celery-beat
|
|
134
|
+
spec:
|
|
135
|
+
containers:
|
|
136
|
+
- name: celery-beat
|
|
137
|
+
image: {{ cookiecutter.project_slug }}:latest
|
|
138
|
+
imagePullPolicy: Always
|
|
139
|
+
command: ["celery", "-A", "app.worker.celery_app", "beat", "--loglevel=info"]
|
|
140
|
+
envFrom:
|
|
141
|
+
- configMapRef:
|
|
142
|
+
name: {{ cookiecutter.project_slug }}-config
|
|
143
|
+
- secretRef:
|
|
144
|
+
name: {{ cookiecutter.project_slug }}-secrets
|
|
145
|
+
resources:
|
|
146
|
+
requests:
|
|
147
|
+
memory: "128Mi"
|
|
148
|
+
cpu: "50m"
|
|
149
|
+
limits:
|
|
150
|
+
memory: "256Mi"
|
|
151
|
+
cpu: "200m"
|
|
152
|
+
restartPolicy: Always
|
|
153
|
+
{%- endif %}
|
|
154
|
+
|
|
155
|
+
{%- if cookiecutter.use_taskiq %}
|
|
156
|
+
---
|
|
157
|
+
# Taskiq Worker Deployment
|
|
158
|
+
apiVersion: apps/v1
|
|
159
|
+
kind: Deployment
|
|
160
|
+
metadata:
|
|
161
|
+
name: {{ cookiecutter.project_slug }}-taskiq-worker
|
|
162
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
163
|
+
labels:
|
|
164
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
165
|
+
app.kubernetes.io/component: taskiq-worker
|
|
166
|
+
spec:
|
|
167
|
+
replicas: 1
|
|
168
|
+
selector:
|
|
169
|
+
matchLabels:
|
|
170
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
171
|
+
app.kubernetes.io/component: taskiq-worker
|
|
172
|
+
template:
|
|
173
|
+
metadata:
|
|
174
|
+
labels:
|
|
175
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
176
|
+
app.kubernetes.io/component: taskiq-worker
|
|
177
|
+
spec:
|
|
178
|
+
containers:
|
|
179
|
+
- name: taskiq-worker
|
|
180
|
+
image: {{ cookiecutter.project_slug }}:latest
|
|
181
|
+
imagePullPolicy: Always
|
|
182
|
+
command: ["taskiq", "worker", "app.worker.taskiq_app:broker", "--workers", "2"]
|
|
183
|
+
envFrom:
|
|
184
|
+
- configMapRef:
|
|
185
|
+
name: {{ cookiecutter.project_slug }}-config
|
|
186
|
+
- secretRef:
|
|
187
|
+
name: {{ cookiecutter.project_slug }}-secrets
|
|
188
|
+
resources:
|
|
189
|
+
requests:
|
|
190
|
+
memory: "256Mi"
|
|
191
|
+
cpu: "100m"
|
|
192
|
+
limits:
|
|
193
|
+
memory: "512Mi"
|
|
194
|
+
cpu: "500m"
|
|
195
|
+
restartPolicy: Always
|
|
196
|
+
{%- endif %}
|
|
197
|
+
|
|
198
|
+
{%- if cookiecutter.use_arq %}
|
|
199
|
+
---
|
|
200
|
+
# ARQ Worker Deployment
|
|
201
|
+
apiVersion: apps/v1
|
|
202
|
+
kind: Deployment
|
|
203
|
+
metadata:
|
|
204
|
+
name: {{ cookiecutter.project_slug }}-arq-worker
|
|
205
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
206
|
+
labels:
|
|
207
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
208
|
+
app.kubernetes.io/component: arq-worker
|
|
209
|
+
spec:
|
|
210
|
+
replicas: 1
|
|
211
|
+
selector:
|
|
212
|
+
matchLabels:
|
|
213
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
214
|
+
app.kubernetes.io/component: arq-worker
|
|
215
|
+
template:
|
|
216
|
+
metadata:
|
|
217
|
+
labels:
|
|
218
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
219
|
+
app.kubernetes.io/component: arq-worker
|
|
220
|
+
spec:
|
|
221
|
+
containers:
|
|
222
|
+
- name: arq-worker
|
|
223
|
+
image: {{ cookiecutter.project_slug }}:latest
|
|
224
|
+
imagePullPolicy: Always
|
|
225
|
+
command: ["arq", "app.worker.arq_app.WorkerSettings"]
|
|
226
|
+
envFrom:
|
|
227
|
+
- configMapRef:
|
|
228
|
+
name: {{ cookiecutter.project_slug }}-config
|
|
229
|
+
- secretRef:
|
|
230
|
+
name: {{ cookiecutter.project_slug }}-secrets
|
|
231
|
+
resources:
|
|
232
|
+
requests:
|
|
233
|
+
memory: "256Mi"
|
|
234
|
+
cpu: "100m"
|
|
235
|
+
limits:
|
|
236
|
+
memory: "512Mi"
|
|
237
|
+
cpu: "500m"
|
|
238
|
+
restartPolicy: Always
|
|
239
|
+
{%- endif %}
|
|
240
|
+
{%- else %}
|
|
241
|
+
# Kubernetes is disabled for this project
|
|
242
|
+
{%- endif %}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_kubernetes %}
|
|
2
|
+
# Ingress for {{ cookiecutter.project_name }}
|
|
3
|
+
# Configure your domain and TLS settings before deploying
|
|
4
|
+
apiVersion: networking.k8s.io/v1
|
|
5
|
+
kind: Ingress
|
|
6
|
+
metadata:
|
|
7
|
+
name: {{ cookiecutter.project_slug }}-ingress
|
|
8
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
9
|
+
labels:
|
|
10
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
11
|
+
app.kubernetes.io/component: ingress
|
|
12
|
+
annotations:
|
|
13
|
+
# Nginx Ingress Controller annotations
|
|
14
|
+
nginx.ingress.kubernetes.io/proxy-body-size: "10m"
|
|
15
|
+
nginx.ingress.kubernetes.io/proxy-read-timeout: "60"
|
|
16
|
+
nginx.ingress.kubernetes.io/proxy-send-timeout: "60"
|
|
17
|
+
{%- if cookiecutter.enable_rate_limiting %}
|
|
18
|
+
# Rate limiting (adjust as needed)
|
|
19
|
+
nginx.ingress.kubernetes.io/limit-rps: "100"
|
|
20
|
+
nginx.ingress.kubernetes.io/limit-connections: "50"
|
|
21
|
+
{%- endif %}
|
|
22
|
+
# Uncomment for Let's Encrypt with cert-manager
|
|
23
|
+
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
24
|
+
spec:
|
|
25
|
+
ingressClassName: nginx
|
|
26
|
+
# Uncomment for TLS
|
|
27
|
+
# tls:
|
|
28
|
+
# - hosts:
|
|
29
|
+
# - api.example.com
|
|
30
|
+
# secretName: {{ cookiecutter.project_slug }}-tls
|
|
31
|
+
rules:
|
|
32
|
+
- host: api.example.com # Replace with your domain
|
|
33
|
+
http:
|
|
34
|
+
paths:
|
|
35
|
+
- path: /
|
|
36
|
+
pathType: Prefix
|
|
37
|
+
backend:
|
|
38
|
+
service:
|
|
39
|
+
name: {{ cookiecutter.project_slug }}-backend
|
|
40
|
+
port:
|
|
41
|
+
number: {{ cookiecutter.backend_port }}
|
|
42
|
+
{%- else %}
|
|
43
|
+
# Kubernetes is disabled for this project
|
|
44
|
+
{%- endif %}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_kubernetes %}
|
|
2
|
+
# Kustomization for {{ cookiecutter.project_name }}
|
|
3
|
+
# Deploy with: kubectl apply -k kubernetes/
|
|
4
|
+
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
5
|
+
kind: Kustomization
|
|
6
|
+
|
|
7
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
8
|
+
|
|
9
|
+
resources:
|
|
10
|
+
- namespace.yaml
|
|
11
|
+
- configmap.yaml
|
|
12
|
+
- secret.yaml
|
|
13
|
+
- deployment.yaml
|
|
14
|
+
- service.yaml
|
|
15
|
+
- ingress.yaml
|
|
16
|
+
|
|
17
|
+
commonLabels:
|
|
18
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
19
|
+
app.kubernetes.io/version: "0.1.0"
|
|
20
|
+
app.kubernetes.io/managed-by: kustomize
|
|
21
|
+
|
|
22
|
+
# Image customization (override in overlays)
|
|
23
|
+
images:
|
|
24
|
+
- name: {{ cookiecutter.project_slug }}
|
|
25
|
+
newTag: latest
|
|
26
|
+
{%- else %}
|
|
27
|
+
# Kubernetes is disabled for this project
|
|
28
|
+
{%- endif %}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_kubernetes %}
|
|
2
|
+
# Kubernetes Namespace for {{ cookiecutter.project_name }}
|
|
3
|
+
apiVersion: v1
|
|
4
|
+
kind: Namespace
|
|
5
|
+
metadata:
|
|
6
|
+
name: {{ cookiecutter.project_slug }}
|
|
7
|
+
labels:
|
|
8
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
9
|
+
app.kubernetes.io/managed-by: kubectl
|
|
10
|
+
{%- else %}
|
|
11
|
+
# Kubernetes is disabled for this project
|
|
12
|
+
{%- endif %}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_kubernetes %}
|
|
2
|
+
# Secret for {{ cookiecutter.project_name }}
|
|
3
|
+
# WARNING: Replace placeholder values before deploying!
|
|
4
|
+
# Consider using external secrets management (Vault, AWS Secrets Manager, etc.)
|
|
5
|
+
apiVersion: v1
|
|
6
|
+
kind: Secret
|
|
7
|
+
metadata:
|
|
8
|
+
name: {{ cookiecutter.project_slug }}-secrets
|
|
9
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
10
|
+
labels:
|
|
11
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
12
|
+
app.kubernetes.io/component: backend
|
|
13
|
+
type: Opaque
|
|
14
|
+
stringData:
|
|
15
|
+
{%- if cookiecutter.use_jwt %}
|
|
16
|
+
# Generate with: openssl rand -hex 32
|
|
17
|
+
SECRET_KEY: "CHANGE_ME_IN_PRODUCTION"
|
|
18
|
+
{%- endif %}
|
|
19
|
+
|
|
20
|
+
{%- if cookiecutter.use_api_key %}
|
|
21
|
+
API_KEY: "CHANGE_ME_IN_PRODUCTION"
|
|
22
|
+
{%- endif %}
|
|
23
|
+
|
|
24
|
+
{%- if cookiecutter.use_postgresql %}
|
|
25
|
+
POSTGRES_USER: "postgres"
|
|
26
|
+
POSTGRES_PASSWORD: "CHANGE_ME_IN_PRODUCTION"
|
|
27
|
+
{%- endif %}
|
|
28
|
+
|
|
29
|
+
{%- if cookiecutter.enable_redis %}
|
|
30
|
+
REDIS_PASSWORD: ""
|
|
31
|
+
{%- endif %}
|
|
32
|
+
|
|
33
|
+
{%- if cookiecutter.enable_logfire %}
|
|
34
|
+
LOGFIRE_TOKEN: ""
|
|
35
|
+
{%- endif %}
|
|
36
|
+
|
|
37
|
+
{%- if cookiecutter.enable_sentry %}
|
|
38
|
+
SENTRY_DSN: ""
|
|
39
|
+
{%- endif %}
|
|
40
|
+
|
|
41
|
+
{%- if cookiecutter.enable_ai_agent %}
|
|
42
|
+
{%- if cookiecutter.use_openai %}
|
|
43
|
+
OPENAI_API_KEY: ""
|
|
44
|
+
{%- endif %}
|
|
45
|
+
{%- if cookiecutter.use_anthropic %}
|
|
46
|
+
ANTHROPIC_API_KEY: ""
|
|
47
|
+
{%- endif %}
|
|
48
|
+
{%- if cookiecutter.use_openrouter %}
|
|
49
|
+
OPENROUTER_API_KEY: ""
|
|
50
|
+
{%- endif %}
|
|
51
|
+
{%- endif %}
|
|
52
|
+
|
|
53
|
+
{%- if cookiecutter.enable_oauth_google %}
|
|
54
|
+
GOOGLE_CLIENT_ID: ""
|
|
55
|
+
GOOGLE_CLIENT_SECRET: ""
|
|
56
|
+
{%- endif %}
|
|
57
|
+
{%- else %}
|
|
58
|
+
# Kubernetes is disabled for this project
|
|
59
|
+
{%- endif %}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{%- if cookiecutter.enable_kubernetes %}
|
|
2
|
+
# Service for {{ cookiecutter.project_name }} Backend
|
|
3
|
+
apiVersion: v1
|
|
4
|
+
kind: Service
|
|
5
|
+
metadata:
|
|
6
|
+
name: {{ cookiecutter.project_slug }}-backend
|
|
7
|
+
namespace: {{ cookiecutter.project_slug }}
|
|
8
|
+
labels:
|
|
9
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
10
|
+
app.kubernetes.io/component: backend
|
|
11
|
+
spec:
|
|
12
|
+
type: ClusterIP
|
|
13
|
+
ports:
|
|
14
|
+
- port: {{ cookiecutter.backend_port }}
|
|
15
|
+
targetPort: {{ cookiecutter.backend_port }}
|
|
16
|
+
protocol: TCP
|
|
17
|
+
name: http
|
|
18
|
+
selector:
|
|
19
|
+
app.kubernetes.io/name: {{ cookiecutter.project_slug }}
|
|
20
|
+
app.kubernetes.io/component: backend
|
|
21
|
+
{%- else %}
|
|
22
|
+
# Kubernetes is disabled for this project
|
|
23
|
+
{%- endif %}
|