Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

Arcadia is a comprehensive torrent platform designed to be:

  • Easy to setup - Get running quickly with minimal configuration
  • Highly configurable - Customize the platform to your needs
  • Content agnostic - Support for movies, TV shows, music, books, software, and more
  • Well organized - Clean, intuitive interface for both users and administrators

The backend is built with Rust for speed and safety. The frontend is built with Typescript and VueJS, rendered client-side.

What Arcadia Supports

Arcadia supports a wide variety of content types including:

Movies

  • Feature Film: Full-length films with rich metadata support.
  • Short Film: Shorter cinematic works.

TV Shows

  • Series and seasons with episode tracking capabilities.

Music

  • Album: Includes "live album" as an "edition."
  • EP: Extended plays.
  • Single: Individual tracks.
  • Soundtrack: Music from movies, TV shows, or games.
  • Anthology: Collections of works by an artist or group.
  • Compilation: Curated collections of tracks.
  • Remix: Reimagined versions of original tracks.
  • Bootleg: Unofficial recordings.
  • Mixtape: Curated playlists or unofficial releases.
  • Concert Recording: Live performance recordings.
  • DJ Mix: Continuous mixes by DJs.

Software

  • Game: Video games of all genres.
  • Program: Applications and utilities.

Written Documents

  • Book: Includes hardcover, paperback, and digital formats.
  • Illustrated: Includes mangas, comics, and visual novels.
  • Periodical: Newspapers, magazines, and journals.
  • Article: Studies, theses, essays, and research papers.
  • Manual: Guides, music sheets, and instructional documents.

Collections

Collections represent a "grouping" of content to avoid multiple uploads and reduce tracker load. Examples include site dumps, full/finished series, and monthly/yearly content groupings.

Community

For contributions see CONTRIBUTING.md

Join our community:

Architecture

Overview

Arcadia is made of 2 main parts: the site's API and a tracker. The site's API is meant to be used by the frontend, while the tracker is meant to be used by torrent clients (qbittorrent, deluge, etc.).

Backend

Arcadia's backend is a REST API written in rust with the actix framework and the sqlx database driver. It also uses PostgreSQL as its database.

Code Structure

API calls are forwarded to handlers, database requests are done by repositories, objects are defined by models. Directories with those names contain the relevant code.

A swagger for the API is available at http://localhost:8080/swagger-ui/

Frontend

Arcadia's frontend is a SPA written in TypeScript and uses the Vue.js framework with PrimeVue components, Vite builds it.

API Schema Updates

If you make changes to structs that are listed in the swagger, you must regenerate the typescript interfaces with this command (from the frontend directory, while the backend is running):

npx openapi-typescript http://127.0.0.1:8080/swagger-json/openapi.json -o ./src/api-schema/schema.d.ts

Running Arcadia

There are two main ways to run Arcadia:

Setup Methods

Standard Setup

Install dependencies directly on your system. See Standard Setup for detailed instructions.

Docker Setup

Use containerized deployment with Docker Compose. See Docker Setup for detailed instructions.

Standard Setup

This is the 'regular' way to run Arcadia by installing dependencies directly on your system.

Database Setup

Spawn an instance of postgresql and run the migrations (/backend/migrations/*.sql). For more information, refer to the database part of the docker section.

Backend Setup

Create a .env file from the template and update the values if needed:

cp .env.example .env

This command will download the dependencies, build them and build arcadia, as well as run it:

cargo run

If you encounter some errors, it is probably because some OS dependencies are missing. Install them and run the command again.

Frontend Setup

Create a .env file from the template and update the values if needed:

cp .env.example .env

Install the dependencies:

npm install

Run the frontend:

npm run dev

Docker Setup

If running docker compose doesn't work, you may have an older version of the docker cli installed and may need to use docker-compose instead.

docker-compose up db -d

Also don't forget to use sudo if you aren't in the docker group!

Database

The recommended method for spawning an instance of PostgreSQL is using Docker Compose:

docker compose up db -d

Arcadia will automatically run migrations on launch. Otherwise, initialization of the database can be done with:

cargo sqlx database setup
# If cargo doesn't know the command, install it with this command
cargo install sqlx-cli

Adding Test Data

You can optionally add "fake" data to the database by running the fixtures.sql file in the migrations/fixtures directory. This allows to quickly have data to work with.

Here is how to insert them if you are using docker:

docker exec -i arcadia_db psql -U arcadia -d arcadia < backend/migrations/fixtures/fixtures.sql

The default user defined in the test data is picolo with password test.

Exporting Test Data

If you wish to create your own additional test data, you can then dump it to a file with this command (if you want to share it in the repo):

docker exec -i arcadia_db pg_dump -U arcadia -d arcadia --data-only --inserts > backend/migrations/fixtures/fixtures.sql

Backend

Launch the server:

docker compose up backend -d

It may take a while for the image to build as everything is done in Docker. Yes, Docker Compose can handle that!

Auto-rebuild with Compose Watch

What Docker Compose can also handle is auto rebuilding images when source code changes as made possible by Compose Watch.

To take advantage of that, just run this command instead:

docker compose up backend --watch

Or when running attached (as in not just turning it on and leaving it with the --detach / -d option), just press W.

Now when you make changes to the backend, compose will automatically rebuild the image and restart the container with the new source code, making somewhat quicker to iterate while also testing in Docker.

Frontend

Launch the server:

docker compose up frontend -d

Developer Setup

Development Containers (Optional)

If you don't want to install another toolchain on your system, You can also use devcontainers instead. If you don't know, think of isolated minimal virtual machines that come with the tools required to build Arcadia (or anything else really).

If you have Docker (recommended!) installed and use Visual Studio Code, all you need is to have the Dev Containers extension installed and "reopening your folder in a container". You can find that option in your Command Palette, or by clicking on the new status bar item in the left bottom corner.

You can also use GitHub Codespaces to build Arcadia in the cloud without having to download anything but streams of text, although it's not as free as a local dev container.

Open in GitHub Codespaces

It isn't required to use them but can be useful in some cases (especially if you're using an immutable OS).

Required Tools

You need these to make meaningful contributions to Arcadia, outside the cases of documentation for example.

  • Prettier for proper formatting of the frontend's code.
  • sqlx-cli for managing database related stuff, including migrations.
  • Docker for setting up dependencies. Optional but HIGHLY recommended!
  • Insomnia for testing the backend's API. You could also use any other client if you want.

Environment Setup

Backend

At runtime, Arcadia's backend will source environment variables to influence it's behavior. The simplest way to set these during development is to write them into a file named .env. A documented sample file is made available, so a quick way to get started is to use it by running cp .env.example .env.

Frontend

At build time, the frontend will be hardcoded with the site's API location sourced from an enviroment variable. A documented sample file is made available, so a quick way to get started is to use it by running cp .env.example .env.

Testing

Backend Testing

Adding additional tests to Arcadia is strongly encouraged, especially when adding new features! For unit tests, they can be added in the module being tested using standard rust idioms.

End-to-end tests can also be authored, they should be located in tests/ and use the sqlx test fixture machinery to populate the database for testing. See tests/test_auth.rs for examples.

Frontend Testing

We don't have any tests for the frontend. We'll add them once it's more "production ready".

Contributing

First, thanks for considering contributing to Arcadia!

Contributing Process

Whether you want to add a new feature or fix an existing issue, it needs to be done on your own branch:

  1. Fork this repository
  2. Clone it locally on your computer
  3. create a new branch feature-name or bug-name-fix (with the proper name)
  4. open a pull request when your contribution is done

If you are unsure about what/how to do something, don't hesitate to open a discussion or an issue about the topic.

You can also hop on the Discord server to chat with other devs and the community.

Finding Contributions to Make

Arcadia has boards to track the existing issues and features that need to be worked on. Feel free to claim one that isn't claimed yet before starting to work on it.

To claim a github issue, simply leave a comment on it saying that you are working on it.

You can also search for TODOs in the code and pick one of those tasks. If you decide to do this, please open an issue first and claim it before working on the task.

Backend Development Notes

  • If you make changes to/add sql queries with sqlx, you need to run cargo sqlx prepare before committing your changes. This command will generate some files that allow the queries to be tested without a database running. Our CI pipeline relies on that, and will fail if the command hasn't been ran. You can setup a git pre-commit hook if you want.

  • For better code quality, we use clippy in our CI pipeline. You can set your editor to run cargo clippy instead of cargo check (on file save, etc.).

Legal Notice

This tool (Arcadia) is intended for legal use only. Users (both the ones hosting Arcadia and the ones using it) are solely responsible for the content they download and share through it. Downloading or distributing copyrighted material without proper authorization is illegal in most jurisdictions. By hosting and/or using Arcadia, you agree to abide by all applicable laws and respect intellectual property rights. The developers of Arcadia assume no responsibility for any illegal activities conducted by its hosters and users.