From e2e74dee2413a5246574d610f64eebe702bae99e Mon Sep 17 00:00:00 2001 From: Marco Zeisler Date: Sat, 10 Apr 2021 15:59:17 +0200 Subject: [PATCH] create folders for components; --- .../control_center}/.browserslistrc | 0 .../control_center}/.dockerignore | 0 .../control_center}/.editorconfig | 0 .../control_center}/.gitignore | 0 .../control_center}/Dockerfile | 0 .../control_center}/README.md | 0 .../control_center}/angular.json | 0 .../control_center}/e2e/app.e2e-spec.ts | 0 .../control_center}/e2e/app.po.ts | 0 .../control_center}/e2e/tsconfig.e2e.json | 0 .../control_center}/karma.conf.js | 0 .../control_center}/package-lock.json | 0 .../control_center}/package.json | 0 .../control_center}/protractor.conf.js | 0 .../src/app/app-routing.module.ts | 0 .../control_center}/src/app/app.module.ts | 0 .../component/landing/landing.component.css | 0 .../component/landing/landing.component.html | 0 .../component/landing/landing.component.ts | 0 .../testsubcomp/test-sub-comp.component.css | 0 .../testsubcomp/test-sub-comp.component.html | 0 .../testsubcomp/test-sub-comp.component.ts | 0 .../src/app/interfaces/interface.ts | 0 .../src/app/services/interceptor.service.ts | 0 .../src/app/services/rest.service.ts | 0 .../src/app/services/websocket.service.ts | 0 .../control_center}/src/assets/.gitkeep | 0 .../src/environments/environment.prod.ts | 0 .../src/environments/environment.ts | 0 .../control_center}/src/favicon.ico | Bin .../control_center}/src/index.html | 0 .../control_center}/src/main.ts | 0 .../control_center}/src/polyfills.ts | 0 .../control_center}/src/styles.css | 0 .../control_center}/src/test.ts | 0 .../control_center}/src/theme.scss | 0 .../control_center}/tsconfig.app.json | 0 .../control_center}/tsconfig.json | 0 .../control_center}/tslint.json | 0 .../event_store}/.gitignore | 0 .../event_store}/.run/createsuperuser.run.xml | 0 .../event_store}/.run/makemigrations.run.xml | 0 .../event_store}/.run/migrate.run.xml | 0 .../event_store}/.run/runserver.run.xml | 0 .../event_store}/Dockerfile | 0 {backend => components/event_store}/README.md | 0 .../event_store}/__init__.py | 0 .../event_store}/app_be/__init__.py | 0 .../event_store}/app_be/admin.py | 0 .../event_store}/app_be/apps.py | 0 .../event_store}/app_be/models.py | 0 .../event_store}/app_be/routing.py | 0 .../event_store}/app_be/serializers.py | 0 .../app_be/services/data_factory.py | 0 .../services/tests/test_data_factory.py | 0 .../event_store}/app_be/settings.py | 0 .../event_store}/app_be/tests.py | 0 .../event_store}/app_be/urls.py | 0 .../event_store}/app_be/views/__init__.py | 0 .../event_store}/app_be/views/rest_api.py | 0 .../app_be/views/tests/__init__.py | 0 .../app_be/views/tests/test_rest_api.py | 0 .../app_be/views/tests/test_ws_api.py | 0 .../event_store}/app_be/views/ws_api.py | 0 .../event_store}/app_be/wsgi.py | 0 {backend => components/event_store}/manage.py | 0 .../event_store}/requirements.txt | 0 {backend => components/event_store}/setup.py | 0 components/i_feed/traffic_light.py | 1 + components/i_feed/vehicle.py | 1 + components/orchestration/.gitignore | 6 + .../.run/createsuperuser.run.xml | 24 ++ .../orchestration/.run/makemigrations.run.xml | 24 ++ components/orchestration/.run/migrate.run.xml | 24 ++ .../orchestration/.run/runserver.run.xml | 24 ++ components/orchestration/Dockerfile | 19 ++ components/orchestration/README.md | 20 ++ components/orchestration/__init__.py | 0 components/orchestration/app_be/__init__.py | 0 components/orchestration/app_be/admin.py | 3 + components/orchestration/app_be/apps.py | 5 + components/orchestration/app_be/models.py | 3 + components/orchestration/app_be/routing.py | 17 ++ .../orchestration/app_be/serializers.py | 3 + .../app_be/services/data_factory.py | 0 .../services/tests/test_data_factory.py | 0 components/orchestration/app_be/settings.py | 221 ++++++++++++++++++ components/orchestration/app_be/tests.py | 15 ++ components/orchestration/app_be/urls.py | 30 +++ .../orchestration/app_be/views/__init__.py | 0 .../orchestration/app_be/views/rest_api.py | 15 ++ .../app_be/views/tests/__init__.py | 0 .../app_be/views/tests/test_rest_api.py | 0 .../app_be/views/tests/test_ws_api.py | 0 .../orchestration/app_be/views/ws_api.py | 18 ++ components/orchestration/app_be/wsgi.py | 16 ++ components/orchestration/manage.py | 15 ++ components/orchestration/requirements.txt | 2 + components/orchestration/setup.py | 23 ++ 99 files changed, 529 insertions(+) rename {frontend => components/control_center}/.browserslistrc (100%) rename {frontend => components/control_center}/.dockerignore (100%) rename {frontend => components/control_center}/.editorconfig (100%) rename {frontend => components/control_center}/.gitignore (100%) rename {frontend => components/control_center}/Dockerfile (100%) rename {frontend => components/control_center}/README.md (100%) rename {frontend => components/control_center}/angular.json (100%) rename {frontend => components/control_center}/e2e/app.e2e-spec.ts (100%) rename {frontend => components/control_center}/e2e/app.po.ts (100%) rename {frontend => components/control_center}/e2e/tsconfig.e2e.json (100%) rename {frontend => components/control_center}/karma.conf.js (100%) rename {frontend => components/control_center}/package-lock.json (100%) rename {frontend => components/control_center}/package.json (100%) rename {frontend => components/control_center}/protractor.conf.js (100%) rename {frontend => components/control_center}/src/app/app-routing.module.ts (100%) rename {frontend => components/control_center}/src/app/app.module.ts (100%) rename {frontend => components/control_center}/src/app/component/landing/landing.component.css (100%) rename {frontend => components/control_center}/src/app/component/landing/landing.component.html (100%) rename {frontend => components/control_center}/src/app/component/landing/landing.component.ts (100%) rename {frontend => components/control_center}/src/app/component/testsubcomp/test-sub-comp.component.css (100%) rename {frontend => components/control_center}/src/app/component/testsubcomp/test-sub-comp.component.html (100%) rename {frontend => components/control_center}/src/app/component/testsubcomp/test-sub-comp.component.ts (100%) rename {frontend => components/control_center}/src/app/interfaces/interface.ts (100%) rename {frontend => components/control_center}/src/app/services/interceptor.service.ts (100%) rename {frontend => components/control_center}/src/app/services/rest.service.ts (100%) rename {frontend => components/control_center}/src/app/services/websocket.service.ts (100%) rename {frontend => components/control_center}/src/assets/.gitkeep (100%) rename {frontend => components/control_center}/src/environments/environment.prod.ts (100%) rename {frontend => components/control_center}/src/environments/environment.ts (100%) rename {frontend => components/control_center}/src/favicon.ico (100%) rename {frontend => components/control_center}/src/index.html (100%) rename {frontend => components/control_center}/src/main.ts (100%) rename {frontend => components/control_center}/src/polyfills.ts (100%) rename {frontend => components/control_center}/src/styles.css (100%) rename {frontend => components/control_center}/src/test.ts (100%) rename {frontend => components/control_center}/src/theme.scss (100%) rename {frontend => components/control_center}/tsconfig.app.json (100%) rename {frontend => components/control_center}/tsconfig.json (100%) rename {frontend => components/control_center}/tslint.json (100%) rename {backend => components/event_store}/.gitignore (100%) rename {backend => components/event_store}/.run/createsuperuser.run.xml (100%) rename {backend => components/event_store}/.run/makemigrations.run.xml (100%) rename {backend => components/event_store}/.run/migrate.run.xml (100%) rename {backend => components/event_store}/.run/runserver.run.xml (100%) rename {backend => components/event_store}/Dockerfile (100%) rename {backend => components/event_store}/README.md (100%) rename {backend => components/event_store}/__init__.py (100%) rename {backend => components/event_store}/app_be/__init__.py (100%) rename {backend => components/event_store}/app_be/admin.py (100%) rename {backend => components/event_store}/app_be/apps.py (100%) rename {backend => components/event_store}/app_be/models.py (100%) rename {backend => components/event_store}/app_be/routing.py (100%) rename {backend => components/event_store}/app_be/serializers.py (100%) rename {backend => components/event_store}/app_be/services/data_factory.py (100%) rename {backend => components/event_store}/app_be/services/tests/test_data_factory.py (100%) rename {backend => components/event_store}/app_be/settings.py (100%) rename {backend => components/event_store}/app_be/tests.py (100%) rename {backend => components/event_store}/app_be/urls.py (100%) rename {backend => components/event_store}/app_be/views/__init__.py (100%) rename {backend => components/event_store}/app_be/views/rest_api.py (100%) rename {backend => components/event_store}/app_be/views/tests/__init__.py (100%) rename {backend => components/event_store}/app_be/views/tests/test_rest_api.py (100%) rename {backend => components/event_store}/app_be/views/tests/test_ws_api.py (100%) rename {backend => components/event_store}/app_be/views/ws_api.py (100%) rename {backend => components/event_store}/app_be/wsgi.py (100%) rename {backend => components/event_store}/manage.py (100%) rename {backend => components/event_store}/requirements.txt (100%) rename {backend => components/event_store}/setup.py (100%) create mode 100644 components/i_feed/traffic_light.py create mode 100644 components/i_feed/vehicle.py create mode 100644 components/orchestration/.gitignore create mode 100644 components/orchestration/.run/createsuperuser.run.xml create mode 100644 components/orchestration/.run/makemigrations.run.xml create mode 100644 components/orchestration/.run/migrate.run.xml create mode 100644 components/orchestration/.run/runserver.run.xml create mode 100644 components/orchestration/Dockerfile create mode 100644 components/orchestration/README.md create mode 100644 components/orchestration/__init__.py create mode 100644 components/orchestration/app_be/__init__.py create mode 100644 components/orchestration/app_be/admin.py create mode 100644 components/orchestration/app_be/apps.py create mode 100644 components/orchestration/app_be/models.py create mode 100644 components/orchestration/app_be/routing.py create mode 100644 components/orchestration/app_be/serializers.py create mode 100644 components/orchestration/app_be/services/data_factory.py create mode 100644 components/orchestration/app_be/services/tests/test_data_factory.py create mode 100644 components/orchestration/app_be/settings.py create mode 100644 components/orchestration/app_be/tests.py create mode 100644 components/orchestration/app_be/urls.py create mode 100644 components/orchestration/app_be/views/__init__.py create mode 100644 components/orchestration/app_be/views/rest_api.py create mode 100644 components/orchestration/app_be/views/tests/__init__.py create mode 100644 components/orchestration/app_be/views/tests/test_rest_api.py create mode 100644 components/orchestration/app_be/views/tests/test_ws_api.py create mode 100644 components/orchestration/app_be/views/ws_api.py create mode 100644 components/orchestration/app_be/wsgi.py create mode 100644 components/orchestration/manage.py create mode 100644 components/orchestration/requirements.txt create mode 100644 components/orchestration/setup.py diff --git a/frontend/.browserslistrc b/components/control_center/.browserslistrc similarity index 100% rename from frontend/.browserslistrc rename to components/control_center/.browserslistrc diff --git a/frontend/.dockerignore b/components/control_center/.dockerignore similarity index 100% rename from frontend/.dockerignore rename to components/control_center/.dockerignore diff --git a/frontend/.editorconfig b/components/control_center/.editorconfig similarity index 100% rename from frontend/.editorconfig rename to components/control_center/.editorconfig diff --git a/frontend/.gitignore b/components/control_center/.gitignore similarity index 100% rename from frontend/.gitignore rename to components/control_center/.gitignore diff --git a/frontend/Dockerfile b/components/control_center/Dockerfile similarity index 100% rename from frontend/Dockerfile rename to components/control_center/Dockerfile diff --git a/frontend/README.md b/components/control_center/README.md similarity index 100% rename from frontend/README.md rename to components/control_center/README.md diff --git a/frontend/angular.json b/components/control_center/angular.json similarity index 100% rename from frontend/angular.json rename to components/control_center/angular.json diff --git a/frontend/e2e/app.e2e-spec.ts b/components/control_center/e2e/app.e2e-spec.ts similarity index 100% rename from frontend/e2e/app.e2e-spec.ts rename to components/control_center/e2e/app.e2e-spec.ts diff --git a/frontend/e2e/app.po.ts b/components/control_center/e2e/app.po.ts similarity index 100% rename from frontend/e2e/app.po.ts rename to components/control_center/e2e/app.po.ts diff --git a/frontend/e2e/tsconfig.e2e.json b/components/control_center/e2e/tsconfig.e2e.json similarity index 100% rename from frontend/e2e/tsconfig.e2e.json rename to components/control_center/e2e/tsconfig.e2e.json diff --git a/frontend/karma.conf.js b/components/control_center/karma.conf.js similarity index 100% rename from frontend/karma.conf.js rename to components/control_center/karma.conf.js diff --git a/frontend/package-lock.json b/components/control_center/package-lock.json similarity index 100% rename from frontend/package-lock.json rename to components/control_center/package-lock.json diff --git a/frontend/package.json b/components/control_center/package.json similarity index 100% rename from frontend/package.json rename to components/control_center/package.json diff --git a/frontend/protractor.conf.js b/components/control_center/protractor.conf.js similarity index 100% rename from frontend/protractor.conf.js rename to components/control_center/protractor.conf.js diff --git a/frontend/src/app/app-routing.module.ts b/components/control_center/src/app/app-routing.module.ts similarity index 100% rename from frontend/src/app/app-routing.module.ts rename to components/control_center/src/app/app-routing.module.ts diff --git a/frontend/src/app/app.module.ts b/components/control_center/src/app/app.module.ts similarity index 100% rename from frontend/src/app/app.module.ts rename to components/control_center/src/app/app.module.ts diff --git a/frontend/src/app/component/landing/landing.component.css b/components/control_center/src/app/component/landing/landing.component.css similarity index 100% rename from frontend/src/app/component/landing/landing.component.css rename to components/control_center/src/app/component/landing/landing.component.css diff --git a/frontend/src/app/component/landing/landing.component.html b/components/control_center/src/app/component/landing/landing.component.html similarity index 100% rename from frontend/src/app/component/landing/landing.component.html rename to components/control_center/src/app/component/landing/landing.component.html diff --git a/frontend/src/app/component/landing/landing.component.ts b/components/control_center/src/app/component/landing/landing.component.ts similarity index 100% rename from frontend/src/app/component/landing/landing.component.ts rename to components/control_center/src/app/component/landing/landing.component.ts diff --git a/frontend/src/app/component/testsubcomp/test-sub-comp.component.css b/components/control_center/src/app/component/testsubcomp/test-sub-comp.component.css similarity index 100% rename from frontend/src/app/component/testsubcomp/test-sub-comp.component.css rename to components/control_center/src/app/component/testsubcomp/test-sub-comp.component.css diff --git a/frontend/src/app/component/testsubcomp/test-sub-comp.component.html b/components/control_center/src/app/component/testsubcomp/test-sub-comp.component.html similarity index 100% rename from frontend/src/app/component/testsubcomp/test-sub-comp.component.html rename to components/control_center/src/app/component/testsubcomp/test-sub-comp.component.html diff --git a/frontend/src/app/component/testsubcomp/test-sub-comp.component.ts b/components/control_center/src/app/component/testsubcomp/test-sub-comp.component.ts similarity index 100% rename from frontend/src/app/component/testsubcomp/test-sub-comp.component.ts rename to components/control_center/src/app/component/testsubcomp/test-sub-comp.component.ts diff --git a/frontend/src/app/interfaces/interface.ts b/components/control_center/src/app/interfaces/interface.ts similarity index 100% rename from frontend/src/app/interfaces/interface.ts rename to components/control_center/src/app/interfaces/interface.ts diff --git a/frontend/src/app/services/interceptor.service.ts b/components/control_center/src/app/services/interceptor.service.ts similarity index 100% rename from frontend/src/app/services/interceptor.service.ts rename to components/control_center/src/app/services/interceptor.service.ts diff --git a/frontend/src/app/services/rest.service.ts b/components/control_center/src/app/services/rest.service.ts similarity index 100% rename from frontend/src/app/services/rest.service.ts rename to components/control_center/src/app/services/rest.service.ts diff --git a/frontend/src/app/services/websocket.service.ts b/components/control_center/src/app/services/websocket.service.ts similarity index 100% rename from frontend/src/app/services/websocket.service.ts rename to components/control_center/src/app/services/websocket.service.ts diff --git a/frontend/src/assets/.gitkeep b/components/control_center/src/assets/.gitkeep similarity index 100% rename from frontend/src/assets/.gitkeep rename to components/control_center/src/assets/.gitkeep diff --git a/frontend/src/environments/environment.prod.ts b/components/control_center/src/environments/environment.prod.ts similarity index 100% rename from frontend/src/environments/environment.prod.ts rename to components/control_center/src/environments/environment.prod.ts diff --git a/frontend/src/environments/environment.ts b/components/control_center/src/environments/environment.ts similarity index 100% rename from frontend/src/environments/environment.ts rename to components/control_center/src/environments/environment.ts diff --git a/frontend/src/favicon.ico b/components/control_center/src/favicon.ico similarity index 100% rename from frontend/src/favicon.ico rename to components/control_center/src/favicon.ico diff --git a/frontend/src/index.html b/components/control_center/src/index.html similarity index 100% rename from frontend/src/index.html rename to components/control_center/src/index.html diff --git a/frontend/src/main.ts b/components/control_center/src/main.ts similarity index 100% rename from frontend/src/main.ts rename to components/control_center/src/main.ts diff --git a/frontend/src/polyfills.ts b/components/control_center/src/polyfills.ts similarity index 100% rename from frontend/src/polyfills.ts rename to components/control_center/src/polyfills.ts diff --git a/frontend/src/styles.css b/components/control_center/src/styles.css similarity index 100% rename from frontend/src/styles.css rename to components/control_center/src/styles.css diff --git a/frontend/src/test.ts b/components/control_center/src/test.ts similarity index 100% rename from frontend/src/test.ts rename to components/control_center/src/test.ts diff --git a/frontend/src/theme.scss b/components/control_center/src/theme.scss similarity index 100% rename from frontend/src/theme.scss rename to components/control_center/src/theme.scss diff --git a/frontend/tsconfig.app.json b/components/control_center/tsconfig.app.json similarity index 100% rename from frontend/tsconfig.app.json rename to components/control_center/tsconfig.app.json diff --git a/frontend/tsconfig.json b/components/control_center/tsconfig.json similarity index 100% rename from frontend/tsconfig.json rename to components/control_center/tsconfig.json diff --git a/frontend/tslint.json b/components/control_center/tslint.json similarity index 100% rename from frontend/tslint.json rename to components/control_center/tslint.json diff --git a/backend/.gitignore b/components/event_store/.gitignore similarity index 100% rename from backend/.gitignore rename to components/event_store/.gitignore diff --git a/backend/.run/createsuperuser.run.xml b/components/event_store/.run/createsuperuser.run.xml similarity index 100% rename from backend/.run/createsuperuser.run.xml rename to components/event_store/.run/createsuperuser.run.xml diff --git a/backend/.run/makemigrations.run.xml b/components/event_store/.run/makemigrations.run.xml similarity index 100% rename from backend/.run/makemigrations.run.xml rename to components/event_store/.run/makemigrations.run.xml diff --git a/backend/.run/migrate.run.xml b/components/event_store/.run/migrate.run.xml similarity index 100% rename from backend/.run/migrate.run.xml rename to components/event_store/.run/migrate.run.xml diff --git a/backend/.run/runserver.run.xml b/components/event_store/.run/runserver.run.xml similarity index 100% rename from backend/.run/runserver.run.xml rename to components/event_store/.run/runserver.run.xml diff --git a/backend/Dockerfile b/components/event_store/Dockerfile similarity index 100% rename from backend/Dockerfile rename to components/event_store/Dockerfile diff --git a/backend/README.md b/components/event_store/README.md similarity index 100% rename from backend/README.md rename to components/event_store/README.md diff --git a/backend/__init__.py b/components/event_store/__init__.py similarity index 100% rename from backend/__init__.py rename to components/event_store/__init__.py diff --git a/backend/app_be/__init__.py b/components/event_store/app_be/__init__.py similarity index 100% rename from backend/app_be/__init__.py rename to components/event_store/app_be/__init__.py diff --git a/backend/app_be/admin.py b/components/event_store/app_be/admin.py similarity index 100% rename from backend/app_be/admin.py rename to components/event_store/app_be/admin.py diff --git a/backend/app_be/apps.py b/components/event_store/app_be/apps.py similarity index 100% rename from backend/app_be/apps.py rename to components/event_store/app_be/apps.py diff --git a/backend/app_be/models.py b/components/event_store/app_be/models.py similarity index 100% rename from backend/app_be/models.py rename to components/event_store/app_be/models.py diff --git a/backend/app_be/routing.py b/components/event_store/app_be/routing.py similarity index 100% rename from backend/app_be/routing.py rename to components/event_store/app_be/routing.py diff --git a/backend/app_be/serializers.py b/components/event_store/app_be/serializers.py similarity index 100% rename from backend/app_be/serializers.py rename to components/event_store/app_be/serializers.py diff --git a/backend/app_be/services/data_factory.py b/components/event_store/app_be/services/data_factory.py similarity index 100% rename from backend/app_be/services/data_factory.py rename to components/event_store/app_be/services/data_factory.py diff --git a/backend/app_be/services/tests/test_data_factory.py b/components/event_store/app_be/services/tests/test_data_factory.py similarity index 100% rename from backend/app_be/services/tests/test_data_factory.py rename to components/event_store/app_be/services/tests/test_data_factory.py diff --git a/backend/app_be/settings.py b/components/event_store/app_be/settings.py similarity index 100% rename from backend/app_be/settings.py rename to components/event_store/app_be/settings.py diff --git a/backend/app_be/tests.py b/components/event_store/app_be/tests.py similarity index 100% rename from backend/app_be/tests.py rename to components/event_store/app_be/tests.py diff --git a/backend/app_be/urls.py b/components/event_store/app_be/urls.py similarity index 100% rename from backend/app_be/urls.py rename to components/event_store/app_be/urls.py diff --git a/backend/app_be/views/__init__.py b/components/event_store/app_be/views/__init__.py similarity index 100% rename from backend/app_be/views/__init__.py rename to components/event_store/app_be/views/__init__.py diff --git a/backend/app_be/views/rest_api.py b/components/event_store/app_be/views/rest_api.py similarity index 100% rename from backend/app_be/views/rest_api.py rename to components/event_store/app_be/views/rest_api.py diff --git a/backend/app_be/views/tests/__init__.py b/components/event_store/app_be/views/tests/__init__.py similarity index 100% rename from backend/app_be/views/tests/__init__.py rename to components/event_store/app_be/views/tests/__init__.py diff --git a/backend/app_be/views/tests/test_rest_api.py b/components/event_store/app_be/views/tests/test_rest_api.py similarity index 100% rename from backend/app_be/views/tests/test_rest_api.py rename to components/event_store/app_be/views/tests/test_rest_api.py diff --git a/backend/app_be/views/tests/test_ws_api.py b/components/event_store/app_be/views/tests/test_ws_api.py similarity index 100% rename from backend/app_be/views/tests/test_ws_api.py rename to components/event_store/app_be/views/tests/test_ws_api.py diff --git a/backend/app_be/views/ws_api.py b/components/event_store/app_be/views/ws_api.py similarity index 100% rename from backend/app_be/views/ws_api.py rename to components/event_store/app_be/views/ws_api.py diff --git a/backend/app_be/wsgi.py b/components/event_store/app_be/wsgi.py similarity index 100% rename from backend/app_be/wsgi.py rename to components/event_store/app_be/wsgi.py diff --git a/backend/manage.py b/components/event_store/manage.py similarity index 100% rename from backend/manage.py rename to components/event_store/manage.py diff --git a/backend/requirements.txt b/components/event_store/requirements.txt similarity index 100% rename from backend/requirements.txt rename to components/event_store/requirements.txt diff --git a/backend/setup.py b/components/event_store/setup.py similarity index 100% rename from backend/setup.py rename to components/event_store/setup.py diff --git a/components/i_feed/traffic_light.py b/components/i_feed/traffic_light.py new file mode 100644 index 0000000..4640904 --- /dev/null +++ b/components/i_feed/traffic_light.py @@ -0,0 +1 @@ +# TODO diff --git a/components/i_feed/vehicle.py b/components/i_feed/vehicle.py new file mode 100644 index 0000000..4640904 --- /dev/null +++ b/components/i_feed/vehicle.py @@ -0,0 +1 @@ +# TODO diff --git a/components/orchestration/.gitignore b/components/orchestration/.gitignore new file mode 100644 index 0000000..23385d0 --- /dev/null +++ b/components/orchestration/.gitignore @@ -0,0 +1,6 @@ +venv +*.pyc +staticfiles +.env +*.sqlite3 +homeschooling_be_app.egg-info diff --git a/components/orchestration/.run/createsuperuser.run.xml b/components/orchestration/.run/createsuperuser.run.xml new file mode 100644 index 0000000..5fc8ae4 --- /dev/null +++ b/components/orchestration/.run/createsuperuser.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/components/orchestration/.run/makemigrations.run.xml b/components/orchestration/.run/makemigrations.run.xml new file mode 100644 index 0000000..b341723 --- /dev/null +++ b/components/orchestration/.run/makemigrations.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/components/orchestration/.run/migrate.run.xml b/components/orchestration/.run/migrate.run.xml new file mode 100644 index 0000000..268a119 --- /dev/null +++ b/components/orchestration/.run/migrate.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/components/orchestration/.run/runserver.run.xml b/components/orchestration/.run/runserver.run.xml new file mode 100644 index 0000000..3f7b118 --- /dev/null +++ b/components/orchestration/.run/runserver.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/components/orchestration/Dockerfile b/components/orchestration/Dockerfile new file mode 100644 index 0000000..5a797cf --- /dev/null +++ b/components/orchestration/Dockerfile @@ -0,0 +1,19 @@ +FROM python:3.8-slim +ENV PYTHONUNBUFFERED 1 +RUN apt-get update +RUN apt-get install -y build-essential gcc + +RUN python -m venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" + +RUN python -m pip install --upgrade pip + +ENV PATH="/opt/venv/bin:$PATH" + +RUN mkdir /code +WORKDIR /code +COPY setup.py /code/ +COPY requirements.txt /code/ +RUN pip install -r requirements.txt + +COPY . /code/ diff --git a/components/orchestration/README.md b/components/orchestration/README.md new file mode 100644 index 0000000..274fb7c --- /dev/null +++ b/components/orchestration/README.md @@ -0,0 +1,20 @@ +# AIC Django Middleware + +## Tips +* use Jetbrains Pycharm IDE +* create and use a virtual environment + +## Setup + $ cd ./middleware + + $ pip install -r requirements.txt + + $ python manage.py makemigrations + $ python manage.py migrate + $ python manage.py createsuperuser + + $ python mangge.py runserver + +## ERROR handling +Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools" +
Install missing deps https://visualstudio.microsoft.com/visual-cpp-build-tools/ diff --git a/components/orchestration/__init__.py b/components/orchestration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/components/orchestration/app_be/__init__.py b/components/orchestration/app_be/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/components/orchestration/app_be/admin.py b/components/orchestration/app_be/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/components/orchestration/app_be/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/components/orchestration/app_be/apps.py b/components/orchestration/app_be/apps.py new file mode 100644 index 0000000..d4828a5 --- /dev/null +++ b/components/orchestration/app_be/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AppBeConfig(AppConfig): + name = 'app_be' diff --git a/components/orchestration/app_be/models.py b/components/orchestration/app_be/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/components/orchestration/app_be/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/components/orchestration/app_be/routing.py b/components/orchestration/app_be/routing.py new file mode 100644 index 0000000..b635884 --- /dev/null +++ b/components/orchestration/app_be/routing.py @@ -0,0 +1,17 @@ +from django.conf.urls import url + +from channels.routing import ProtocolTypeRouter, URLRouter +from channels.sessions import SessionMiddlewareStack +from django.core.asgi import get_asgi_application + +from .views.ws_api import CustomConsumer + +application = ProtocolTypeRouter({ + # Django's ASGI application to handle traditional HTTP requests + "http": get_asgi_application(), + + # WebSocket send handler + "websocket": SessionMiddlewareStack(URLRouter([ + url(r"^test-ws-endpoint/$", CustomConsumer.as_asgi()), + ])) +}) diff --git a/components/orchestration/app_be/serializers.py b/components/orchestration/app_be/serializers.py new file mode 100644 index 0000000..de8ae38 --- /dev/null +++ b/components/orchestration/app_be/serializers.py @@ -0,0 +1,3 @@ +from rest_framework import serializers + +# add serializer here diff --git a/components/orchestration/app_be/services/data_factory.py b/components/orchestration/app_be/services/data_factory.py new file mode 100644 index 0000000..e69de29 diff --git a/components/orchestration/app_be/services/tests/test_data_factory.py b/components/orchestration/app_be/services/tests/test_data_factory.py new file mode 100644 index 0000000..e69de29 diff --git a/components/orchestration/app_be/settings.py b/components/orchestration/app_be/settings.py new file mode 100644 index 0000000..1c23499 --- /dev/null +++ b/components/orchestration/app_be/settings.py @@ -0,0 +1,221 @@ +""" +For more information on this file, see +https://docs.djangoproject.com/en/2.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.0/ref/settings/ +""" +import datetime +import os + +# set the websocket routing module location here +ASGI_APPLICATION = 'app_be.routing.application' + + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = "{{ secret_key }}" + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +# Application definition + +INSTALLED_APPS = [ + 'app_be', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'channels', + 'rest_framework' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +""" +default permission and authentication classes +sets the standard privileges needed to access an api +for now, no classes necessary and therefore disabled! +""" +REST_FRAMEWORK = { + 'DEFAULT_PERMISSION_CLASSES': ( + # 'rest_framework.permissions.IsAuthenticated', # last comma is MANDATORY + [] + ), + 'DEFAULT_AUTHENTICATION_CLASSES': ( + # 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', # last comma is MANDATORY + [] + ) +} + + +# configuration of jason web token authentication +JWT_AUTH = { + 'JWT_VERIFY': True, + 'JWT_AUTH_HEADER_PREFIX': 'Bearer', + 'JWT_ALLOW_REFRESH': True, + # 60 minutes + 'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=3600), + # debug 10 seconds + # 'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=10), +} + +if DEBUG: + # install corsheaders to enable to run + # the rest (django) an gui (angular) server on two different ports + INSTALLED_APPS.append("corsheaders") + MIDDLEWARE.append('corsheaders.middleware.CorsMiddleware') + MIDDLEWARE.append('django.middleware.common.BrokenLinkEmailsMiddleware') + MIDDLEWARE.append('django.middleware.common.CommonMiddleware') + CORS_ORIGIN_ALLOW_ALL = True + ALLOWED_HOSTS = [ + "*" + ] +else: + ALLOWED_HOSTS = [ + "*", + "127.0.0.1" + ] + +ROOT_URLCONF = 'app_be.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + 'debug': DEBUG, + }, + }, +] + +WSGI_APPLICATION = 'app_be.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + +# Internationalization +# https://docs.djangoproject.com/en/2.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' +TIME_ZONE = 'UTC' +USE_I18N = True +USE_L10N = True +USE_TZ = True + +# Change 'default' database configuration with $DATABASE_URL. +# DATABASES['default'].update(dj_database_url.config(conn_max_age=500, ssl_require=True)) + +# Honor the 'X-Forwarded-Proto' header for request.is_secure() +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.0/howto/static-files/ + +STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles') +STATIC_URL = '/static/' + +# Extra places for collectstatic to find static files. +STATICFILES_DIRS = [ + os.path.join(PROJECT_ROOT, 'static'), +] + +# Simplified static file serving. +# https://warehouse.python.org/project/whitenoise/ +STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'formatters': { + 'verbose': { + 'format': '{asctime} - {levelname}: {message} ({pathname}:{lineno})', + 'style': '{', + } + }, + 'handlers': { + 'console': { + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'verbose' + }, + 'logfile': { + 'level': 'DEBUG', + 'class': 'logging.FileHandler', + 'filename': BASE_DIR + "/../logfile", + 'formatter': 'verbose' + }, + }, + + 'loggers': { + 'rdg': { + 'handlers': ['console', 'logfile'], + 'level': 'DEBUG', + }, + 'rdg_rest': { + 'handlers': ['console', 'logfile'], + 'level': 'DEBUG', + }, + 'rdg_angular': { + 'handlers': ['console', 'logfile'], + 'level': 'DEBUG', + }, + }, + 'root': { + 'level': 'DEBUG', + 'handlers': [] # pass a empty list to avoid duplicte log entries + }, +} + +# increase the maximum upload size of files +DATA_UPLOAD_MAX_MEMORY_SIZE = 104857600 + diff --git a/components/orchestration/app_be/tests.py b/components/orchestration/app_be/tests.py new file mode 100644 index 0000000..4890637 --- /dev/null +++ b/components/orchestration/app_be/tests.py @@ -0,0 +1,15 @@ +from django.test import TestCase + +# Create your tests here. +from rest_framework import status +from rest_framework.test import APITestCase + + +class AccountTests(APITestCase): + def test_create_account(self): + """ + Ensure we can create a new account object. + """ + url = '/test/' + response = self.client.get(url, format='json') + self.assertEqual(response.status_code, status.HTTP_200_OK) diff --git a/components/orchestration/app_be/urls.py b/components/orchestration/app_be/urls.py new file mode 100644 index 0000000..79a7a73 --- /dev/null +++ b/components/orchestration/app_be/urls.py @@ -0,0 +1,30 @@ +"""{{ project_name }} URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.conf.urls import url +from django.contrib import admin +from django.urls import path +from rest_framework.routers import DefaultRouter + +from app_be.views.rest_api import TestApiClass + +urlpatterns = [ + path('admin/', admin.site.urls), + url(r'^test/', TestApiClass.test_api), +] + +router = DefaultRouter() + +urlpatterns.extend(router.urls) diff --git a/components/orchestration/app_be/views/__init__.py b/components/orchestration/app_be/views/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/components/orchestration/app_be/views/rest_api.py b/components/orchestration/app_be/views/rest_api.py new file mode 100644 index 0000000..de7bb8a --- /dev/null +++ b/components/orchestration/app_be/views/rest_api.py @@ -0,0 +1,15 @@ +import logging + +from django.http import JsonResponse + +from rest_framework.decorators import api_view + +logger = logging.getLogger(__name__) + + +class TestApiClass: + @staticmethod + @api_view(['GET']) + def test_api(request): + logger.debug('Test api call: {}'.format(request)) + return JsonResponse({'Result': 'success'}, safe=False) diff --git a/components/orchestration/app_be/views/tests/__init__.py b/components/orchestration/app_be/views/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/components/orchestration/app_be/views/tests/test_rest_api.py b/components/orchestration/app_be/views/tests/test_rest_api.py new file mode 100644 index 0000000..e69de29 diff --git a/components/orchestration/app_be/views/tests/test_ws_api.py b/components/orchestration/app_be/views/tests/test_ws_api.py new file mode 100644 index 0000000..e69de29 diff --git a/components/orchestration/app_be/views/ws_api.py b/components/orchestration/app_be/views/ws_api.py new file mode 100644 index 0000000..a648867 --- /dev/null +++ b/components/orchestration/app_be/views/ws_api.py @@ -0,0 +1,18 @@ +import logging + +from channels.generic.websocket import WebsocketConsumer + + +logger = logging.getLogger(__name__) + + +class CustomConsumer(WebsocketConsumer): + def connect(self): + self.accept() + + def receive(self, text_data=None, bytes_data=None): + self.send('1. response: {}'.format(text_data)) + self.send('2. response: {}'.format(text_data)) + + def disconnect(self, code): + pass diff --git a/components/orchestration/app_be/wsgi.py b/components/orchestration/app_be/wsgi.py new file mode 100644 index 0000000..8addf73 --- /dev/null +++ b/components/orchestration/app_be/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for {{ project_name }} project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ app_be }}.settings") + +application = get_wsgi_application() diff --git a/components/orchestration/manage.py b/components/orchestration/manage.py new file mode 100644 index 0000000..06a5a5d --- /dev/null +++ b/components/orchestration/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app_be.settings") + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + execute_from_command_line(sys.argv) diff --git a/components/orchestration/requirements.txt b/components/orchestration/requirements.txt new file mode 100644 index 0000000..f8fbb87 --- /dev/null +++ b/components/orchestration/requirements.txt @@ -0,0 +1,2 @@ +# install setup.py in dev mode +-e . diff --git a/components/orchestration/setup.py b/components/orchestration/setup.py new file mode 100644 index 0000000..47df6b4 --- /dev/null +++ b/components/orchestration/setup.py @@ -0,0 +1,23 @@ +import os +from setuptools import find_packages, setup + +# allow setup.py to be run from any path +os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) + +setup( + name='homeschooling-be-app', + version='0.0.0', + packages=find_packages(), + include_package_data=True, + install_requires=[ + 'Django==3.0.5', + 'djangorestframework==3.12.1', + 'djangorestframework-jwt==1.11.0', + 'django-cors-headers==3.5.0', + 'channels==3.0.1', + 'channels_redis==3.2.0', + 'whitenoise==5.2.0', + ], + license='BSD License', # example license + description='DESCRIPTION' +)