Skip to content

Priveetee/TypeType-Server

Repository files navigation

TypeType-Server

The extraction and user data backend for TypeType.

A Kotlin/Ktor server with two responsibilities:

  • Wrap PipePipeExtractor to expose YouTube, NicoNico, and BiliBili extraction as a REST/JSON API
  • Persist user data (history, favorites, subscriptions, playlists, watch-later, progress, settings, search history, blocked content) in PostgreSQL

See Architecture.md for current architecture and API surface overview.

Stack

Role Tool
Language Kotlin
Server Ktor (Netty engine)
Extraction PipePipeExtractor (Java, GPL v3)
Build Gradle (Kotlin DSL)
User data PostgreSQL via Exposed + HikariCP
Cache Dragonfly (Redis-compatible)

Development

Prerequisites

  • JDK 17+
  • Docker and Docker Compose (for PostgreSQL and Dragonfly)

Start dependencies

cp .env.example .env
docker compose up -d postgres dragonfly

Start full dev mirror stack (frontend + server + downloader)

docker compose -f docker-compose.dev-mirror.yml up -d
./scripts/bootstrap-garage.sh

Stack endpoints:

  • Frontend: http://localhost:28082
  • API server: http://localhost:28080
  • Downloader: http://localhost:28093
  • Token service: http://localhost:28081

Pull latest beta images before restart:

./scripts/pull-dev-images.sh
docker compose -f docker-compose.dev-mirror.yml up -d --force-recreate

Build

./gradlew shadowJar

Run

java -jar build/libs/typetype-server-all.jar

The server starts on port 8080. Logs go to stdout.

Docker image tags (GHCR)

Container tags are published to GHCR with:

  • stable image ${{ github.repository }} on main and Git tags v*
  • beta image ${{ github.repository }}-beta on dev
  • sha-<short-sha> on every build
  • branch tags (main on stable image, dev on beta image)
  • latest on default branch (stable image) and on dev (beta image)
  • beta on dev (beta image)
  • release tags when pushing Git tags like v1.2.3 (1.2.3 and 1.2) on stable image

Configuration

All configuration is via environment variables. Defaults in .env.example work for local development.

Variable Default Description
ALLOWED_ORIGINS Comma-separated CORS origins. Required — server refuses to start without it.
DATABASE_URL jdbc:postgresql://localhost:5432/typetype PostgreSQL JDBC URL
DATABASE_USER typetype PostgreSQL user
DATABASE_PASSWORD typetype PostgreSQL password
DRAGONFLY_URL redis://localhost:6379 Dragonfly/Redis URL
DOWNLOADER_SERVICE_URL http://typetype-downloader:18093 Downloader backend base URL used by /downloader/* gateway

Acknowledgments

A huge thanks to the projects that made this possible. TypeType-Server is a wrapper, and none of it would exist without the work these teams put in first.

License

GPL v3 — required by PipePipeExtractor. The TypeType frontend is a separate program communicating over HTTP and is not subject to this license.

About

Kotlin/Ktor extraction server wrapping PipePipeExtractor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages