docs: move dev setup to docs site, fix docs header

This commit is contained in:
Jens Langhammer 2020-11-30 13:12:56 +01:00
parent 2a0b4c8f14
commit 43c391aa1c
4 changed files with 49 additions and 24 deletions

View File

@ -24,30 +24,7 @@ For bigger setups, there is a Helm Chart in the `helm/` directory. This is docum
## Development ## Development
To develop on passbook, you need a system with Python 3.8+ (3.9 is recommended). passbook uses [pipenv](https://pipenv.pypa.io/en/latest/) for managing dependencies. See [Development Documentation](https://passbook.beryju.org/docs/development/local-dev-environment)
To get started, run
```
python3 -m pip install pipenv
git clone https://github.com/BeryJu/passbook.git
cd passbook
pipenv shell
pipenv sync -d
```
Since passbook uses PostgreSQL-specific fields, you also need a local PostgreSQL instance to develop. passbook also uses redis for caching and message queueing.
For these databases you can use [Postgres.app](https://postgresapp.com/) and [Redis.app](https://jpadilla.github.io/redisapp/) on macOS or use it the docker-compose file in `scripts/docker-compose.yml`.
To tell passbook about these databases, create a file in the project root called `local.env.yml` with the following contents:
```yaml
debug: true
postgresql:
user: postgres
log_level: debug
```
## Security ## Security

View File

@ -0,0 +1,42 @@
---
title: Setting up a local dev environment
---
## Backend
To create a local development setup for passbook, you need the following:
- Python 3.9
- pipenv, which is used to manage dependencies, and can be installed with `pip install pipenv`
- PostgreSQL (any recent version will do)
- Redis (any recent version will do)
For PostgreSQL and Redis, you can use the docker-compose file in `scripts/`. You can also use a native install, if you prefer.
To configure passbook to use the local databases, create a file in the passbook directory called `local.env.yml`, with the following contents
```yaml
debug: true
postgresql:
user: postgres
log_level: debug
```
Afterwards, you can start passbook by running `./manage.py runserver`. Generally speaking, passbook is a Django application.
Most functions and classes have type-hints and docstrings, so it is recommended to install a Python Type-checking Extension in your IDE to navigate around the code.
## Frontend
By default, no transpiled bundle of the frontend is included. To build the UI, you need Node 12 or newer.
To build the UI, run these commands:
```
cd web/
npm i
npm run build
```
If you want to make changes to the UI, run `npm run watch` instead.

View File

@ -133,5 +133,10 @@ module.exports = {
label: "Troubleshooting", label: "Troubleshooting",
items: ["troubleshooting/access"], items: ["troubleshooting/access"],
}, },
{
type: "category",
label: "Development",
items: ["development/local-dev-environment"],
},
], ],
}; };

View File

@ -15,6 +15,7 @@
--ifm-color-primary-light: #4e89e8; --ifm-color-primary-light: #4e89e8;
--ifm-color-primary-lighter: #5a91ea; --ifm-color-primary-lighter: #5a91ea;
--ifm-color-primary-lightest: #80aaef; --ifm-color-primary-lightest: #80aaef;
--ifm-navbar-link-hover-color: var(--ifm-navbar-link-color);
} }
.button.button--outline { .button.button--outline {