diff --git a/.editorconfig b/.editorconfig index 8ac421b7..658dda71 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,7 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -[*.{py,rst,ini}] +[*.{py,rst,ini,sh}] indent_style = space indent_size = 4 diff --git a/.gitignore b/.gitignore index 1f9e5551..3fa6450e 100644 --- a/.gitignore +++ b/.gitignore @@ -283,3 +283,5 @@ cypress/screenshots cypress/test-reports /server/vbv_lernwelt/static/css/tailwind.css +/server/vbv_lernwelt/static/vue/ +/server/vbv_lernwelt/templates/vue/index.html diff --git a/README.md b/README.md index 8a1be72e..9b1affa6 100644 --- a/README.md +++ b/README.md @@ -11,38 +11,38 @@ npm run tailwind # run vue vite dev server cd client && npm run dev -# run django dev server -cd server && python manage.py runserver +# reset db and run django dev server +./prepare_server.sh ``` ## Installation See `.tool-versions` file for used django and node version +You have to set up at least the following environment variables: + +```bash +export IT_APP_ENVIRONMENT=development +``` + +See `.env_secrets/local_daniel.env` for more possible environment variables. +Especially set correct values for `POSTGRES_*` and `DATABASE_URL` + + ### Server part -Run every sub command in the `server` directory - -Create a new PostgreSQL database and role +Install python dependencies: ```bash -createdb vbv_lernwelt -createuser vbv_lernwelt +pip install -r server/requirements/requirements-dev.txt ``` -Set the environment variable accordingly +The "prepare_server.sh" script will create the database according to `POSTGRES_*` environment variables. +It will also setup the tables for django and run the django development server. ```bash -export VBV_DATABASE_URL='postgres://vbv_lernwelt@localhost:5432/vbv_lernwelt' -``` - -Set `VBV_DJANGO_READ_DOT_ENV_FILE=True` to make the config read the `example.env` file (with direnv!?). - -```bash -python manage.py migrate - -# sync server -python manage.py runserver +# will initial`migrate` and `runserver` etc... +./prepare_server.sh # or async server # uvicorn config.asgi:application --host 0.0.0.0 --reload @@ -50,9 +50,9 @@ python manage.py runserver ### Client part -Run every command in the `client` directory - ```bash +cd client + npm install # run dev server @@ -64,6 +64,7 @@ npm run dev Cypress and TailwindCSS ist installed for client and server, so there is this package.json on the project root directory ```bash +# in project root directory npm install ``` @@ -90,8 +91,6 @@ npm install #### Install the tailwind css Plugin from Jetbrains - - ## Wagtail API intro get all pages: diff --git a/caprover_create_app.py b/caprover_create_app.py index 44cde962..2306907f 100644 --- a/caprover_create_app.py +++ b/caprover_create_app.py @@ -28,7 +28,7 @@ cap.deploy_one_click_app( namespace='vbv-lernwelt', # check https://github.com/caprover/one-click-apps/blob/master/public/v4/apps/postgres.yml app_variables={ - '$$cap_postgres_version': '14.1', + '$$cap_postgres_version': '14.2', '$$cap_pg_user': db_user, '$$cap_pg_pass': db_pass, '$$cap_pg_db': db_name, @@ -44,11 +44,11 @@ cap.create_and_update_app( image_name='docker.io/iterativ/vbv-lernwelt-django', environment_variables={ # 'DJANGO_SETTINGS_MODULE': 'config.settings.base', - 'VBV_DJANGO_SECRET_KEY': env.str('VBV_DJANGO_SECRET_KEY'), - 'VBV_DJANGO_ADMIN_URL': env.str('VBV_DJANGO_ADMIN_URL'), - 'VBV_DJANGO_ALLOWED_HOSTS': env.str('VBV_DJANGO_ALLOWED_HOSTS'), - 'VBV_SENTRY_DSN': env.str('VBV_SENTRY_DSN'), - 'VBV_DJANGO_DEV_MODE': 'caprover', + 'IT_DJANGO_SECRET_KEY': env.str('IT_DJANGO_SECRET_KEY'), + 'IT_DJANGO_ADMIN_URL': env.str('IT_DJANGO_ADMIN_URL'), + 'IT_DJANGO_ALLOWED_HOSTS': env.str('IT_DJANGO_ALLOWED_HOSTS'), + 'IT_SENTRY_DSN': env.str('IT_SENTRY_DSN'), + 'IT_APP_ENVIRONMENT': 'caprover', 'POSTGRES_HOST': 'srv-captain--vbv-lernwelt-postgres-db', 'POSTGRES_PORT': 5432, 'POSTGRES_DB': db_name, diff --git a/caprover_deploy.sh b/caprover_deploy.sh index 292cf0d7..aa996df9 100755 --- a/caprover_deploy.sh +++ b/caprover_deploy.sh @@ -1,5 +1,8 @@ #!/bin/bash +# create client +npm run build + # create and push new docker container docker build -f compose/django/Dockerfile -t iterativ/vbv-lernwelt-django . docker push iterativ/vbv-lernwelt-django diff --git a/client/index.html b/client/index.html index 11603f87..595da947 100644 --- a/client/index.html +++ b/client/index.html @@ -5,6 +5,7 @@
Dauer 8 Stunden
-30 Minuten
-Hello from Home View
+| + | {{value}} | +
| {{color}} | ++ + | +
.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: bold;
+ font-style: normal;
+}
+ +<link rel="preload" href="BuenosAires-Bold.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 300;
+ font-style: italic;
+}
+ +<link rel="preload" href="BuenosAires-LightItalic.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: normal;
+ font-style: normal;
+}
+ +<link rel="preload" href="BuenosAires-Regular.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: bold;
+ font-style: italic;
+}
+ +<link rel="preload" href="BuenosAires-BoldItalic.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 600;
+ font-style: normal;
+}
+ +<link rel="preload" href="BuenosAires-SemiBold.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 600;
+ font-style: italic;
+}
+ +<link rel="preload" href="BuenosAires-SemiBoldItalic.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 100;
+ font-style: normal;
+}
+ +<link rel="preload" href="BuenosAires-Thin.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 100;
+ font-style: italic;
+}
+ +<link rel="preload" href="BuenosAires-ThinItalic.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 300;
+ font-style: normal;
+}
+ +<link rel="preload" href="BuenosAires-Book.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 300;
+ font-style: italic;
+}
+ +<link rel="preload" href="BuenosAires-BookItalic.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 300;
+ font-style: normal;
+}
+ +<link rel="preload" href="BuenosAires-Light.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 900;
+ font-style: normal;
+}
+ +<link rel="preload" href="BuenosAires-Black.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: 900;
+ font-style: italic;
+}
+ +<link rel="preload" href="BuenosAires-BlackItalic.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+.your-style {
+ font-family: 'Buenos Aires';
+ font-weight: normal;
+ font-style: italic;
+}
+ +<link rel="preload" href="BuenosAires-RegularItalic.woff2" as="font" type="font/woff2" crossorigin>+
+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~
+
The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+