django-angular3 0.1.0__tar.gz → 0.2.0__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.
Files changed (109) hide show
  1. {django_angular3-0.1.0 → django_angular3-0.2.0}/MANIFEST.in +1 -1
  2. django_angular3-0.2.0/PKG-INFO +365 -0
  3. django_angular3-0.2.0/README.md +325 -0
  4. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/__init__.py +1 -1
  5. django_angular3-0.2.0/django_angular3/angular.py +791 -0
  6. django_angular3-0.2.0/django_angular3/changes.py +212 -0
  7. django_angular3-0.2.0/django_angular3/cli.py +517 -0
  8. django_angular3-0.2.0/django_angular3/command_translation.py +171 -0
  9. django_angular3-0.2.0/django_angular3/config.py +140 -0
  10. django_angular3-0.2.0/django_angular3/config_changes.py +223 -0
  11. django_angular3-0.2.0/django_angular3/examples/01_simple_crm/app.openui.json +37 -0
  12. django_angular3-0.2.0/django_angular3/examples/01_simple_crm/django-angular3-simple_crm.json +10 -0
  13. django_angular3-0.2.0/django_angular3/examples/01_simple_crm/django-angular3.json +54 -0
  14. django_angular3-0.2.0/django_angular3/examples/01_simple_crm/schema.yaml +267 -0
  15. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/simple_crm/settings.py +0 -13
  16. django_angular3-0.2.0/django_angular3/external_comparisons.py +151 -0
  17. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/_base.py +8 -11
  18. django_angular3-0.2.0/django_angular3/management/commands/build_app.py +227 -0
  19. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/export_schema.py +26 -30
  20. django_angular3-0.2.0/django_angular3/management/commands/ng_complex_component.py +39 -0
  21. django_angular3-0.2.0/django_angular3/management/commands/ng_component.py +21 -0
  22. django_angular3-0.2.0/django_angular3/management/commands/ng_data_service.py +30 -0
  23. django_angular3-0.2.0/django_angular3/management/commands/ng_material_setup.py +44 -0
  24. django_angular3-0.2.0/django_angular3/management/commands/ng_openapi_setup.py +45 -0
  25. django_angular3-0.2.0/django_angular3/management/commands/ng_page.py +33 -0
  26. django_angular3-0.2.0/django_angular3/management/commands/ng_reactive_form.py +25 -0
  27. django_angular3-0.2.0/django_angular3/management/commands/ng_site.py +34 -0
  28. django_angular3-0.2.0/django_angular3/management/commands/validate_project.py +30 -0
  29. django_angular3-0.2.0/django_angular3/openapi_changes.py +346 -0
  30. django_angular3-0.2.0/django_angular3/settings.py +365 -0
  31. django_angular3-0.2.0/django_angular3/templates/django_angular3/django-angular3-project.json +10 -0
  32. django_angular3-0.2.0/django_angular3/templates/django_angular3/django-angular3.json +54 -0
  33. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/tools.py +66 -19
  34. django_angular3-0.2.0/django_angular3/validation.py +137 -0
  35. django_angular3-0.2.0/django_angular3.egg-info/PKG-INFO +365 -0
  36. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3.egg-info/SOURCES.txt +30 -4
  37. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3.egg-info/requires.txt +3 -0
  38. {django_angular3-0.1.0 → django_angular3-0.2.0}/pyproject.toml +6 -4
  39. django_angular3-0.2.0/tests/test_angular_commands.py +874 -0
  40. django_angular3-0.2.0/tests/test_changes.py +119 -0
  41. django_angular3-0.2.0/tests/test_cli.py +133 -0
  42. django_angular3-0.2.0/tests/test_cli_scaffold.py +481 -0
  43. django_angular3-0.2.0/tests/test_command_translation.py +143 -0
  44. django_angular3-0.2.0/tests/test_config_changes.py +217 -0
  45. {django_angular3-0.1.0 → django_angular3-0.2.0}/tests/test_export_schema.py +148 -71
  46. django_angular3-0.2.0/tests/test_external_comparisons.py +141 -0
  47. django_angular3-0.2.0/tests/test_ngdj_requirements.py +259 -0
  48. django_angular3-0.2.0/tests/test_openapi_changes.py +122 -0
  49. django_angular3-0.2.0/tests/test_openapi_validation.py +72 -0
  50. django_angular3-0.2.0/tests/test_skill_creation.py +45 -0
  51. {django_angular3-0.1.0 → django_angular3-0.2.0}/tests/test_smoke.py +5 -13
  52. django_angular3-0.2.0/tests/test_tools.py +109 -0
  53. django_angular3-0.2.0/tests/test_validation.py +71 -0
  54. django_angular3-0.1.0/PKG-INFO +0 -296
  55. django_angular3-0.1.0/README.md +0 -258
  56. django_angular3-0.1.0/django_angular3/angular.py +0 -335
  57. django_angular3-0.1.0/django_angular3/build.py +0 -66
  58. django_angular3-0.1.0/django_angular3/cli.py +0 -313
  59. django_angular3-0.1.0/django_angular3/config.py +0 -110
  60. django_angular3-0.1.0/django_angular3/examples/01_simple_crm/django-angular3.json +0 -10
  61. django_angular3-0.1.0/django_angular3/examples/01_simple_crm/ui.json +0 -13
  62. django_angular3-0.1.0/django_angular3/management/commands/build_app.py +0 -483
  63. django_angular3-0.1.0/django_angular3/settings.py +0 -123
  64. django_angular3-0.1.0/django_angular3/validation.py +0 -169
  65. django_angular3-0.1.0/django_angular3.egg-info/PKG-INFO +0 -296
  66. django_angular3-0.1.0/requirements.txt +0 -4
  67. django_angular3-0.1.0/tests/test_angular_commands.py +0 -311
  68. django_angular3-0.1.0/tests/test_cli_scaffold.py +0 -81
  69. django_angular3-0.1.0/tests/test_ngdj_requirements.py +0 -146
  70. {django_angular3-0.1.0 → django_angular3-0.2.0}/LICENSE +0 -0
  71. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/__main__.py +0 -0
  72. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/admin.py +0 -0
  73. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/apps.py +0 -0
  74. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/documents.py +0 -0
  75. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/manage.py +0 -0
  76. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/shop/__init__.py +0 -0
  77. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/shop/admin.py +0 -0
  78. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/shop/apps.py +0 -0
  79. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/shop/models.py +0 -0
  80. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/shop/serializers.py +0 -0
  81. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/shop/tests.py +0 -0
  82. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/shop/views.py +0 -0
  83. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/simple_crm/__init__.py +0 -0
  84. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/simple_crm/asgi.py +0 -0
  85. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/simple_crm/urls.py +0 -0
  86. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/01_simple_crm/simple_crm/wsgi.py +0 -0
  87. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/examples/__init__.py +0 -0
  88. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/__init__.py +0 -0
  89. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/__init__.py +0 -0
  90. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_add.py +0 -0
  91. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_build.py +0 -0
  92. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_config.py +0 -0
  93. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_gen_app.py +0 -0
  94. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_new.py +0 -0
  95. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_openapi_gen.py +0 -0
  96. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_workspace.py +0 -0
  97. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_workspace_delete.py +0 -0
  98. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/management/commands/ng_workspace_modify.py +0 -0
  99. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/migrations/__init__.py +0 -0
  100. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/models.py +0 -0
  101. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/static/django_angular3/.gitkeep +0 -0
  102. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/templates/django_angular3/.gitkeep +0 -0
  103. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/urls.py +0 -0
  104. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3/views.py +0 -0
  105. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3.egg-info/dependency_links.txt +0 -0
  106. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3.egg-info/entry_points.txt +0 -0
  107. {django_angular3-0.1.0 → django_angular3-0.2.0}/django_angular3.egg-info/top_level.txt +0 -0
  108. {django_angular3-0.1.0 → django_angular3-0.2.0}/setup.cfg +0 -0
  109. {django_angular3-0.1.0 → django_angular3-0.2.0}/tests/test_settings.py +0 -0
@@ -1,5 +1,5 @@
1
- include requirements.txt
2
1
  recursive-include django_angular3/templates *
3
2
  recursive-include django_angular3/static *
4
3
  recursive-include django_angular3/management *
5
4
  recursive-include django_angular3/examples *
5
+ global-exclude *.py[cod]
@@ -0,0 +1,365 @@
1
+ Metadata-Version: 2.4
2
+ Name: django-angular3
3
+ Version: 0.2.0
4
+ Summary: Contract-first integration tooling for Django REST framework and Angular Material.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://djangoangular.com/
7
+ Project-URL: Repository, https://github.com/shlomoa/django-angular3
8
+ Keywords: django,djangorestframework,angular,openapi
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Framework :: Django
11
+ Classifier: Framework :: Django :: 5.0
12
+ Classifier: Framework :: Django :: 5.1
13
+ Classifier: Framework :: Django :: 6.0
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Code Generators
20
+ Requires-Python: >=3.12
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: Django>=5.1
24
+ Requires-Dist: djangorestframework
25
+ Requires-Dist: django-filter
26
+ Requires-Dist: drf-spectacular
27
+ Requires-Dist: claude-agent-sdk
28
+ Requires-Dist: openui-spec==0.0.2
29
+ Requires-Dist: openapi-spec-validator>=0.7
30
+ Provides-Extra: yaml
31
+ Requires-Dist: PyYAML>=6.0; extra == "yaml"
32
+ Provides-Extra: docs
33
+ Requires-Dist: sphinx>=8.0; extra == "docs"
34
+ Requires-Dist: furo>=2024.1.29; extra == "docs"
35
+ Requires-Dist: myst-parser>=3.0; extra == "docs"
36
+ Requires-Dist: sphinxcontrib-mermaid; extra == "docs"
37
+ Provides-Extra: dev
38
+ Requires-Dist: ruff>=0.4; extra == "dev"
39
+ Dynamic: license-file
40
+
41
+ # django-angular3
42
+
43
+ `django-angular3` enables seamless integration of Django, Django REST Framework (DRF), and Angular — giving teams a contract-first, automation-ready bridge between a DRF backend and an Angular Material frontend.
44
+
45
+ Project website: <https://djangoangular.com/>
46
+
47
+ Documentation: <https://django-angular3.readthedocs.io/>
48
+
49
+ Related docs:
50
+ - `doc/ARCHITECTURE.md` — architecture, integration boundaries, and design decisions
51
+ - `doc/specifications/SPECIFICATIONS.md` — exact platform structures and
52
+ topology definitions
53
+ - `doc/specifications/AI_AUTOMATION_SPECIFICATIONS.md` — exact AI automation
54
+ module organization and realization
55
+ - `doc/specifications/TEST_SCENARIO_SPECIFICATIONS.md` — exact build-scenario
56
+ suite realization and coverage
57
+ - `doc/contracts/CHANGE_MODEL_CONTRACTS.md` — shared Change Model and interface boundaries
58
+ - `doc/contracts/TOOL_CONTRACTS.md` — deterministic Tool contracts
59
+ - `doc/contracts/HOOK_CONTRACTS.md` — lifecycle Hook contracts
60
+ - `doc/contracts/PROVIDER_ADAPTER_CONTRACTS.md` — provider-adapter contracts
61
+ - `doc/contracts/PLUGIN_CONTRACTS.md` — Plugin packaging contracts
62
+ - `doc/contracts/SKILL_CONTRACTS.md` — Skill contracts and catalog ownership
63
+ - `doc/contracts/TEST_SCENARIO_CONTRACTS.md` — build-scenario input and expected
64
+ oracle boundaries
65
+ - `doc/plan/PHASED_IMPLEMENTATION_PLAN.md` — phased implementation sequencing
66
+ - `doc/plan/TODO.md` — delivery roadmap and open items
67
+
68
+ It allows you to:
69
+ - Keep Django responsible for data, authentication, and administration.
70
+ - Keep Angular responsible for the end-user application and client-side route tree.
71
+ - Use OpenAPI as the source of truth for API-contract-derived functionality.
72
+ - Support pages, reactive forms, navigation, and workflows through an OpenUI concrete UI document.
73
+ - Automate the handoff from backend API contract to Angular integration artifacts through a deterministic, repeatable pipeline.
74
+
75
+ ## Requirements
76
+
77
+ See the [requirements corpus](doc/requirements/REQUIREMENTS.md) for product,
78
+ generated-application, `build_app`, and AI automation requirements.
79
+
80
+ ## Installation
81
+
82
+ ```bash
83
+ pip install django-angular3
84
+ ```
85
+
86
+ To install from a local clone:
87
+
88
+ ```bash
89
+ pip install -e /path/to/django-angular3/
90
+ ```
91
+
92
+ ### OpenAPI and OpenUI validation
93
+
94
+ `django-angular3` uses [openapi-spec-validator] for full OAS compliance
95
+ validation of OpenAPI documents and [openui-spec] to validate structured OpenUI
96
+ documents against its schema and catalog. Both are pure-Python dependencies
97
+ installed automatically with the package — no external validation toolchain is
98
+ required.
99
+
100
+ OpenAPI documents are validated against the full OpenAPI specification using
101
+ `openapi-spec-validator`; OpenUI documents are validated through
102
+ `openui-spec`.
103
+
104
+ [openapi-spec-validator]: https://openapi-spec-validator.readthedocs.io/
105
+ [openui-spec]: https://github.com/shlomoa/openui-spec
106
+
107
+ ## Django app integration
108
+
109
+ If you install `django-angular3` into a Django project, add the app to
110
+ `INSTALLED_APPS` to enable the bundled `ng_` management commands.
111
+
112
+ ```python
113
+ INSTALLED_APPS = [
114
+ # ...
115
+ "django_angular3",
116
+ ]
117
+ ```
118
+
119
+ Or use the explicit app config path:
120
+
121
+ ```python
122
+ INSTALLED_APPS = [
123
+ # ...
124
+ "django_angular3.apps.DjangoAngular3Config",
125
+ ]
126
+ ```
127
+
128
+ The static `django-angular3.json` configures djng's Angular tool settings,
129
+ including executable resolution and its command allowlist. `DJANGO_ANGULAR3`
130
+ and `DjangoAngularSettings` are derived from that file; they are not independent
131
+ configuration authorities. The generated app's identity and artifact locations
132
+ are instead supplied by the project configuration defined in
133
+ `doc/specifications/SPECIFICATIONS.md` §2.1.
134
+
135
+ Once installed, Django and the standalone CLI expose the same Angular command
136
+ resolution flow. Use `--dry-run` only for diagnostic validation and debugging;
137
+ it resolves commands without executing Angular tooling:
138
+
139
+ ```bash
140
+ ./manage.py ng_new --dry-run
141
+ ./manage.py ng_workspace --dry-run
142
+ ./manage.py ng_config --dry-run
143
+ ./manage.py ng_add --dry-run
144
+ ./manage.py ng_gen_app --dry-run
145
+ ./manage.py ng_page --name orders --target-path src/app/features/orders --dry-run
146
+ ./manage.py ng_component --name order-card --dry-run
147
+ ./manage.py ng_reactive_form --name contact --definition forms/contact.json --dry-run
148
+ ./manage.py ng_site --defaults --dry-run
149
+ ./manage.py ng_openapi_gen --dry-run
150
+ ./manage.py ng_build --dry-run
151
+ ```
152
+
153
+ - `ng_new` creates an empty Angular workspace
154
+ - `ng_workspace` runs the upstream-aligned workspace bootstrap flow: `ng new`, workspace defaults, `ng add angular-django2`, and `ng generate angular-django2:workspace-setup`
155
+ - `ng_config` applies workspace defaults such as package manager, style, and routing
156
+ - `ng_add` installs and registers the configured Angular schematic package
157
+ - `ng_gen_app` generates an Angular application inside the configured workspace via the `angular-django2:material-app` schematic, forwarding `--ssr`, `--zoneless`, and `--defaults` to align with the Angular CLI `ng new` defaults
158
+ - `ng_material_setup` configures Angular Material in an existing project via the `angular-django2:material-setup` schematic, forwarding optional `--theme`, `--typography`, and `--animations`
159
+ - `ng_page`, `ng_component`, `ng_reactive_form`, and `ng_site` wrap the matching `angular-django2` schematics without changing their deterministic behavior
160
+ - `ng_openapi_gen` runs a locally installed `ng-openapi-gen` for the configured OpenAPI source
161
+
162
+ `ng_openapi_gen` resolves to `pnpm exec`, so it only uses dependencies that
163
+ are already installed in the Angular workspace. It does not download and
164
+ execute packages at runtime.
165
+ - `ng_build` builds the configured Angular application
166
+
167
+ > **Naming note**: The `ng_*` command names (e.g. `ng_workspace`, `ng_openapi_gen`) are the
168
+ > **frozen CLI wrapper layer** — stable entry points that never change. The automation subsystem
169
+ > uses two separate layers with distinct names: **TOOL contracts** are deterministic
170
+ > agent-callable operations (e.g. `angular_workspace_scaffold`, `openapi_schema_export`) and
171
+ > **SKILL names** are AI-guided session identifiers (e.g. `angular-workspace-foundation`,
172
+ > `angular-api-integration`). See `doc/ARCHITECTURE.md §2.22` for the authoritative definition.
173
+
174
+ To execute these commands, include the relevant commands in the static tool
175
+ configuration's `tool.commandAllowlist`, then invoke them without `--dry-run`.
176
+
177
+ Use `--app-name <name>` with `ng_gen_app` to override the generated Angular
178
+ application name.
179
+
180
+ Beyond these workspace wrappers, `angular-django2` ships schematics for
181
+ composing bespoke feature UI. `ng generate angular-django2:component <name>`
182
+ scaffolds a standalone component seeded with begin/end embedding hooks, and
183
+ `ng generate angular-django2:embed-component --component=<child.ts> --parent=<parent.ts>`
184
+ wires a generated child into a parent — importing the class, registering it in the
185
+ parent standalone `imports` array, feeding input signals, and binding outputs to
186
+ `on<Output>()` handler stubs. Embedding is idempotent, so it is safe to re-run
187
+ during iterative development. See the [Usage workflow](https://django-angular3.readthedocs.io/en/latest/workflow.html)
188
+ for the full generate → embed composition flow.
189
+
190
+ For advanced Material components, use the `ng_complex_component` wrapper. It
191
+ invokes `angular-django2:complex-component`, which owns theme mixins, nested
192
+ child composition, projection slots, CDK overlay support, and create/modify/
193
+ delete lifecycle handling:
194
+
195
+ ```bash
196
+ ./manage.py ng_complex_component \
197
+ --name dashboard-card --target-path src/app/features/dashboard \
198
+ --features mixins,nested,projection --dry-run
199
+ ```
200
+
201
+ Use `--mode delete --confirm` for deletion. Add `ng_complex_component` to
202
+ `tool.commandAllowlist` before running without `--dry-run`.
203
+
204
+ At the moment this reusable Django app contributes configuration helpers and
205
+ management commands; it does not yet ship models, URLs, templates, static
206
+ assets, or migrations, so there is no extra URL inclusion or migration step for
207
+ the package itself.
208
+
209
+ ## Example
210
+
211
+ Let's take a look at a simple example of starting from Django REST framework and
212
+ then layering Angular Material integration on top.
213
+
214
+ Start by creating a DRF-backed project in the usual way:
215
+
216
+ ```bash
217
+ pip install djangorestframework
218
+ django-admin startproject mysite .
219
+ ./manage.py migrate
220
+ ./manage.py createsuperuser
221
+ ```
222
+
223
+ Now edit your project's `urls.py` module:
224
+
225
+ ```python
226
+ from django.contrib.auth.models import User
227
+ from django.urls import include, path
228
+ from rest_framework import routers, serializers, viewsets
229
+
230
+
231
+ # Serializers define the API representation.
232
+ class UserSerializer(serializers.HyperlinkedModelSerializer):
233
+ class Meta:
234
+ model = User
235
+ fields = ["url", "username", "email", "is_staff"]
236
+
237
+
238
+ # ViewSets define the view behavior.
239
+ class UserViewSet(viewsets.ModelViewSet):
240
+ queryset = User.objects.all()
241
+ serializer_class = UserSerializer
242
+
243
+
244
+ # Routers provide a way of automatically determining the URL conf.
245
+ router = routers.DefaultRouter()
246
+ router.register(r"users", UserViewSet)
247
+
248
+
249
+ # Django serves API and authentication routes.
250
+ urlpatterns = [
251
+ path("api/", include(router.urls)),
252
+ path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
253
+ ]
254
+ ```
255
+
256
+ Add the following to your `settings.py` module:
257
+
258
+ ```python
259
+ INSTALLED_APPS = [
260
+ # ...
261
+ "rest_framework",
262
+ ]
263
+
264
+ REST_FRAMEWORK = {
265
+ "DEFAULT_PERMISSION_CLASSES": [
266
+ "rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly",
267
+ ]
268
+ }
269
+ ```
270
+
271
+ At this point, Django + DRF own the backend data and authentication services.
272
+
273
+ The next step is to export the OpenAPI contract from that backend and use it as
274
+ the source for API-contract-derived Angular integration.
275
+
276
+ A simplified schema fragment might look like this:
277
+
278
+ ```yaml
279
+ paths:
280
+ /api/users/:
281
+ get:
282
+ operationId: listUsers
283
+ post:
284
+ operationId: createUser
285
+ /api/users/{id}/:
286
+ get:
287
+ operationId: retrieveUser
288
+ patch:
289
+ operationId: updateUser
290
+ ```
291
+
292
+ Under the generated-app convention, UI requirements are supplied in the
293
+ project-root `app.openui.json` selected by
294
+ `artifacts.openuiSpecification`. The OpenUI concrete UI document may
295
+ complement or reference API-contract-derived content. Its role, grammar, and
296
+ catalog relationship are defined by the
297
+ [OpenUI artifact-role SSOT](https://github.com/shlomoa/openui-spec/blob/main/spec/README.md#specification-artifacts-grammar-vs-catalog);
298
+ see the [OpenUI examples](https://openui-spec.readthedocs.io/en/latest/examples/)
299
+ for the per-scope vocabulary.
300
+
301
+ For example:
302
+
303
+ ```json
304
+ {
305
+ "id": "root",
306
+ "version": "0.0.1",
307
+ "type": "Application",
308
+ "children": [
309
+ {
310
+ "id": "dashboardPage",
311
+ "type": "DashboardPage"
312
+ },
313
+ {
314
+ "id": "inviteUserForm",
315
+ "type": "FormView",
316
+ "attrs": {
317
+ "title": "\"Invite user\"",
318
+ "(submit)": "createUser(form.value)"
319
+ }
320
+ }
321
+ ]
322
+ }
323
+ ```
324
+
325
+ The scaffolded first version in this repository already includes example inputs.
326
+ For the contributor workflow around local validation, see
327
+ [Contributing](CONTRIBUTING.md).
328
+
329
+ ## Documentation
330
+
331
+ User-facing usage documentation is published at
332
+ <https://django-angular3.readthedocs.io/>:
333
+
334
+ - [Getting started](https://django-angular3.readthedocs.io/en/latest/getting-started.html) — install, run the bundled tutorial, and complete the workflow end to end.
335
+ - [Configuration](https://django-angular3.readthedocs.io/en/latest/configuration.html) — configuration guidance and references.
336
+ - [Usage workflow](https://django-angular3.readthedocs.io/en/latest/workflow.html) — the contract-first cycle for your own project.
337
+ - [Command reference](https://django-angular3.readthedocs.io/en/latest/commands.html) — every command in both the standalone CLI and management-command form.
338
+
339
+ The project website is available at <https://djangoangular.com/>.
340
+
341
+ Current project documents:
342
+
343
+ - [Contributing](CONTRIBUTING.md)
344
+ - [Releasing](doc/RELEASING.md)
345
+ - [Requirements](doc/requirements/REQUIREMENTS.md)
346
+ - [Specifications](doc/specifications/SPECIFICATIONS.md)
347
+ - [AI automation specifications](doc/specifications/AI_AUTOMATION_SPECIFICATIONS.md)
348
+ - [Test scenario specifications](doc/specifications/TEST_SCENARIO_SPECIFICATIONS.md)
349
+ - [Change model contracts](doc/contracts/CHANGE_MODEL_CONTRACTS.md)
350
+ - [Tool contracts](doc/contracts/TOOL_CONTRACTS.md)
351
+ - [Hook contracts](doc/contracts/HOOK_CONTRACTS.md)
352
+ - [Provider adapter contracts](doc/contracts/PROVIDER_ADAPTER_CONTRACTS.md)
353
+ - [Plugin contracts](doc/contracts/PLUGIN_CONTRACTS.md)
354
+ - [Skill contracts](doc/contracts/SKILL_CONTRACTS.md)
355
+ - [Test scenario contracts](doc/contracts/TEST_SCENARIO_CONTRACTS.md)
356
+ - [Architecture](doc/ARCHITECTURE.md)
357
+ - [Phased implementation plan](doc/plan/PHASED_IMPLEMENTATION_PLAN.md)
358
+ - [Open items](doc/plan/TODO.md)
359
+
360
+ ## Status
361
+
362
+ This project now includes a first scaffolded Python package, example inputs, and
363
+ the current contributor workflow. The repository does not yet include a
364
+ frontend workspace. Actual code generation and Angular assembly are still
365
+ pending.
@@ -0,0 +1,325 @@
1
+ # django-angular3
2
+
3
+ `django-angular3` enables seamless integration of Django, Django REST Framework (DRF), and Angular — giving teams a contract-first, automation-ready bridge between a DRF backend and an Angular Material frontend.
4
+
5
+ Project website: <https://djangoangular.com/>
6
+
7
+ Documentation: <https://django-angular3.readthedocs.io/>
8
+
9
+ Related docs:
10
+ - `doc/ARCHITECTURE.md` — architecture, integration boundaries, and design decisions
11
+ - `doc/specifications/SPECIFICATIONS.md` — exact platform structures and
12
+ topology definitions
13
+ - `doc/specifications/AI_AUTOMATION_SPECIFICATIONS.md` — exact AI automation
14
+ module organization and realization
15
+ - `doc/specifications/TEST_SCENARIO_SPECIFICATIONS.md` — exact build-scenario
16
+ suite realization and coverage
17
+ - `doc/contracts/CHANGE_MODEL_CONTRACTS.md` — shared Change Model and interface boundaries
18
+ - `doc/contracts/TOOL_CONTRACTS.md` — deterministic Tool contracts
19
+ - `doc/contracts/HOOK_CONTRACTS.md` — lifecycle Hook contracts
20
+ - `doc/contracts/PROVIDER_ADAPTER_CONTRACTS.md` — provider-adapter contracts
21
+ - `doc/contracts/PLUGIN_CONTRACTS.md` — Plugin packaging contracts
22
+ - `doc/contracts/SKILL_CONTRACTS.md` — Skill contracts and catalog ownership
23
+ - `doc/contracts/TEST_SCENARIO_CONTRACTS.md` — build-scenario input and expected
24
+ oracle boundaries
25
+ - `doc/plan/PHASED_IMPLEMENTATION_PLAN.md` — phased implementation sequencing
26
+ - `doc/plan/TODO.md` — delivery roadmap and open items
27
+
28
+ It allows you to:
29
+ - Keep Django responsible for data, authentication, and administration.
30
+ - Keep Angular responsible for the end-user application and client-side route tree.
31
+ - Use OpenAPI as the source of truth for API-contract-derived functionality.
32
+ - Support pages, reactive forms, navigation, and workflows through an OpenUI concrete UI document.
33
+ - Automate the handoff from backend API contract to Angular integration artifacts through a deterministic, repeatable pipeline.
34
+
35
+ ## Requirements
36
+
37
+ See the [requirements corpus](doc/requirements/REQUIREMENTS.md) for product,
38
+ generated-application, `build_app`, and AI automation requirements.
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ pip install django-angular3
44
+ ```
45
+
46
+ To install from a local clone:
47
+
48
+ ```bash
49
+ pip install -e /path/to/django-angular3/
50
+ ```
51
+
52
+ ### OpenAPI and OpenUI validation
53
+
54
+ `django-angular3` uses [openapi-spec-validator] for full OAS compliance
55
+ validation of OpenAPI documents and [openui-spec] to validate structured OpenUI
56
+ documents against its schema and catalog. Both are pure-Python dependencies
57
+ installed automatically with the package — no external validation toolchain is
58
+ required.
59
+
60
+ OpenAPI documents are validated against the full OpenAPI specification using
61
+ `openapi-spec-validator`; OpenUI documents are validated through
62
+ `openui-spec`.
63
+
64
+ [openapi-spec-validator]: https://openapi-spec-validator.readthedocs.io/
65
+ [openui-spec]: https://github.com/shlomoa/openui-spec
66
+
67
+ ## Django app integration
68
+
69
+ If you install `django-angular3` into a Django project, add the app to
70
+ `INSTALLED_APPS` to enable the bundled `ng_` management commands.
71
+
72
+ ```python
73
+ INSTALLED_APPS = [
74
+ # ...
75
+ "django_angular3",
76
+ ]
77
+ ```
78
+
79
+ Or use the explicit app config path:
80
+
81
+ ```python
82
+ INSTALLED_APPS = [
83
+ # ...
84
+ "django_angular3.apps.DjangoAngular3Config",
85
+ ]
86
+ ```
87
+
88
+ The static `django-angular3.json` configures djng's Angular tool settings,
89
+ including executable resolution and its command allowlist. `DJANGO_ANGULAR3`
90
+ and `DjangoAngularSettings` are derived from that file; they are not independent
91
+ configuration authorities. The generated app's identity and artifact locations
92
+ are instead supplied by the project configuration defined in
93
+ `doc/specifications/SPECIFICATIONS.md` §2.1.
94
+
95
+ Once installed, Django and the standalone CLI expose the same Angular command
96
+ resolution flow. Use `--dry-run` only for diagnostic validation and debugging;
97
+ it resolves commands without executing Angular tooling:
98
+
99
+ ```bash
100
+ ./manage.py ng_new --dry-run
101
+ ./manage.py ng_workspace --dry-run
102
+ ./manage.py ng_config --dry-run
103
+ ./manage.py ng_add --dry-run
104
+ ./manage.py ng_gen_app --dry-run
105
+ ./manage.py ng_page --name orders --target-path src/app/features/orders --dry-run
106
+ ./manage.py ng_component --name order-card --dry-run
107
+ ./manage.py ng_reactive_form --name contact --definition forms/contact.json --dry-run
108
+ ./manage.py ng_site --defaults --dry-run
109
+ ./manage.py ng_openapi_gen --dry-run
110
+ ./manage.py ng_build --dry-run
111
+ ```
112
+
113
+ - `ng_new` creates an empty Angular workspace
114
+ - `ng_workspace` runs the upstream-aligned workspace bootstrap flow: `ng new`, workspace defaults, `ng add angular-django2`, and `ng generate angular-django2:workspace-setup`
115
+ - `ng_config` applies workspace defaults such as package manager, style, and routing
116
+ - `ng_add` installs and registers the configured Angular schematic package
117
+ - `ng_gen_app` generates an Angular application inside the configured workspace via the `angular-django2:material-app` schematic, forwarding `--ssr`, `--zoneless`, and `--defaults` to align with the Angular CLI `ng new` defaults
118
+ - `ng_material_setup` configures Angular Material in an existing project via the `angular-django2:material-setup` schematic, forwarding optional `--theme`, `--typography`, and `--animations`
119
+ - `ng_page`, `ng_component`, `ng_reactive_form`, and `ng_site` wrap the matching `angular-django2` schematics without changing their deterministic behavior
120
+ - `ng_openapi_gen` runs a locally installed `ng-openapi-gen` for the configured OpenAPI source
121
+
122
+ `ng_openapi_gen` resolves to `pnpm exec`, so it only uses dependencies that
123
+ are already installed in the Angular workspace. It does not download and
124
+ execute packages at runtime.
125
+ - `ng_build` builds the configured Angular application
126
+
127
+ > **Naming note**: The `ng_*` command names (e.g. `ng_workspace`, `ng_openapi_gen`) are the
128
+ > **frozen CLI wrapper layer** — stable entry points that never change. The automation subsystem
129
+ > uses two separate layers with distinct names: **TOOL contracts** are deterministic
130
+ > agent-callable operations (e.g. `angular_workspace_scaffold`, `openapi_schema_export`) and
131
+ > **SKILL names** are AI-guided session identifiers (e.g. `angular-workspace-foundation`,
132
+ > `angular-api-integration`). See `doc/ARCHITECTURE.md §2.22` for the authoritative definition.
133
+
134
+ To execute these commands, include the relevant commands in the static tool
135
+ configuration's `tool.commandAllowlist`, then invoke them without `--dry-run`.
136
+
137
+ Use `--app-name <name>` with `ng_gen_app` to override the generated Angular
138
+ application name.
139
+
140
+ Beyond these workspace wrappers, `angular-django2` ships schematics for
141
+ composing bespoke feature UI. `ng generate angular-django2:component <name>`
142
+ scaffolds a standalone component seeded with begin/end embedding hooks, and
143
+ `ng generate angular-django2:embed-component --component=<child.ts> --parent=<parent.ts>`
144
+ wires a generated child into a parent — importing the class, registering it in the
145
+ parent standalone `imports` array, feeding input signals, and binding outputs to
146
+ `on<Output>()` handler stubs. Embedding is idempotent, so it is safe to re-run
147
+ during iterative development. See the [Usage workflow](https://django-angular3.readthedocs.io/en/latest/workflow.html)
148
+ for the full generate → embed composition flow.
149
+
150
+ For advanced Material components, use the `ng_complex_component` wrapper. It
151
+ invokes `angular-django2:complex-component`, which owns theme mixins, nested
152
+ child composition, projection slots, CDK overlay support, and create/modify/
153
+ delete lifecycle handling:
154
+
155
+ ```bash
156
+ ./manage.py ng_complex_component \
157
+ --name dashboard-card --target-path src/app/features/dashboard \
158
+ --features mixins,nested,projection --dry-run
159
+ ```
160
+
161
+ Use `--mode delete --confirm` for deletion. Add `ng_complex_component` to
162
+ `tool.commandAllowlist` before running without `--dry-run`.
163
+
164
+ At the moment this reusable Django app contributes configuration helpers and
165
+ management commands; it does not yet ship models, URLs, templates, static
166
+ assets, or migrations, so there is no extra URL inclusion or migration step for
167
+ the package itself.
168
+
169
+ ## Example
170
+
171
+ Let's take a look at a simple example of starting from Django REST framework and
172
+ then layering Angular Material integration on top.
173
+
174
+ Start by creating a DRF-backed project in the usual way:
175
+
176
+ ```bash
177
+ pip install djangorestframework
178
+ django-admin startproject mysite .
179
+ ./manage.py migrate
180
+ ./manage.py createsuperuser
181
+ ```
182
+
183
+ Now edit your project's `urls.py` module:
184
+
185
+ ```python
186
+ from django.contrib.auth.models import User
187
+ from django.urls import include, path
188
+ from rest_framework import routers, serializers, viewsets
189
+
190
+
191
+ # Serializers define the API representation.
192
+ class UserSerializer(serializers.HyperlinkedModelSerializer):
193
+ class Meta:
194
+ model = User
195
+ fields = ["url", "username", "email", "is_staff"]
196
+
197
+
198
+ # ViewSets define the view behavior.
199
+ class UserViewSet(viewsets.ModelViewSet):
200
+ queryset = User.objects.all()
201
+ serializer_class = UserSerializer
202
+
203
+
204
+ # Routers provide a way of automatically determining the URL conf.
205
+ router = routers.DefaultRouter()
206
+ router.register(r"users", UserViewSet)
207
+
208
+
209
+ # Django serves API and authentication routes.
210
+ urlpatterns = [
211
+ path("api/", include(router.urls)),
212
+ path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
213
+ ]
214
+ ```
215
+
216
+ Add the following to your `settings.py` module:
217
+
218
+ ```python
219
+ INSTALLED_APPS = [
220
+ # ...
221
+ "rest_framework",
222
+ ]
223
+
224
+ REST_FRAMEWORK = {
225
+ "DEFAULT_PERMISSION_CLASSES": [
226
+ "rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly",
227
+ ]
228
+ }
229
+ ```
230
+
231
+ At this point, Django + DRF own the backend data and authentication services.
232
+
233
+ The next step is to export the OpenAPI contract from that backend and use it as
234
+ the source for API-contract-derived Angular integration.
235
+
236
+ A simplified schema fragment might look like this:
237
+
238
+ ```yaml
239
+ paths:
240
+ /api/users/:
241
+ get:
242
+ operationId: listUsers
243
+ post:
244
+ operationId: createUser
245
+ /api/users/{id}/:
246
+ get:
247
+ operationId: retrieveUser
248
+ patch:
249
+ operationId: updateUser
250
+ ```
251
+
252
+ Under the generated-app convention, UI requirements are supplied in the
253
+ project-root `app.openui.json` selected by
254
+ `artifacts.openuiSpecification`. The OpenUI concrete UI document may
255
+ complement or reference API-contract-derived content. Its role, grammar, and
256
+ catalog relationship are defined by the
257
+ [OpenUI artifact-role SSOT](https://github.com/shlomoa/openui-spec/blob/main/spec/README.md#specification-artifacts-grammar-vs-catalog);
258
+ see the [OpenUI examples](https://openui-spec.readthedocs.io/en/latest/examples/)
259
+ for the per-scope vocabulary.
260
+
261
+ For example:
262
+
263
+ ```json
264
+ {
265
+ "id": "root",
266
+ "version": "0.0.1",
267
+ "type": "Application",
268
+ "children": [
269
+ {
270
+ "id": "dashboardPage",
271
+ "type": "DashboardPage"
272
+ },
273
+ {
274
+ "id": "inviteUserForm",
275
+ "type": "FormView",
276
+ "attrs": {
277
+ "title": "\"Invite user\"",
278
+ "(submit)": "createUser(form.value)"
279
+ }
280
+ }
281
+ ]
282
+ }
283
+ ```
284
+
285
+ The scaffolded first version in this repository already includes example inputs.
286
+ For the contributor workflow around local validation, see
287
+ [Contributing](CONTRIBUTING.md).
288
+
289
+ ## Documentation
290
+
291
+ User-facing usage documentation is published at
292
+ <https://django-angular3.readthedocs.io/>:
293
+
294
+ - [Getting started](https://django-angular3.readthedocs.io/en/latest/getting-started.html) — install, run the bundled tutorial, and complete the workflow end to end.
295
+ - [Configuration](https://django-angular3.readthedocs.io/en/latest/configuration.html) — configuration guidance and references.
296
+ - [Usage workflow](https://django-angular3.readthedocs.io/en/latest/workflow.html) — the contract-first cycle for your own project.
297
+ - [Command reference](https://django-angular3.readthedocs.io/en/latest/commands.html) — every command in both the standalone CLI and management-command form.
298
+
299
+ The project website is available at <https://djangoangular.com/>.
300
+
301
+ Current project documents:
302
+
303
+ - [Contributing](CONTRIBUTING.md)
304
+ - [Releasing](doc/RELEASING.md)
305
+ - [Requirements](doc/requirements/REQUIREMENTS.md)
306
+ - [Specifications](doc/specifications/SPECIFICATIONS.md)
307
+ - [AI automation specifications](doc/specifications/AI_AUTOMATION_SPECIFICATIONS.md)
308
+ - [Test scenario specifications](doc/specifications/TEST_SCENARIO_SPECIFICATIONS.md)
309
+ - [Change model contracts](doc/contracts/CHANGE_MODEL_CONTRACTS.md)
310
+ - [Tool contracts](doc/contracts/TOOL_CONTRACTS.md)
311
+ - [Hook contracts](doc/contracts/HOOK_CONTRACTS.md)
312
+ - [Provider adapter contracts](doc/contracts/PROVIDER_ADAPTER_CONTRACTS.md)
313
+ - [Plugin contracts](doc/contracts/PLUGIN_CONTRACTS.md)
314
+ - [Skill contracts](doc/contracts/SKILL_CONTRACTS.md)
315
+ - [Test scenario contracts](doc/contracts/TEST_SCENARIO_CONTRACTS.md)
316
+ - [Architecture](doc/ARCHITECTURE.md)
317
+ - [Phased implementation plan](doc/plan/PHASED_IMPLEMENTATION_PLAN.md)
318
+ - [Open items](doc/plan/TODO.md)
319
+
320
+ ## Status
321
+
322
+ This project now includes a first scaffolded Python package, example inputs, and
323
+ the current contributor workflow. The repository does not yet include a
324
+ frontend workspace. Actual code generation and Angular assembly are still
325
+ pending.