Go to file
Daniel Egger c9bf1d2753 Add wbt files to git lfs 2022-10-12 17:22:03 +02:00
.git-crypt Add 1 git-crypt collaborator 2022-09-01 14:33:12 +02:00
client Add wbt files to git lfs 2022-10-12 17:22:03 +02:00
compose/django Improve DB reset for caprover deployment 2022-06-30 14:11:21 +02:00
cypress Fix cypress tests 2022-10-05 17:02:17 +02:00
docs Add local config 2022-05-16 14:42:03 +02:00
env Build new version of bitbucket pipelines docker 2022-10-11 16:46:53 +02:00
env_secrets Upgrade client libraries 2022-08-30 15:56:54 +02:00
scripts Add page cache for learningpath pages 2022-07-05 15:44:11 +02:00
server Add wbt files to git lfs 2022-10-12 17:22:03 +02:00
.dockerignore Exclude .git from docker build 2022-08-04 09:38:50 +02:00
.editorconfig Rename env variable stuff 2022-05-25 18:31:43 +02:00
.gitattributes Add wbt files to git lfs 2022-10-12 17:22:03 +02:00
.gitignore Add code formatting with prettier and black 2022-09-30 17:43:06 +02:00
.pre-commit-config.yaml Initial commit after cookiecutter 2022-02-02 09:10:21 +01:00
.tool-versions VBV-142: move "/media" to "/static/media" 2022-09-09 11:56:49 +02:00
README.md Add wbt files to git lfs 2022-10-12 17:22:03 +02:00
README_generated.md Setup working locally 2022-02-02 09:35:02 +01:00
bitbucket-pipelines.yml Add code formatting with prettier and black 2022-09-30 17:43:06 +02:00
caprover_create_app.py VBV-133: Aufbau Stage- und Prod-Umgebung auf CapRover 2022-08-24 15:40:34 +02:00
caprover_deploy.sh VBV-133: Aufbau Stage- und Prod-Umgebung auf CapRover 2022-08-24 15:40:34 +02:00
cypress.config.js Add cypress tests for learningPath view 2022-08-29 14:10:55 +02:00
docker-compose-local.yml Make docker compose work locally 2022-02-02 23:01:22 +01:00
example.env Rename env variable stuff 2022-05-25 18:31:43 +02:00
format_code.sh Refactor media content data models 2022-10-04 14:42:34 +02:00
git-crypt-encrypted-files.txt VBV-133: Aufbau Stage- und Prod-Umgebung auf CapRover 2022-08-24 15:40:34 +02:00
git-pre-commit.sh Refactor media content data models 2022-10-04 14:42:34 +02:00
git-pre-push.sh Refactor media content data models 2022-10-04 14:42:34 +02:00
package.json Add code formatting with prettier and black 2022-09-30 17:43:06 +02:00
prepare_server.sh Fix cypress tests 2022-10-11 16:52:46 +02:00
prepare_server_cypress.sh Redirect to sorted cms index page 2022-06-07 14:56:30 +02:00
trufflehog-allow.json Build new version of bitbucket pipelines docker 2022-10-11 16:46:53 +02:00
trufflehog-exclude-patterns.txt Build new version of bitbucket pipelines docker 2022-10-11 16:46:53 +02:00

README.md

VBV Lernwelt

Project setup is based on cookiecutter-django project template.

Run for development

# run vue vite dev server
cd client && npm run dev

# reset db and run django dev server
./prepare_server.sh

# run tailwind cli (for tailwind support on django templates)
cd client && npm run tailwind 

Installation

See .tool-versions file for used django and node version

You have to set up at least the following environment variables:

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

Install git-lfs

brew install git-lfs
git lfs install

Server part

Install python dependencies:

pip install -r server/requirements/requirements-dev.txt

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.

# will initial`migrate` and `runserver` etc...
./prepare_server.sh

# or async server
# uvicorn config.asgi:application --host 0.0.0.0 --reload

Client part

cd client

npm install

# run dev server
npm run dev

General part

Cypress is installed for client and server, so there is this package.json on the project root directory

# in project root directory
npm install

Git hooks

# install pre-push git hook
# add this line to the existing script in .git/hooks/pre-push
./git-pre-push.sh

Actions on Save

You can enable some useful "Actions on Save" in your JetBrains IDE:

Preferences -> Tools -> Actions on Save

  • Reformat Code
  • Optimize Imports
  • Run eslint --fix
  • Run prettier

Deployment to CapRover

CapRover Dev (vbv-lernwelt.control.iterativ.ch)

# run deploy script
./caprover_deploy.sh vbv-lernwelt

# of vbv-lernwelt is default value
./caprover_deploy.sh

CapRover Stage (myvbv-stage.iterativ.ch)

./caprover_deploy.sh myvbv-stage

CapRover Prod (myvbv.iterativ.ch)

./caprover_deploy.sh myvbv

IntelliJ Configuration

  • In the .idea/vbv_lernwelt.iml file change the module type to "PYTHON_MODULE".
  • Add django facet in "Project Structure".
  • Run configuration with "Python -> server.py" to have async debugging support.

Optional

Install the EnvFile Plugin

Install the tailwind css Plugin from Jetbrains