diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8604b6c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +.git +.vscode + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cba5dcb..7be4877 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,7 @@ jobs: run: | python3 -m pip install --upgrade pip pip3 install pipenv + cd back-end pipenv install pipenv run echo "SECRET_KEY='TEMPORARY SECRET KEY'" > vp/.environment @@ -61,4 +62,3 @@ jobs: with: collection: Postman/Visual\ Programming-Tests.postman_collection.json environment: Postman/Local\ Testing.postman_environment.json - \ No newline at end of file diff --git a/CLI/__init__.py b/back-end/CLI/__init__.py similarity index 100% rename from CLI/__init__.py rename to back-end/CLI/__init__.py diff --git a/CLI/cli.py b/back-end/CLI/cli.py similarity index 100% rename from CLI/cli.py rename to back-end/CLI/cli.py diff --git a/CLI/setup.py b/back-end/CLI/setup.py similarity index 100% rename from CLI/setup.py rename to back-end/CLI/setup.py diff --git a/CLI/test.py b/back-end/CLI/test.py similarity index 100% rename from CLI/test.py rename to back-end/CLI/test.py diff --git a/back-end/Dockerfile b/back-end/Dockerfile new file mode 100644 index 0000000..1fb0106 --- /dev/null +++ b/back-end/Dockerfile @@ -0,0 +1,19 @@ +FROM python:3.8 + +WORKDIR /visual-programming/back-end + +COPY Pipfile Pipfile.lock ./ +COPY CLI/ ./CLI/ +COPY pyworkflow/ ./pyworkflow/ + +RUN pip install pipenv +RUN pipenv install --dev --ignore-pipfile + +COPY vp/ ./vp +RUN echo "SECRET_KEY=tmp" > vp/.environment + +EXPOSE 8000 + +WORKDIR /visual-programming/back-end/vp + +CMD pipenv run python manage.py runserver 0.0.0.0:8000 diff --git a/Pipfile b/back-end/Pipfile similarity index 100% rename from Pipfile rename to back-end/Pipfile diff --git a/Pipfile.lock b/back-end/Pipfile.lock similarity index 100% rename from Pipfile.lock rename to back-end/Pipfile.lock diff --git a/pyworkflow/pyworkflow/.coveragerc b/back-end/pyworkflow/pyworkflow/.coveragerc similarity index 100% rename from pyworkflow/pyworkflow/.coveragerc rename to back-end/pyworkflow/pyworkflow/.coveragerc diff --git a/pyworkflow/pyworkflow/__init__.py b/back-end/pyworkflow/pyworkflow/__init__.py similarity index 100% rename from pyworkflow/pyworkflow/__init__.py rename to back-end/pyworkflow/pyworkflow/__init__.py diff --git a/pyworkflow/pyworkflow/node.py b/back-end/pyworkflow/pyworkflow/node.py similarity index 100% rename from pyworkflow/pyworkflow/node.py rename to back-end/pyworkflow/pyworkflow/node.py diff --git a/pyworkflow/pyworkflow/node_factory.py b/back-end/pyworkflow/pyworkflow/node_factory.py similarity index 100% rename from pyworkflow/pyworkflow/node_factory.py rename to back-end/pyworkflow/pyworkflow/node_factory.py diff --git a/pyworkflow/pyworkflow/nodes/__init__.py b/back-end/pyworkflow/pyworkflow/nodes/__init__.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/__init__.py rename to back-end/pyworkflow/pyworkflow/nodes/__init__.py diff --git a/pyworkflow/pyworkflow/nodes/custom_nodes/table_creator.py b/back-end/pyworkflow/pyworkflow/nodes/custom_nodes/table_creator.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/custom_nodes/table_creator.py rename to back-end/pyworkflow/pyworkflow/nodes/custom_nodes/table_creator.py diff --git a/pyworkflow/pyworkflow/nodes/flow_control/__init__.py b/back-end/pyworkflow/pyworkflow/nodes/flow_control/__init__.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/flow_control/__init__.py rename to back-end/pyworkflow/pyworkflow/nodes/flow_control/__init__.py diff --git a/pyworkflow/pyworkflow/nodes/flow_control/integer_input.py b/back-end/pyworkflow/pyworkflow/nodes/flow_control/integer_input.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/flow_control/integer_input.py rename to back-end/pyworkflow/pyworkflow/nodes/flow_control/integer_input.py diff --git a/pyworkflow/pyworkflow/nodes/flow_control/string_input.py b/back-end/pyworkflow/pyworkflow/nodes/flow_control/string_input.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/flow_control/string_input.py rename to back-end/pyworkflow/pyworkflow/nodes/flow_control/string_input.py diff --git a/pyworkflow/pyworkflow/nodes/io/__init__.py b/back-end/pyworkflow/pyworkflow/nodes/io/__init__.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/io/__init__.py rename to back-end/pyworkflow/pyworkflow/nodes/io/__init__.py diff --git a/pyworkflow/pyworkflow/nodes/io/read_csv.py b/back-end/pyworkflow/pyworkflow/nodes/io/read_csv.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/io/read_csv.py rename to back-end/pyworkflow/pyworkflow/nodes/io/read_csv.py diff --git a/pyworkflow/pyworkflow/nodes/io/write_csv.py b/back-end/pyworkflow/pyworkflow/nodes/io/write_csv.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/io/write_csv.py rename to back-end/pyworkflow/pyworkflow/nodes/io/write_csv.py diff --git a/pyworkflow/pyworkflow/nodes/manipulation/__init__.py b/back-end/pyworkflow/pyworkflow/nodes/manipulation/__init__.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/manipulation/__init__.py rename to back-end/pyworkflow/pyworkflow/nodes/manipulation/__init__.py diff --git a/pyworkflow/pyworkflow/nodes/manipulation/filter.py b/back-end/pyworkflow/pyworkflow/nodes/manipulation/filter.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/manipulation/filter.py rename to back-end/pyworkflow/pyworkflow/nodes/manipulation/filter.py diff --git a/pyworkflow/pyworkflow/nodes/manipulation/join.py b/back-end/pyworkflow/pyworkflow/nodes/manipulation/join.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/manipulation/join.py rename to back-end/pyworkflow/pyworkflow/nodes/manipulation/join.py diff --git a/pyworkflow/pyworkflow/nodes/manipulation/pivot.py b/back-end/pyworkflow/pyworkflow/nodes/manipulation/pivot.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/manipulation/pivot.py rename to back-end/pyworkflow/pyworkflow/nodes/manipulation/pivot.py diff --git a/pyworkflow/pyworkflow/nodes/visualization/__init__.py b/back-end/pyworkflow/pyworkflow/nodes/visualization/__init__.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/visualization/__init__.py rename to back-end/pyworkflow/pyworkflow/nodes/visualization/__init__.py diff --git a/pyworkflow/pyworkflow/nodes/visualization/graph.py b/back-end/pyworkflow/pyworkflow/nodes/visualization/graph.py similarity index 100% rename from pyworkflow/pyworkflow/nodes/visualization/graph.py rename to back-end/pyworkflow/pyworkflow/nodes/visualization/graph.py diff --git a/pyworkflow/pyworkflow/parameters.py b/back-end/pyworkflow/pyworkflow/parameters.py similarity index 100% rename from pyworkflow/pyworkflow/parameters.py rename to back-end/pyworkflow/pyworkflow/parameters.py diff --git a/pyworkflow/pyworkflow/tests/sample_test_data.py b/back-end/pyworkflow/pyworkflow/tests/sample_test_data.py similarity index 100% rename from pyworkflow/pyworkflow/tests/sample_test_data.py rename to back-end/pyworkflow/pyworkflow/tests/sample_test_data.py diff --git a/pyworkflow/pyworkflow/tests/test_node.py b/back-end/pyworkflow/pyworkflow/tests/test_node.py similarity index 100% rename from pyworkflow/pyworkflow/tests/test_node.py rename to back-end/pyworkflow/pyworkflow/tests/test_node.py diff --git a/pyworkflow/pyworkflow/tests/test_parameters.py b/back-end/pyworkflow/pyworkflow/tests/test_parameters.py similarity index 100% rename from pyworkflow/pyworkflow/tests/test_parameters.py rename to back-end/pyworkflow/pyworkflow/tests/test_parameters.py diff --git a/pyworkflow/pyworkflow/tests/test_pyworkflow.py b/back-end/pyworkflow/pyworkflow/tests/test_pyworkflow.py similarity index 100% rename from pyworkflow/pyworkflow/tests/test_pyworkflow.py rename to back-end/pyworkflow/pyworkflow/tests/test_pyworkflow.py diff --git a/pyworkflow/pyworkflow/tests/test_workflow.py b/back-end/pyworkflow/pyworkflow/tests/test_workflow.py similarity index 100% rename from pyworkflow/pyworkflow/tests/test_workflow.py rename to back-end/pyworkflow/pyworkflow/tests/test_workflow.py diff --git a/pyworkflow/pyworkflow/workflow.py b/back-end/pyworkflow/pyworkflow/workflow.py similarity index 100% rename from pyworkflow/pyworkflow/workflow.py rename to back-end/pyworkflow/pyworkflow/workflow.py diff --git a/pyworkflow/setup.py b/back-end/pyworkflow/setup.py similarity index 100% rename from pyworkflow/setup.py rename to back-end/pyworkflow/setup.py diff --git a/vp/manage.py b/back-end/vp/manage.py similarity index 100% rename from vp/manage.py rename to back-end/vp/manage.py diff --git a/vp/node/__init__.py b/back-end/vp/node/__init__.py similarity index 100% rename from vp/node/__init__.py rename to back-end/vp/node/__init__.py diff --git a/vp/node/admin.py b/back-end/vp/node/admin.py similarity index 100% rename from vp/node/admin.py rename to back-end/vp/node/admin.py diff --git a/vp/node/apps.py b/back-end/vp/node/apps.py similarity index 100% rename from vp/node/apps.py rename to back-end/vp/node/apps.py diff --git a/vp/node/migrations/__init__.py b/back-end/vp/node/migrations/__init__.py similarity index 100% rename from vp/node/migrations/__init__.py rename to back-end/vp/node/migrations/__init__.py diff --git a/vp/node/models.py b/back-end/vp/node/models.py similarity index 100% rename from vp/node/models.py rename to back-end/vp/node/models.py diff --git a/vp/node/tests.py b/back-end/vp/node/tests.py similarity index 100% rename from vp/node/tests.py rename to back-end/vp/node/tests.py diff --git a/vp/node/urls.py b/back-end/vp/node/urls.py similarity index 100% rename from vp/node/urls.py rename to back-end/vp/node/urls.py diff --git a/vp/node/views.py b/back-end/vp/node/views.py similarity index 100% rename from vp/node/views.py rename to back-end/vp/node/views.py diff --git a/vp/vp/__init__.py b/back-end/vp/vp/__init__.py similarity index 100% rename from vp/vp/__init__.py rename to back-end/vp/vp/__init__.py diff --git a/vp/vp/asgi.py b/back-end/vp/vp/asgi.py similarity index 100% rename from vp/vp/asgi.py rename to back-end/vp/vp/asgi.py diff --git a/vp/vp/settings.py b/back-end/vp/vp/settings.py similarity index 94% rename from vp/vp/settings.py rename to back-end/vp/vp/settings.py index 49453f9..79ff0ec 100644 --- a/vp/vp/settings.py +++ b/back-end/vp/vp/settings.py @@ -25,7 +25,12 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['back-end:8000', + 'back-end', + 'localhost', + '127.0.0.1', + '0.0.0.0', + '[::1]'] # Application definition @@ -81,7 +86,7 @@ # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases -### Not yet setup +# Not yet setup DATABASES = {} MEDIA_ROOT = '/tmp' diff --git a/vp/vp/urls.py b/back-end/vp/vp/urls.py similarity index 100% rename from vp/vp/urls.py rename to back-end/vp/vp/urls.py diff --git a/vp/vp/views.py b/back-end/vp/vp/views.py similarity index 100% rename from vp/vp/views.py rename to back-end/vp/vp/views.py diff --git a/vp/vp/wsgi.py b/back-end/vp/vp/wsgi.py similarity index 100% rename from vp/vp/wsgi.py rename to back-end/vp/vp/wsgi.py diff --git a/vp/workflow/__init__.py b/back-end/vp/workflow/__init__.py similarity index 100% rename from vp/workflow/__init__.py rename to back-end/vp/workflow/__init__.py diff --git a/vp/workflow/admin.py b/back-end/vp/workflow/admin.py similarity index 100% rename from vp/workflow/admin.py rename to back-end/vp/workflow/admin.py diff --git a/vp/workflow/apps.py b/back-end/vp/workflow/apps.py similarity index 100% rename from vp/workflow/apps.py rename to back-end/vp/workflow/apps.py diff --git a/vp/workflow/middleware.py b/back-end/vp/workflow/middleware.py similarity index 100% rename from vp/workflow/middleware.py rename to back-end/vp/workflow/middleware.py diff --git a/vp/workflow/migrations/__init__.py b/back-end/vp/workflow/migrations/__init__.py similarity index 100% rename from vp/workflow/migrations/__init__.py rename to back-end/vp/workflow/migrations/__init__.py diff --git a/vp/workflow/models.py b/back-end/vp/workflow/models.py similarity index 100% rename from vp/workflow/models.py rename to back-end/vp/workflow/models.py diff --git a/vp/workflow/tests.py b/back-end/vp/workflow/tests.py similarity index 100% rename from vp/workflow/tests.py rename to back-end/vp/workflow/tests.py diff --git a/vp/workflow/urls.py b/back-end/vp/workflow/urls.py similarity index 100% rename from vp/workflow/urls.py rename to back-end/vp/workflow/urls.py diff --git a/vp/workflow/views.py b/back-end/vp/workflow/views.py similarity index 100% rename from vp/workflow/views.py rename to back-end/vp/workflow/views.py diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7b2a9a0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: "3.3" +services: + back-end: + build: ./back-end + ports: + - "8000:8000" + command: bash -c "pipenv run python manage.py runserver 0.0.0.0:8000" + environment: + - DJANGO_ENV=development + front-end: + build: ./front-end + stdin_open: true + ports: + - "3000:3000" + environment: + - NODE_ENV=development + depends_on: + - back-end + links: + - back-end + command: npm start diff --git a/front-end/Dockerfile b/front-end/Dockerfile new file mode 100644 index 0000000..2e7842e --- /dev/null +++ b/front-end/Dockerfile @@ -0,0 +1,14 @@ +FROM node:14-alpine + +WORKDIR /visual-programming/front-end + +COPY package.json . + +RUN npm install + +COPY src/ ./src/ +COPY public/ ./public/ + +EXPOSE 3000 + +CMD npm start diff --git a/front-end/package.json b/front-end/package.json index 5cd81a3..64507d6 100644 --- a/front-end/package.json +++ b/front-end/package.json @@ -67,7 +67,7 @@ "last 1 safari version" ] }, - "proxy": "http://localhost:8000", + "proxy": "http://back-end:8000", "devDependencies": { "@babel/preset-env": "^7.9.5", "@babel/preset-react": "^7.9.4", diff --git a/vp/db.sqlite3 b/vp/db.sqlite3 deleted file mode 100644 index e69de29..0000000