2020-11-30 12:12:56 +00:00
---
2021-04-18 16:25:03 +01:00
title: Getting started
slug: /
2020-11-30 12:12:56 +00:00
---
## Backend
2020-12-05 21:08:42 +00:00
To create a local development setup for authentik, you need the following:
2020-11-30 12:12:56 +00:00
- 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.
2020-12-05 21:08:42 +00:00
To configure authentik to use the local databases, create a file in the authentik directory called `local.env.yml` , with the following contents
2020-11-30 12:12:56 +00:00
```yaml
debug: true
postgresql:
user: postgres
log_level: debug
```
2020-12-05 21:08:42 +00:00
Afterwards, you can start authentik by running `./manage.py runserver` . Generally speaking, authentik is a Django application.
2020-11-30 12:12:56 +00:00
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.
2021-04-18 16:25:03 +01:00
Before committing code, run `make lint` to ensure your code is formatted well. This also requires `pyright` , which can be installed with npm.
Run `make gen` to run all unittests and generated an updated swagger document for any changes you made.
2020-11-30 12:12:56 +00:00
## Frontend
By default, no transpiled bundle of the frontend is included. To build the UI, you need Node 12 or newer.
2021-03-18 21:02:04 +00:00
The Frontend also uses a generated API client to talk with the backend. To generate this client, you can use the [openapitools/openapi-generator-cli ](https://github.com/OpenAPITools/openapi-generator ) CLI tool.
If you want to generate the client without installing anything, run this command:
```shell
docker run \
--rm -v $(pwd):/local \
openapitools/openapi-generator-cli generate \
2021-05-16 13:13:07 +01:00
-i /local/schema.yml \
2021-03-18 21:02:04 +00:00
-g typescript-fetch \
-o /local/web/api \
--additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
```
2020-11-30 12:12:56 +00:00
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.
2021-04-18 16:25:03 +01:00
To ensure the code is formatted well, run `npx eslint . --fix` and `npm run lit-analyse` .