···11# Parakeet
2233-Parakeet is a [Bluesky](https://bsky.app) [AppView](https://atproto.wiki/en/wiki/reference/core-architecture/appview)
33+Parakeet is a [Bluesky](https://bsky.app) [AppServer](https://atproto.wiki/en/wiki/reference/core-architecture/appview)
44aiming to implement most of the functionality required to support the Bluesky client. Notably not implemented is a CDN.
5566## Status and Roadmap
77-Most common functionality works, with notable omissions being like/repost/follow statuses, blocks and mutes don't get
88-applied, labels might not track CIDs properly, label redaction doesn't work at all (beware!).
99-1010-Future work is tracked in issues, but the highlights are below. Help would be highly appreciated.
77+Most common functionality works. Future work is tracked in issues and on the [Skyboard](https://skyboard.dev/board/did:plc:rjo3yss3misbrdmpuc2eza6s/3meink5vuu22k), but the highlights are below. Help would be highly appreciated.
118- Notifications
129- Search
1313-- Pinned Posts
1414-- Monitoring: metrics, tracing, and health checks.
1010+- Control Panel
15111612## The Code
1713Parakeet is implemented in Rust, using Postgres as a database, Redis for caching and queue processing, RocksDB for
1814aggregation, and Diesel for migrations and querying.
19152020-This repo is one big Rust workspace, containing nearly everything required to run and support the AppView.
1616+This repo is one big Rust workspace, containing nearly everything required to run and support the AppServer.
21172218### Packages
2319- consumer: Relay indexer, Label consumer, Backfiller. Takes raw records in from repos and stores them.
2420- dataloader-rs: a vendored fork of https://github.com/cksac/dataloader-rs, with some tweaks to fit caching requirements.
2525-- did-resolver: A did:plc and did:web resolver using hickory and reqwest. Supports custom PLC directories.
2621- lexica: Rust types for the relevant lexicons[sic] for Bluesky.
2727-- parakeet: The core AppView server code. Using Axum and Diesel.
2222+- parakeet: The core AppServer code. Using Axum and Diesel.
2823- parakeet-db: Database types and models, also the Diesel schema.
2924- parakeet-index: Stats aggregator based on RocksDB. Uses gRPC with tonic.
3030-- parakeet-lexgen: A WIP code generator for Lexicon in Rust. Not in use.
31253226There is also a dependency on a fork of [jsonwebtoken](https://gitlab.com/parakeet-social/jsonwebtoken) until upstream
3327supports ES256K.
34283529## Running
3030+The "most supported" way is currently Nix - see below for more info. The Docker images may not build currently!.
3131+3632Prebuilt docker images are published (semi) automatically by GitLab CI at https://gitlab.com/parakeet-social/parakeet.
3733Use `registry.gitlab.com/parakeet-social/parakeet/[package]:[branch]` in your docker-compose.yml. There is currently no
3834versioning until the project is more stable (sorry).
3935You can also just build with cargo.
40364137To run, you'll need Postgres (version 16 or higher), Redis or a Redis-like, consumer, parakeet, and parakeet-index.
3838+3939+### Nix
4040+A Nix Flake is provided, so you can add `git+https://tangled.org/parakeet.at/parakeet` to your flake.nix inputs.
4141+4242+Packages `parakeet-appview` (crates/parakeet), `parakeet-consumer` (crates/consumer), and `parakeet-index` (crates/parakeet-index) are provided, and also systemd services for NixOS. You can see an example in [Mia's dotfiles](https://tangled.org/mia.pds.parakeet.at/config/blob/main/hosts/keldeo/services/parakeet.nix).
4343+4444+The flake is configured to set up a basic environment using `nix develop` (currently only cargo and friends, not postgres).
42454346### Configuring
4447There are quite a lot of environment variables, although sensible defaults are provided when possible. Variables are
···6568| PKC_BACKFILL__DOWNLOAD_WORKERS | 25 | How many workers to use to download repos for backfilling. |
6669| PKC_BACKFILL__DOWNLOAD_BUFFER | 25000 | How many repos to download and queue. |
6770| PKC_BACKFILL__DOWNLOAD_TMP_DIR | n/a | Where to download repos to. Ensure there is enough space. |
7171+| PKC_METRICS_PORT | 9000 | Port to bind to for Prometheus metrics in Consumer |
6872| (PK/PKI)_SERVER__BIND_ADDRESS | `0.0.0.0` | Address for the server to bind to. For index outside of docker, you probably want loopback as there is no auth. |
6973| (PK/PKI)_SERVER__PORT | PK: 6000, PKI: 6001 | Port for the server to bind to. |
7074| (PK/PKI)_DATABASE_URL | n/a | Required. URI of Postgres in format `postgres://[user]:[pass]@[host]:[port]/[db]` |
7171-| PK_SERVICE__DID | n/a | DID for the AppView in did:web. (did:plc is possible but untested) |
7272-| PK_SERVICE__PUBLIC_KEY | n/a | Public key for the AppView. Unsure if actually used, but may be required by PDS. |
7373-| PK_SERVICE__ENDPOINT | n/a | HTTPS publicly accessible endpoint for the AppView. |
7575+| PK_SERVICE__DID | n/a | DID for the AppServer in did:web. (did:plc is possible but untested) |
7676+| PK_SERVICE__PUBLIC_KEY | n/a | Public key for the AppServer. Unsure if actually used, but may be required by PDS. |
7777+| PK_SERVICE__ENDPOINT | n/a | HTTPS publicly accessible endpoint for the AppServer. |
7478| PK_TRUSTED_VERIFIERS | n/a | Optionally, trusted verifiers to use. For many, join with `,`. |
7579| PK_CDN__BASE | `https://cdn.bsky.app` | Optionally, base URL for a Bluesky compatible CDN |
7680| PK_CDN__VIDEO_BASE | `https://video.bsky.app` | Optionally, base URL for a Bluesky compatible video CDN |
7777-| PK_DID_ALLOWLIST | n/a | Optional. If set, controls which DIDs can access the AppView. For many, join with `,` |
8181+| PK_DID_ALLOWLIST | n/a | Optional. If set, controls which DIDs can access the AppServer. For many, join with `,` |
7882| PK_MIGRATE | false | Set to TRUE to run database migrations automatically on start. |
7983| PKI_INDEX_DB_PATH | n/a | Required. Location to store the index database. |
8084