Skip to content

Commit

Permalink
add flowchart
Browse files Browse the repository at this point in the history
  • Loading branch information
mmgoodnow committed Oct 14, 2023
1 parent 5cc61ff commit d89d19e
Show file tree
Hide file tree
Showing 4 changed files with 2,259 additions and 1,437 deletions.
57 changes: 51 additions & 6 deletions docs/reference/architecture.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,55 @@
# Architecture

```mermaid
flowchart
subgraph Matching
assessCandidate -->
performAction -->
sendResultsNotification
end
subgraph performAction
linking["linking (if data-backed)"] --> inject
linking --> save
end
subgraph checkNewCandidateMatch
getTorrentByFuzzyName
end
subgraph findOnOtherSites["findOnOtherSites (single search)"]
searchTorznab
end
subgraph findSearchableTorrents
searcheeGeneration["make searchees from \n- torrentDir\n- dataDirs"] -->
filterDupes -->
filterByContent -->
filterTimestamps
end
findSearchableTorrents --> findMatchesBatch
findMatchesBatch --> findOnOtherSites
announce["/api/announce"] --> checkNewCandidateMatch --> Matching
rss["rssCadence"] --> checkNewCandidateMatch
webhook["/api/webhook"] -->
indexNewTorrents -->
createSearchee["create searchee"] -->
searchForLocalTorrentByCriteria --> findOnOtherSites
findOnOtherSites --> Matching
searchCadence --> findSearchableTorrents
crossSeedSearch["cross-seed search"] --> findSearchableTorrents
checkNewCandidateMatch --> getTorrentByFuzzyName
```

## Pipelines

### Search pipeline

#### Entry points

- `cross-seed daemon --searchCadence <cadence>`
- `cross-seed search`
- `POST /api/search`
- `cross-seed daemon --searchCadence <cadence>`
- `cross-seed search`
- `POST /api/search`

The search pipeline takes an owned torrent, parses its name, then searches for
its parsed name on all of your Torznab indexers. After that, it's given a list
Expand All @@ -20,8 +61,8 @@ resulting matches will then run through the configured [**action**](#actions).

#### Entry points

- `cross-seed daemon --rssCadence <cadence>`
- `POST /api/announce`
- `cross-seed daemon --rssCadence <cadence>`
- `POST /api/announce`

The RSS pipeline takes a candidate torrent's metadata `{ name, size }` and
searches through your local torrent collection to see if any existing torrents
Expand All @@ -39,4 +80,8 @@ TODO

## Actions

TODO
There are three things that can happen during the `action` phase:

- link data files (if data-based)
- inject matched torrent file
- save matched torrent file
213 changes: 108 additions & 105 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,115 +6,118 @@ const darkCodeTheme = require("prism-react-renderer/themes/dracula");

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "cross-seed",
tagline: "Fully-automatic cross-seeding",
url: "https://cross-seed.org",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
title: "cross-seed",
tagline: "Fully-automatic cross-seeding",
url: "https://cross-seed.org",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "cross-seed", // Usually your GitHub org/user name.
projectName: "cross-seed.org", // Usually your repo name.
deploymentBranch: "dist",
trailingSlash: false,
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "cross-seed", // Usually your GitHub org/user name.
projectName: "cross-seed.org", // Usually your repo name.
deploymentBranch: "dist",
trailingSlash: false,

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},

presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
"https://github.com/cross-seed/cross-seed.org/edit/master/",
},
// blog: {
// showReadingTime: true,
// // Please change this to your repo.
// // Remove this to remove the "edit this page" links.
// editUrl:
// "https://github.com/cross-seed/cross-seed.org/edit/master/",
// },
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/cross-seed/cross-seed.org/edit/master/",
},
// blog: {
// showReadingTime: true,
// // Please change this to your repo.
// // Remove this to remove the "edit this page" links.
// editUrl:
// "https://github.com/cross-seed/cross-seed.org/edit/master/",
// },
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: "cross-seed",
// logo: {
// alt: "cross-seed logo",
// src: "img/logo.svg",
// },
items: [
{
type: "doc",
docId: "basics/getting-started",
position: "left",
label: "Tutorial",
},
{
href: "https://github.com/cross-seed/cross-seed",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Tutorial",
to: "/docs/basics/getting-started",
},
],
},
{
title: "Community",
items: [
{
label: "Discord",
href: "https://discord.gg/jpbUFzS5Wb",
},
],
},
{
title: "More",
items: [
{
label: "GitHub",
href: "https://github.com/cross-seed/cross-seed",
},
],
},
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: "cross-seed",
// logo: {
// alt: "cross-seed logo",
// src: "img/logo.svg",
// },
items: [
{
type: "doc",
docId: "basics/getting-started",
position: "left",
label: "Tutorial",
},
{
href: "https://github.com/cross-seed/cross-seed",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Tutorial",
to: "/docs/basics/getting-started",
},
],
},
{
title: "Community",
items: [
{
label: "Discord",
href: "https://discord.gg/jpbUFzS5Wb",
},
],
},
{
title: "More",
items: [
{
label: "GitHub",
href: "https://github.com/cross-seed/cross-seed",
},
],
},
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
markdown: {
mermaid: true,
},
themes: ["@docusaurus/theme-mermaid"],
};

module.exports = config;
Loading

0 comments on commit d89d19e

Please sign in to comment.