docs: move dev setup to docs site, fix docs header
This commit is contained in:
parent
2a0b4c8f14
commit
43c391aa1c
25
README.md
25
README.md
|
@ -24,30 +24,7 @@ For bigger setups, there is a Helm Chart in the `helm/` directory. This is docum
|
|||
|
||||
## 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.
|
||||
|
||||
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
|
||||
```
|
||||
See [Development Documentation](https://passbook.beryju.org/docs/development/local-dev-environment)
|
||||
|
||||
## Security
|
||||
|
||||
|
|
42
website/docs/development/local-dev-environment.md
Normal file
42
website/docs/development/local-dev-environment.md
Normal 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.
|
|
@ -133,5 +133,10 @@ module.exports = {
|
|||
label: "Troubleshooting",
|
||||
items: ["troubleshooting/access"],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Development",
|
||||
items: ["development/local-dev-environment"],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
--ifm-color-primary-light: #4e89e8;
|
||||
--ifm-color-primary-lighter: #5a91ea;
|
||||
--ifm-color-primary-lightest: #80aaef;
|
||||
--ifm-navbar-link-hover-color: var(--ifm-navbar-link-color);
|
||||
}
|
||||
|
||||
.button.button--outline {
|
||||
|
|
Reference in a new issue