ntc-dev-kit 1.0.5__tar.gz → 1.0.6__tar.gz
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.
- {ntc_dev_kit-1.0.5/ntc_dev_kit.egg-info → ntc_dev_kit-1.0.6}/PKG-INFO +1 -1
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/main.py +2 -2
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/drf_structure.md +83 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/structure.json +126 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/.entry/start_core_backend.sh +37 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/.entry/start_tasks_backend.sh +30 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/CLAUDE.md +194 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/README.md +117 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/config/http.conf +33 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/django_project/django_settings.txt +322 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/docker/docker-compose.yml +11 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/knowledge/knowledge_description.md +201 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/knowledge/knowledge_design_pattern.md +722 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/knowledge/knowledge_structure.md +151 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/root/README.md +307 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/root/django_env.txt +98 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/root/django_requirements.txt +24 -0
- ntc_dev_kit-1.0.6/ntc/templates/drf_structure/templates/root/gitignore.txt +6 -0
- ntc_dev_kit-1.0.6/ntc/templates/flutter/.gitignore +44 -0
- ntc_dev_kit-1.0.6/ntc/templates/flutter/.knowledge/knowledge_description.md +215 -0
- ntc_dev_kit-1.0.6/ntc/templates/flutter/.knowledge/knowledge_design_pattern.md +310 -0
- ntc_dev_kit-1.0.6/ntc/templates/flutter/.knowledge/knowledge_structure.md +83 -0
- ntc_dev_kit-1.0.6/ntc/templates/flutter/CLAUDE.md +190 -0
- ntc_dev_kit-1.0.6/ntc/templates/flutter/analysis_options.yaml +9 -0
- ntc_dev_kit-1.0.6/ntc/templates/flutter/pubspec.yaml +65 -0
- ntc_dev_kit-1.0.6/ntc/templates/flutter/structure.json +51 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/.env.example +10 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/.gitignore +36 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/CLAUDE.md +181 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/README.md +94 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/knowledge/knowledge_description.md +208 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/knowledge/knowledge_design_pattern.md +460 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/knowledge/knowledge_structure.md +75 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/package.json +25 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/src/app/globals.css +26 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/src/app/layout.tsx +59 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/src/app/page.tsx +21 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/src/components/Header.tsx +16 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/src/services/api.ts +81 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/src/utils/constants.ts +1 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/structure.json +32 -0
- ntc_dev_kit-1.0.6/ntc/templates/nextjs/tsconfig.json +27 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/.env.example +1 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/.gitignore +10 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/CLAUDE.md +210 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/README.md +72 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/index.html +13 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/knowledge/knowledge_description.md +202 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/knowledge/knowledge_design_pattern.md +448 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/knowledge/knowledge_structure.md +97 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/package.json +35 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/App.tsx +60 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/components/ProtectedRoute.tsx +16 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/components/Sidebar.tsx +90 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/components/TopNav.tsx +44 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/context/AuthContext.tsx +107 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/context/ThemeContext.tsx +34 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/context/WorkspaceContext.tsx +28 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/hooks/useApi.ts +39 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/index.css +34 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/layouts/AuthLayout.tsx +23 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/layouts/DashboardLayout.tsx +24 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/main.tsx +5 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/pages/DashboardPage.tsx +10 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/pages/auth/LoginPage.tsx +79 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/pages/auth/RegisterPage.tsx +93 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/services/api.service.ts +44 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/src/services/base.service.ts +193 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/structure.json +52 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/tsconfig.app.json +25 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/tsconfig.json +7 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/tsconfig.node.json +19 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_admin/vite.config.ts +13 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/CLAUDE.md +176 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/index.css +21 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/index.html +13 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/knowledge/knowledge_description.md +170 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/knowledge/knowledge_design_pattern.md +411 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/knowledge/knowledge_structure.md +74 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/package.json +32 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/src/App.tsx +63 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/src/components/Header.tsx +51 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/src/main.tsx +5 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/src/services/api.ts +90 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/src/utils/constants.ts +1 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/structure.json +65 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/tsconfig.app.json +25 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/tsconfig.json +7 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/tsconfig.node.json +19 -0
- ntc_dev_kit-1.0.6/ntc/templates/react_structure/vite.config.ts +12 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6/ntc_dev_kit.egg-info}/PKG-INFO +1 -1
- ntc_dev_kit-1.0.6/ntc_dev_kit.egg-info/SOURCES.txt +157 -0
- ntc_dev_kit-1.0.6/ntc_dev_kit.egg-info/top_level.txt +1 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/pyproject.toml +1 -1
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/setup.py +1 -1
- ntc_dev_kit-1.0.5/ntc_dev_kit.egg-info/SOURCES.txt +0 -69
- ntc_dev_kit-1.0.5/ntc_dev_kit.egg-info/top_level.txt +0 -1
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/LICENSE +0 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/MANIFEST.in +0 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/README.md +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/app_creator.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/cli.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/cli_enhanced.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/composer/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/composer/main.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/deployment/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/auth_app/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/auth_app/admin.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/auth_app/apps.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/auth_app/models.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/auth_app/serializers.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/auth_app/urls.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/auth_app/views.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/main.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/apps/app_admin.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/apps/app_apps.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/apps/app_models.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/apps/app_urls.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/apps/app_views.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/apps/common_apps.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/apps/common_models.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/config/gunicorn_config.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/base_model.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/formatter.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/logger.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/pagination.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/response_wrapper.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/services/azure/email/backend.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/services/azure/email/client.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/services/azure/email/notifier.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/core/services/object_storage.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/django_project/asgi.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/django_project/celery.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/django_project/dev_settings.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/django_project/management_command.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/django_project/prod_settings.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/django_project/schema.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/django_project/urls.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/django_project/wsgi.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/drf_structure/templates/root/manage.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/flutter/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/flutter/main.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/nextjs/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/nextjs/main.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/react_admin/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/react_admin/main.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/react_structure/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/templates/react_structure/main.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/ui/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/ui/app.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/utils/__init__.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/utils/environment.py +0 -0
- {ntc_dev_kit-1.0.5/ntc-main → ntc_dev_kit-1.0.6/ntc}/utils/output.py +0 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/ntc_dev_kit.egg-info/dependency_links.txt +0 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/ntc_dev_kit.egg-info/entry_points.txt +0 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/ntc_dev_kit.egg-info/requires.txt +0 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/requirements.txt +0 -0
- {ntc_dev_kit-1.0.5 → ntc_dev_kit-1.0.6}/setup.cfg +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Project/
|
|
2
|
+
├── .env
|
|
3
|
+
├── .gitignore
|
|
4
|
+
├── manage.py
|
|
5
|
+
├── requirements.txt
|
|
6
|
+
├── docker-compose.yml
|
|
7
|
+
├── Dockerfile.
|
|
8
|
+
├── captain-definition.
|
|
9
|
+
├── README.md
|
|
10
|
+
├── {project_name}/
|
|
11
|
+
│ ├── __init__.py
|
|
12
|
+
│ ├── asgi.py
|
|
13
|
+
│ ├── wsgi.py
|
|
14
|
+
│ ├── schema.py
|
|
15
|
+
│ ├── urls.py
|
|
16
|
+
│ ├── celery.py
|
|
17
|
+
│ ├── settings/
|
|
18
|
+
│ │ ├── __init__.py
|
|
19
|
+
│ │ ├── base.py
|
|
20
|
+
│ │ ├── dev.py
|
|
21
|
+
│ │ └── prod.py
|
|
22
|
+
├── apps/
|
|
23
|
+
│ ├── common/
|
|
24
|
+
│ │ ├── models.py
|
|
25
|
+
│ │ ├── serializers/
|
|
26
|
+
│ │ ├── services/
|
|
27
|
+
│ │ ├── tests/
|
|
28
|
+
│ ├── app/
|
|
29
|
+
│ │ ├── __init__.py
|
|
30
|
+
│ │ ├── permissions/
|
|
31
|
+
│ │ ├── serializers/
|
|
32
|
+
│ │ ├── selectors/
|
|
33
|
+
│ │ ├── services/
|
|
34
|
+
│ │ ├── socket/
|
|
35
|
+
│ │ ├── tasks/
|
|
36
|
+
│ │ ├── tests/
|
|
37
|
+
│ │ ├── admin.py
|
|
38
|
+
│ │ ├── apps.py
|
|
39
|
+
│ │ ├── models.py
|
|
40
|
+
│ │ ├── urls.py
|
|
41
|
+
│ │ └── views.py
|
|
42
|
+
│ └── app2/
|
|
43
|
+
│ ├── __init__.py
|
|
44
|
+
│ ├── permissions/
|
|
45
|
+
│ ├── serializers/
|
|
46
|
+
│ ├── selectors/
|
|
47
|
+
│ ├── services/
|
|
48
|
+
│ ├── socket/
|
|
49
|
+
│ ├── tasks/
|
|
50
|
+
│ ├── tests/
|
|
51
|
+
│ ├── admin.py
|
|
52
|
+
│ ├── apps.py
|
|
53
|
+
│ ├── models.py
|
|
54
|
+
│ ├── urls.py
|
|
55
|
+
│ └── views.py
|
|
56
|
+
├── core/
|
|
57
|
+
│ ├── __init__.py
|
|
58
|
+
│ ├── pagination.py
|
|
59
|
+
│ ├── base_model.py
|
|
60
|
+
│ ├── response_wrapper.py
|
|
61
|
+
│ ├── permissions/
|
|
62
|
+
│ ├── exceptions/
|
|
63
|
+
│ ├── signals/
|
|
64
|
+
│ ├── utils/
|
|
65
|
+
│ ├── middlewares/
|
|
66
|
+
│ ├── services/
|
|
67
|
+
│ │ ├── __init__.py
|
|
68
|
+
│ │ ├── azure/
|
|
69
|
+
│ │ │ ├── __init__.py
|
|
70
|
+
│ │ │ ├── email/
|
|
71
|
+
│ │ │ ├── sms/
|
|
72
|
+
│ │ │ ├── storage/
|
|
73
|
+
│ │ │ ├── test.py
|
|
74
|
+
│ │ ├── aws/
|
|
75
|
+
│ │ │ ├── __init__.py
|
|
76
|
+
│ │ │ ├── email/
|
|
77
|
+
│ │ │ ├── sms/
|
|
78
|
+
│ │ │ ├── storage/
|
|
79
|
+
│ │ │ ├── test.py
|
|
80
|
+
│ ├── logging/
|
|
81
|
+
│ │ ├── __init__.py
|
|
82
|
+
│ │ ├── formatter.py
|
|
83
|
+
│ │ ├── logger.py
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
".env": { "template": "templates/root/django_env.txt" },
|
|
3
|
+
".gitignore": { "template": "templates/root/gitignore.txt" },
|
|
4
|
+
"requirements.txt": { "template": "templates/root/django_requirements.txt" },
|
|
5
|
+
"CLAUDE.md": { "template": "templates/CLAUDE.md" },
|
|
6
|
+
"Dockerfile": { "template": "templates/docker/Dockerfile" },
|
|
7
|
+
"docker-compose.yml": { "template": "templates/docker/docker-compose.yml" },
|
|
8
|
+
".knowledge": {
|
|
9
|
+
"knowledge_structure.md": {
|
|
10
|
+
"template": "templates/knowledge/knowledge_structure.md"
|
|
11
|
+
},
|
|
12
|
+
"knowledge_description.md": {
|
|
13
|
+
"template": "templates/knowledge/knowledge_description.md"
|
|
14
|
+
},
|
|
15
|
+
"knowledge_design_pattern.md": {
|
|
16
|
+
"template": "templates/knowledge/knowledge_design_pattern.md"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
".entry": {
|
|
20
|
+
"start_core_backend.sh": {
|
|
21
|
+
"template": "templates/.entry/start_core_backend.sh"
|
|
22
|
+
},
|
|
23
|
+
"start_tasks_backend.sh": {
|
|
24
|
+
"template": "templates/.entry/start_tasks_backend.sh"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"config": {
|
|
28
|
+
"gunicorn_config.py": {
|
|
29
|
+
"template": "templates/config/gunicorn_config.py"
|
|
30
|
+
},
|
|
31
|
+
"http.conf": { "template": "templates/config/http.conf" }
|
|
32
|
+
},
|
|
33
|
+
"manage.py": { "template": "templates/root/manage.py" },
|
|
34
|
+
"apps": {
|
|
35
|
+
"__init__.py": "",
|
|
36
|
+
"common": {
|
|
37
|
+
"__init__.py": "",
|
|
38
|
+
"apps.py": { "template": "templates/apps/common_apps.py" },
|
|
39
|
+
"models.py": { "template": "templates/apps/common_models.py" },
|
|
40
|
+
"serializers": {
|
|
41
|
+
"__init__.py": ""
|
|
42
|
+
},
|
|
43
|
+
"services": {
|
|
44
|
+
"__init__.py": ""
|
|
45
|
+
},
|
|
46
|
+
"tests": {
|
|
47
|
+
"__init__.py": ""
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"core": {
|
|
52
|
+
"__init__.py": "",
|
|
53
|
+
"pagination.py": { "template": "templates/core/pagination.py" },
|
|
54
|
+
"base_model.py": { "template": "templates/core/base_model.py" },
|
|
55
|
+
"response_wrapper.py": { "template": "templates/core/response_wrapper.py" },
|
|
56
|
+
"permissions": {
|
|
57
|
+
"__init__.py": ""
|
|
58
|
+
},
|
|
59
|
+
"exceptions": {
|
|
60
|
+
"__init__.py": ""
|
|
61
|
+
},
|
|
62
|
+
"signals": {
|
|
63
|
+
"__init__.py": ""
|
|
64
|
+
},
|
|
65
|
+
"utils": {
|
|
66
|
+
"__init__.py": ""
|
|
67
|
+
},
|
|
68
|
+
"middlewares": {
|
|
69
|
+
"__init__.py": ""
|
|
70
|
+
},
|
|
71
|
+
"services": {
|
|
72
|
+
"__init__.py": "",
|
|
73
|
+
"object_storage.py": { "template": "templates/core/services/object_storage.py" },
|
|
74
|
+
"azure": {
|
|
75
|
+
"__init__.py": "",
|
|
76
|
+
"email": {
|
|
77
|
+
"__init__.py": "",
|
|
78
|
+
"backend.py": { "template": "templates/core/services/azure/email/backend.py" },
|
|
79
|
+
"client.py": { "template": "templates/core/services/azure/email/client.py" },
|
|
80
|
+
"notifier.py": { "template": "templates/core/services/azure/email/notifier.py" }
|
|
81
|
+
},
|
|
82
|
+
"sms": {
|
|
83
|
+
"__init__.py": ""
|
|
84
|
+
},
|
|
85
|
+
"storage": {
|
|
86
|
+
"__init__.py": ""
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"aws": {
|
|
90
|
+
"__init__.py": "",
|
|
91
|
+
"email": {
|
|
92
|
+
"__init__.py": ""
|
|
93
|
+
},
|
|
94
|
+
"sms": {
|
|
95
|
+
"__init__.py": ""
|
|
96
|
+
},
|
|
97
|
+
"storage": {
|
|
98
|
+
"__init__.py": ""
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"logging": {
|
|
103
|
+
"__init__.py": "",
|
|
104
|
+
"formatter.py": { "template": "templates/core/formatter.py" },
|
|
105
|
+
"logger.py": { "template": "templates/core/logger.py" }
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"{project_name}": {
|
|
109
|
+
"__init__.py": "",
|
|
110
|
+
"commands": {
|
|
111
|
+
"__init__.py": "",
|
|
112
|
+
"create_app.py": { "template": "templates/django_project/management_command.py" }
|
|
113
|
+
},
|
|
114
|
+
"asgi.py": { "template": "templates/django_project/asgi.py" },
|
|
115
|
+
"wsgi.py": { "template": "templates/django_project/wsgi.py" },
|
|
116
|
+
"urls.py": { "template": "templates/django_project/urls.py" },
|
|
117
|
+
"schema.py": { "template": "templates/django_project/schema.py" },
|
|
118
|
+
"celery.py": { "template": "templates/django_project/celery.py" },
|
|
119
|
+
"settings": {
|
|
120
|
+
"__init__.py": "",
|
|
121
|
+
"base.py": { "template": "templates/django_project/django_settings.txt" },
|
|
122
|
+
"dev.py": { "template": "templates/django_project/dev_settings.py" },
|
|
123
|
+
"prod.py": { "template": "templates/django_project/prod_settings.py" }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Ensure timezone is correctly set
|
|
4
|
+
export TZ=Africa/Dar_es_Salaam
|
|
5
|
+
|
|
6
|
+
# Create logs directory if it doesn't exist
|
|
7
|
+
mkdir -p logs
|
|
8
|
+
|
|
9
|
+
echo "Starting backend services..."
|
|
10
|
+
echo "Logs will be shown in terminal and saved to log files"
|
|
11
|
+
|
|
12
|
+
# Start nginx
|
|
13
|
+
echo "Starting nginx..."
|
|
14
|
+
nginx -g 'daemon off;' 2>&1 | tee logs/nginx.log &
|
|
15
|
+
NGINX_PID=$!
|
|
16
|
+
|
|
17
|
+
# Start gunicorn
|
|
18
|
+
echo "Starting gunicorn..."
|
|
19
|
+
gunicorn -c config/gunicorn_config.py {project_name}.asgi:application 2>&1 | tee logs/gunicorn.log &
|
|
20
|
+
GUNICORN_PID=$!
|
|
21
|
+
|
|
22
|
+
echo "Backend services started!"
|
|
23
|
+
echo " - Nginx PID: $NGINX_PID"
|
|
24
|
+
echo " - Gunicorn PID: $GUNICORN_PID"
|
|
25
|
+
|
|
26
|
+
# Function to cleanup on exit
|
|
27
|
+
cleanup() {
|
|
28
|
+
echo "Stopping all backend processes..."
|
|
29
|
+
kill $NGINX_PID $GUNICORN_PID 2>/dev/null
|
|
30
|
+
exit 0
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# Set trap to cleanup on script exit
|
|
34
|
+
trap cleanup SIGINT SIGTERM
|
|
35
|
+
|
|
36
|
+
# Keep script running
|
|
37
|
+
wait
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Ensure timezone is correctly set
|
|
4
|
+
export TZ=Africa/Dar_es_Salaam
|
|
5
|
+
|
|
6
|
+
# Create logs directory if it doesn't exist
|
|
7
|
+
mkdir -p logs
|
|
8
|
+
|
|
9
|
+
echo "Starting Celery worker..."
|
|
10
|
+
echo "Logs will be shown in terminal and saved to log files"
|
|
11
|
+
|
|
12
|
+
# Start Celery worker
|
|
13
|
+
celery -A {project_name} worker -l INFO 2>&1 | tee logs/celery.log &
|
|
14
|
+
CELERY_PID=$!
|
|
15
|
+
|
|
16
|
+
echo "Celery worker started!"
|
|
17
|
+
echo " - Celery PID: $CELERY_PID"
|
|
18
|
+
|
|
19
|
+
# Function to cleanup on exit
|
|
20
|
+
cleanup() {
|
|
21
|
+
echo "Stopping Celery worker..."
|
|
22
|
+
kill $CELERY_PID 2>/dev/null
|
|
23
|
+
exit 0
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
# Set trap to cleanup on script exit
|
|
27
|
+
trap cleanup SIGINT SIGTERM
|
|
28
|
+
|
|
29
|
+
# Keep script running
|
|
30
|
+
wait
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# AI Agent Instructions for NTC-Generated Django Projects
|
|
2
|
+
|
|
3
|
+
This document provides specific instructions for AI agents (Claude, GPT, etc.) working with NTC-generated Django REST Framework projects.
|
|
4
|
+
|
|
5
|
+
## 📖 Knowledge Base Reading Order
|
|
6
|
+
|
|
7
|
+
When first approaching this codebase, AI agents should read the knowledge files in this order:
|
|
8
|
+
|
|
9
|
+
1. **CLAUDE.md** (this file) - AI agent specific instructions
|
|
10
|
+
2. **knowledge/knowledge_structure.md** - Project structure and organization
|
|
11
|
+
3. **knowledge/knowledge_description.md** - Architecture overview and technical stack
|
|
12
|
+
4. **knowledge/knowledge_design_pattern.md** - Design patterns and coding conventions
|
|
13
|
+
|
|
14
|
+
## 🤖 AI Agent Guidelines
|
|
15
|
+
|
|
16
|
+
### Before Making Changes
|
|
17
|
+
|
|
18
|
+
1. **Read the Knowledge Base**: Always read the knowledge files before making any changes to understand the project structure and conventions.
|
|
19
|
+
|
|
20
|
+
2. **Understand the NTC Structure**: This project follows the NTC (Nexent Toolkit Console) structure with specific patterns for apps, services, selectors, and core utilities.
|
|
21
|
+
|
|
22
|
+
3. **Check Existing Implementations**: Before adding new features, check if similar implementations already exist in `core/` or `apps/common/`.
|
|
23
|
+
|
|
24
|
+
### Code Modification Rules
|
|
25
|
+
|
|
26
|
+
1. **Follow Service/Selector Pattern**:
|
|
27
|
+
- Views should only handle HTTP requests/responses
|
|
28
|
+
- Business logic goes in `services/`
|
|
29
|
+
- Data querying goes in `selectors/`
|
|
30
|
+
- Never put business logic in views
|
|
31
|
+
|
|
32
|
+
2. **Use Standardized Responses**: Always use `success_response()` and `error_response()` from `core.response_wrapper` for consistent API responses.
|
|
33
|
+
|
|
34
|
+
3. **Inherit from Base Models**: Use `TimeStampedModel` from `apps.common.models` or `BaseModel` from `core.base_model` for automatic timestamp fields.
|
|
35
|
+
|
|
36
|
+
4. **Use Environment Variables**: All configuration should use environment variables via `django-environ`, never hardcode values.
|
|
37
|
+
|
|
38
|
+
5. **Follow Naming Conventions**:
|
|
39
|
+
- Models: `PascalCase` (e.g., `UserProfile`)
|
|
40
|
+
- Functions/Views: `snake_case` (e.g., `create_user_view`)
|
|
41
|
+
- URLs: `kebab-case` (e.g., `/api/user-profile/`)
|
|
42
|
+
- Classes: `PascalCase`
|
|
43
|
+
- Variables: `snake_case`
|
|
44
|
+
- Constants: `UPPER_SNAKE_CASE`
|
|
45
|
+
|
|
46
|
+
### External Service Integration
|
|
47
|
+
|
|
48
|
+
1. **Azure Communication Services (Email)**:
|
|
49
|
+
- Use `core.services.azure.email.send_template_email()` for sending emails
|
|
50
|
+
- Email templates should be in Django templates directory
|
|
51
|
+
- Supports HTML and plain text versions
|
|
52
|
+
- Falls back to console backend in development if credentials not configured
|
|
53
|
+
|
|
54
|
+
2. **Cloudflare R2 Storage**:
|
|
55
|
+
- Use `core.services.object_storage.ObjectStorageService` for file operations
|
|
56
|
+
- Supports file upload, download, delete, and URL-based uploads
|
|
57
|
+
- Validates file types and sizes
|
|
58
|
+
- Handles image dimension extraction
|
|
59
|
+
|
|
60
|
+
3. **Sentry Error Tracking**:
|
|
61
|
+
- Automatically configured via `SENTRY_DSN` environment variable
|
|
62
|
+
- Captures all log levels and errors
|
|
63
|
+
- Includes performance monitoring
|
|
64
|
+
|
|
65
|
+
### Docker and Deployment
|
|
66
|
+
|
|
67
|
+
1. **Production-Ready Docker Setup**:
|
|
68
|
+
- Uses Python 3.12-slim base image
|
|
69
|
+
- Includes nginx reverse proxy with WebSocket support
|
|
70
|
+
- Uses uvicorn workers with gunicorn for async performance
|
|
71
|
+
- Entry scripts in `.entry/` directory manage service startup
|
|
72
|
+
|
|
73
|
+
2. **Configuration Files**:
|
|
74
|
+
- `config/gunicorn_config.py` - Gunicorn configuration
|
|
75
|
+
- `config/http.conf` - Nginx configuration
|
|
76
|
+
- `.entry/start_core_backend.sh` - Core backend startup script
|
|
77
|
+
- `.entry/start_tasks_backend.sh` - Celery worker startup script
|
|
78
|
+
|
|
79
|
+
### Settings Configuration
|
|
80
|
+
|
|
81
|
+
1. **Environment-Based Settings**:
|
|
82
|
+
- `settings/base.py` - Shared settings
|
|
83
|
+
- `settings/dev.py` - Development settings
|
|
84
|
+
- `settings/prod.py` - Production settings
|
|
85
|
+
- ASGI and WSGI use production settings by default in Docker
|
|
86
|
+
|
|
87
|
+
2. **Key Environment Variables**:
|
|
88
|
+
- `DEBUG` - Set to `False` in production
|
|
89
|
+
- `SENTRY_DSN` - Sentry error tracking DSN
|
|
90
|
+
- `AZURE_COMMUNICATION_ENDPOINT` - Azure email endpoint
|
|
91
|
+
- `AZURE_COMMUNICATION_ACCESS_KEY` - Azure email access key
|
|
92
|
+
- `R2_ACCOUNT_ID`, `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY` - Cloudflare R2 credentials
|
|
93
|
+
- `R2_PUBLIC_BASE_URL` - Public URL for R2 bucket
|
|
94
|
+
|
|
95
|
+
### Common Tasks
|
|
96
|
+
|
|
97
|
+
1. **Creating New Apps**: Use `ntc create app app_name` command which creates the proper structure automatically.
|
|
98
|
+
|
|
99
|
+
2. **Adding New Services**:
|
|
100
|
+
- Place in `core/services/` for project-wide services
|
|
101
|
+
- Place in `apps/app_name/services/` for app-specific services
|
|
102
|
+
- Follow the existing service patterns in `core/services/azure/`
|
|
103
|
+
|
|
104
|
+
3. **Adding Database Models**:
|
|
105
|
+
- Inherit from `TimeStampedModel` or `BaseModel`
|
|
106
|
+
- Add proper field types and constraints
|
|
107
|
+
- Create and run migrations: `python manage.py makemigrations` and `python manage.py migrate`
|
|
108
|
+
|
|
109
|
+
4. **Adding API Endpoints**:
|
|
110
|
+
- Create views in `apps/app_name/views.py`
|
|
111
|
+
- Add URL patterns in `apps/app_name/urls.py`
|
|
112
|
+
- Create serializers in `apps/app_name/serializers/`
|
|
113
|
+
- Use response wrappers for consistent responses
|
|
114
|
+
|
|
115
|
+
### Testing
|
|
116
|
+
|
|
117
|
+
1. **Test Structure**: Each app should have a `tests/` directory with test files mirroring the app structure.
|
|
118
|
+
|
|
119
|
+
2. **Test Utilities**: Use `apps.common.tests` for shared test utilities and fixtures.
|
|
120
|
+
|
|
121
|
+
3. **Run Tests**: Use `python manage.py test` to run the test suite.
|
|
122
|
+
|
|
123
|
+
### Security Considerations
|
|
124
|
+
|
|
125
|
+
1. **Never Commit Secrets**: Environment variables should never be committed to the repository.
|
|
126
|
+
|
|
127
|
+
2. **Use JWT for Authentication**: All API endpoints requiring authentication should use JWT tokens.
|
|
128
|
+
|
|
129
|
+
3. **Validate Inputs**: Always validate user inputs using serializers and service-level validation.
|
|
130
|
+
|
|
131
|
+
4. **SQL Injection Prevention**: Use Django ORM queries, never raw SQL with user input.
|
|
132
|
+
|
|
133
|
+
### When to Ask for Clarification
|
|
134
|
+
|
|
135
|
+
1. If you're unsure about the NTC structure or conventions
|
|
136
|
+
2. If you need to add a new external service integration
|
|
137
|
+
3. If you're modifying core framework files (`core/` directory)
|
|
138
|
+
4. If you're changing the Docker configuration
|
|
139
|
+
5. If you're modifying the authentication system
|
|
140
|
+
|
|
141
|
+
## 🎯 Quick Reference
|
|
142
|
+
|
|
143
|
+
### Import Patterns
|
|
144
|
+
```python
|
|
145
|
+
# Response wrapper
|
|
146
|
+
from core.response_wrapper import success_response, error_response
|
|
147
|
+
|
|
148
|
+
# Base models
|
|
149
|
+
from apps.common.models import TimeStampedModel
|
|
150
|
+
from core.base_model import BaseModel
|
|
151
|
+
|
|
152
|
+
# Pagination
|
|
153
|
+
from core.pagination import StandardResultsSetPagination
|
|
154
|
+
|
|
155
|
+
# Azure email
|
|
156
|
+
from core.services.azure.email import send_template_email
|
|
157
|
+
|
|
158
|
+
# Object storage
|
|
159
|
+
from core.services.object_storage import ObjectStorageService
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Common Patterns
|
|
163
|
+
```python
|
|
164
|
+
# Success response
|
|
165
|
+
return success_response(data={"id": 123}, message="Created successfully")
|
|
166
|
+
|
|
167
|
+
# Error response
|
|
168
|
+
return error_response(message="Invalid input", code=400)
|
|
169
|
+
|
|
170
|
+
# Send email
|
|
171
|
+
send_template_email(
|
|
172
|
+
subject="Welcome",
|
|
173
|
+
to="user@example.com",
|
|
174
|
+
template="welcome_email",
|
|
175
|
+
context={"name": "John"}
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
# Upload file to R2
|
|
179
|
+
storage = ObjectStorageService()
|
|
180
|
+
public_url, key = storage.upload_file(uploaded_file, "path/to/file")
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## 📝 Additional Resources
|
|
184
|
+
|
|
185
|
+
- Django REST Framework Documentation: https://www.django-rest-framework.org/
|
|
186
|
+
- Celery Documentation: https://docs.celeryproject.org/
|
|
187
|
+
- Azure Communication Services: https://docs.microsoft.com/azure/communication-services/
|
|
188
|
+
- Cloudflare R2 Documentation: https://developers.cloudflare.com/r2/
|
|
189
|
+
- Sentry Documentation: https://docs.sentry.io/
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
**Last Updated**: 2026-05-09
|
|
194
|
+
**Template Version**: Enhanced with Docker, Azure Email, Sentry, and R2 Storage
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# NTC Django REST Framework Templates
|
|
2
|
+
|
|
3
|
+
This directory contains organized template files for generating Django REST Framework projects with the NTC structure.
|
|
4
|
+
|
|
5
|
+
## 📁 Directory Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
templates/
|
|
9
|
+
├── root/ # Root project files
|
|
10
|
+
│ ├── README.md # Project documentation template
|
|
11
|
+
│ ├── manage.py # Django management script
|
|
12
|
+
│ ├── gitignore.txt # Git ignore patterns
|
|
13
|
+
│ ├── django_env.txt # Environment variables template
|
|
14
|
+
│ └── django_requirements.txt # Python dependencies
|
|
15
|
+
├── django_project/ # Django project configuration
|
|
16
|
+
│ ├── asgi.py # ASGI application entry point
|
|
17
|
+
│ ├── wsgi.py # WSGI application entry point
|
|
18
|
+
│ ├── celery.py # Celery task configuration
|
|
19
|
+
│ ├── schema.py # API schema configuration
|
|
20
|
+
│ ├── urls.py # Main URL routing
|
|
21
|
+
│ ├── django_settings.txt # Base Django settings
|
|
22
|
+
│ ├── dev_settings.py # Development settings
|
|
23
|
+
│ ├── prod_settings.py # Production settings
|
|
24
|
+
│ └── management_command.py # Custom management command
|
|
25
|
+
├── apps/ # Django app templates
|
|
26
|
+
│ ├── app_admin.py # Django admin configuration
|
|
27
|
+
│ ├── app_apps.py # App configuration
|
|
28
|
+
│ ├── app_models.py # Model definitions
|
|
29
|
+
│ ├── app_urls.py # App URL patterns
|
|
30
|
+
│ ├── app_views.py # API views with test endpoint
|
|
31
|
+
│ ├── common_apps.py # Common app configuration
|
|
32
|
+
│ └── common_models.py # Shared base models
|
|
33
|
+
├── core/ # Core framework utilities
|
|
34
|
+
│ ├── base_model.py # Abstract base model
|
|
35
|
+
│ ├── pagination.py # DRF pagination classes
|
|
36
|
+
│ ├── response_wrapper.py # Standardized API responses
|
|
37
|
+
│ ├── formatter.py # Logging formatter
|
|
38
|
+
│ └── logger.py # Logger configuration
|
|
39
|
+
├── docker/ # Docker and deployment
|
|
40
|
+
│ ├── Dockerfile # Docker build instructions
|
|
41
|
+
│ ├── docker-compose.yml # Local development environment
|
|
42
|
+
│ └── captain-definition # CapRover deployment config
|
|
43
|
+
└── knowledge/ # AI documentation
|
|
44
|
+
├── knowledge_structure.md # Project structure guide
|
|
45
|
+
├── knowledge_description.md # Project overview
|
|
46
|
+
└── knowledge_design_pattern.md # Design patterns guide
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 🎯 Template Categories
|
|
50
|
+
|
|
51
|
+
### **Root Templates** (`root/`)
|
|
52
|
+
Files that go in the project root directory:
|
|
53
|
+
- Project documentation and setup files
|
|
54
|
+
- Environment configuration
|
|
55
|
+
- Dependencies and requirements
|
|
56
|
+
|
|
57
|
+
### **Django Project Templates** (`django_project/`)
|
|
58
|
+
Django project configuration files:
|
|
59
|
+
- ASGI/WSGI application entry points
|
|
60
|
+
- Settings modules (base, dev, prod)
|
|
61
|
+
- URL routing and API schema
|
|
62
|
+
- Custom management commands
|
|
63
|
+
|
|
64
|
+
### **App Templates** (`apps/`)
|
|
65
|
+
Django application templates:
|
|
66
|
+
- Standard Django app files (admin, apps, models, urls, views)
|
|
67
|
+
- Common/shared app components
|
|
68
|
+
- Pre-configured with NTC patterns
|
|
69
|
+
|
|
70
|
+
### **Core Templates** (`core/`)
|
|
71
|
+
Framework utilities and extensions:
|
|
72
|
+
- Base models and pagination
|
|
73
|
+
- Response wrappers and logging
|
|
74
|
+
- Reusable core components
|
|
75
|
+
|
|
76
|
+
### **Docker Templates** (`docker/`)
|
|
77
|
+
Containerization and deployment:
|
|
78
|
+
- Docker build and compose files
|
|
79
|
+
- Deployment configurations
|
|
80
|
+
|
|
81
|
+
### **Knowledge Templates** (`knowledge/`)
|
|
82
|
+
AI-friendly documentation:
|
|
83
|
+
- Project structure documentation
|
|
84
|
+
- Design patterns and conventions
|
|
85
|
+
- Development guidelines
|
|
86
|
+
|
|
87
|
+
## 🔧 Usage
|
|
88
|
+
|
|
89
|
+
Templates are referenced in `structure.json` using paths like:
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"file.py": { "template": "drf_structure/templates/category/template_name.py" }
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## 📝 Template Variables
|
|
97
|
+
|
|
98
|
+
Templates support variable replacement:
|
|
99
|
+
- `{project_name}` - Project name
|
|
100
|
+
- `{app_name}` - App name (for app templates)
|
|
101
|
+
- `{app_name_title}` - Titleized app name
|
|
102
|
+
- `{secret_key}` - Generated secret key
|
|
103
|
+
|
|
104
|
+
## 🎨 Benefits of Organization
|
|
105
|
+
|
|
106
|
+
1. **Maintainability**: Easy to find and update specific templates
|
|
107
|
+
2. **Clarity**: Clear separation of concerns by category
|
|
108
|
+
3. **Scalability**: Easy to add new templates in appropriate categories
|
|
109
|
+
4. **Consistency**: Organized structure matches generated project structure
|
|
110
|
+
5. **Documentation**: Clear understanding of template purposes
|
|
111
|
+
|
|
112
|
+
## 🔄 Adding New Templates
|
|
113
|
+
|
|
114
|
+
1. Place template in appropriate category directory
|
|
115
|
+
2. Update `structure.json` with correct path
|
|
116
|
+
3. Add variable replacement if needed
|
|
117
|
+
4. Update this README if adding new categories
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
server {
|
|
2
|
+
listen 80;
|
|
3
|
+
server_name localhost;
|
|
4
|
+
|
|
5
|
+
# WebSocket endpoint
|
|
6
|
+
location /ws/ {
|
|
7
|
+
proxy_pass http://0.0.0.0:8000;
|
|
8
|
+
proxy_http_version 1.1;
|
|
9
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
10
|
+
proxy_set_header Connection "upgrade";
|
|
11
|
+
proxy_set_header Host $host;
|
|
12
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
13
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
14
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
15
|
+
|
|
16
|
+
# WebSocket timeout settings
|
|
17
|
+
proxy_read_timeout 86400;
|
|
18
|
+
proxy_send_timeout 86400;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
location / {
|
|
22
|
+
proxy_pass http://0.0.0.0:8000;
|
|
23
|
+
proxy_set_header Host $host;
|
|
24
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
25
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
26
|
+
# Always tell Django the original scheme is HTTPS (handled by outer proxy/CDN)
|
|
27
|
+
proxy_set_header X-Forwarded-Proto https;
|
|
28
|
+
client_max_body_size 5G;
|
|
29
|
+
proxy_connect_timeout 300s;
|
|
30
|
+
proxy_send_timeout 300s;
|
|
31
|
+
proxy_read_timeout 300s;
|
|
32
|
+
}
|
|
33
|
+
}
|