vbv/README.md

115 lines
2.0 KiB
Markdown

# VBV Lernwelt
Project setup is based on [cookiecutter-django](https://github.com/cookiecutter/cookiecutter-django) project template.
## Run for development
```bash
# run tailwind cli (on project root folder!)
npm run tailwind
# run vue vite dev server
cd client && npm run dev
# run django dev server
cd server && python manage.py runserver
```
## Installation
See `.tool-versions` file for used django and node version
### Server part
Run every sub command in the `server` directory
Create a new PostgreSQL database and role
```bash
createdb vbv_lernwelt
createuser vbv_lernwelt
```
Set the environment variable accordingly
```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
# or async server
# uvicorn config.asgi:application --host 0.0.0.0 --reload
```
### Client part
Run every command in the `client` directory
```bash
npm install
# run dev server
npm run dev
```
### General part
Cypress and TailwindCSS ist installed for client and server, so there is this package.json on the project root directory
```bash
npm install
```
## Deployment to CapRover
```
# run deploy script
./caprover_deploy.sh
```
## 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
![](docs/envfile_plugin_settings.png)
#### Install the tailwind css Plugin from Jetbrains
## Wagtail API intro
get all pages:
http://localhost:8000/api/v2/pages/
get Analyse Circle (the one with the most demo data)
http://localhost:8000/api/v2/pages/?title=Analyse
Get Circles only
http://localhost:8000/api/v2/pages/?type=learnpath.Circle
Get All Contents from that circle:
http://localhost:8000/api/v2/pages/?child_of=11