Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): Use starlight and migrate initial documentation #3

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/wiki.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions new/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
4 changes: 4 additions & 0 deletions new/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions new/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
55 changes: 55 additions & 0 deletions new/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Starlight Starter Kit: Basics

[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

```
npm create astro@latest -- --template starlight
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## 🚀 Project Structure

Inside of your Astro + Starlight project, you'll see the following folders and files:

```
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.

Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Static assets, like favicons, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
43 changes: 43 additions & 0 deletions new/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @ts-check
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';

// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: 'Revolt Wiki',
social: {
github: 'https://github.com/withastro/starlight',
},
locales: {
root: {
label: 'English',
lang: 'en',
},
ru: {
label: 'Русский',
lang: 'ru-RU'
}
},
sidebar: [
{
label: 'Guides',
autogenerate: { directory: 'guides' },
},
{
label: 'Reference',
autogenerate: { directory: 'reference' },
},
{
label: 'Resources',
autogenerate: { directory: 'resources' },
},
{
label: 'API Reference',
link: 'https://developers.revolt.chat/developers/api/reference.html'
}
],
}),
],
});
19 changes: 19 additions & 0 deletions new/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "new",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/starlight": "^0.28.3",
"astro": "^4.16.1",
"sharp": "^0.33.5",
"typescript": "^5.6.3"
}
}
4,865 changes: 4,865 additions & 0 deletions new/pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions new/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
471 changes: 471 additions & 0 deletions new/src/assets/api/Permission Hierarchy.drawio

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions new/src/assets/api/Permission Hierarchy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added new/src/assets/api/updates/timeout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions new/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineCollection } from 'astro:content';
import { docsSchema } from '@astrojs/starlight/schema';

export const collections = {
docs: defineCollection({ schema: docsSchema() }),
};
35 changes: 29 additions & 6 deletions src/contrib.md → new/src/content/docs/guides/contrib.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Contribution Guide
---
title: Contribution Guide
---

This is the contribution guide for developers wanting to help out with Revolt.

# Repository Lifecycle
## Repository Lifecycle

## Making Commits
### Making Commits

- Sign-off your commits ([Git flag](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff)), [read here about DCO obligations](https://developercertificate.org/).
- Sign commits where possible, [learn more about that here](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).
@@ -14,7 +16,7 @@ This is the contribution guide for developers wanting to help out with Revolt.
- Try to keep each PR bound to a single feature or change, multiple bug fixes may be fine in some cases.
This is to avoid your PR getting stuck due to parts of it having conflicts or other issues.

## Merging Pull Requests
### Merging Pull Requests

To keep commit history nice and tidy, always use [Conventional Commit style](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) for any merge commit messages. And where possible:

@@ -25,7 +27,7 @@ Beyond this point you should usually check with a maintainer on how to merge, an
2. Prefer to `Rebase and Merge` where possible.
3. Create a merge request with commit message similar to `merge: remote-tracking branch abc into xyz (#1)`.

# What can I help with?
## What can I help with?

The main project board can serve as a helpful starting point:

@@ -36,10 +38,31 @@ The main project board can serve as a helpful starting point:

Any issues marked with "Future Work" or with a milestone greater than the current milestone are out of bounds and should not be worked on since it's likely that the team already has a plan in place, any work you may do may conflict with prior ideas, and your work may potentially be rejected if it does fit the criteria exactly. In general, these issues are just postponed to reduce long term technical debt, i.e. allow current issues to be handled.

# Project Guidance
## Project Guidance

Please read the additional relevant guidance on:

- [Developing for Backend](https://github.com/revoltchat/backend?tab=readme-ov-file#development-guide) (contrib guide TBA)
- [Developing for Frontend](https://github.com/revoltchat/frontend?tab=readme-ov-file#development-guide) (contrib guide TBA)
- [Contributing to Android](https://revoltchat.github.io/android/contributing/guidelines/)

## Other ways to help

You can contribute to Revolt in a variety of ways:

### 1. Feedback

The easiest, but most important, way to contribute to Revolt is to voice your opinion and give us feedback.
We want to hear what you think and appreciate and await your feature suggestions, bug reports and general opinions on everything Revolt has to offer.

Within the Revolt app, you can navigate to the [**feedback tab**](https://app.revolt.chat/settings/feedback), or you can open an issue on the relevant [GitHub repo](https://github.com/revoltchat).

### 2. Translate

Revolt is used by users all around the world; as such, it's more accessible if the user interface is available in a variety of languages.
You can contribute translations through [**Weblate**](https://weblate.insrt.uk/engage/revolt/).

### 3. Donate

Revolt is not backed by a big company, is not currently monetised (for example, via a subscription service) and does not serve you advertisements; as such, Revolt currently relies entirely on donations.
You can learn more about donating [here](https://insrt.uk/donate) - if you want to make a larger donation, please consult me first.
9 changes: 9 additions & 0 deletions new/src/content/docs/guides/exampleFetch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const body = new FormData();
body.append("file", file);

const data = await fetch(`${endpoint}/${tag}`, {
method: "POST",
body,
}).then((res) => res.json());

// use data.id
247 changes: 247 additions & 0 deletions new/src/content/docs/guides/rest.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
---
title: Rest API
---
import { Code } from '@astrojs/starlight/components';
import importedCode from './exampleFetch.ts?raw';

## Authentication

To authenticate with the API, you must first acquire a bot token or user token:

- **Bot:** create one from user settings in the client
- **User:** copy one from client or [authenticate manually](/developers/api/reference.html#tag/session/post/auth/session/login) through API

Then you may provide these through either:

| Type | Header |
| :--: | :---------------: |
| Bot | `X-Bot-Token` |
| User | `X-Session-Token` |

When dealing with an authenticated route.

## Rate Limits

Revolt uses a fixed-window ratelimiting algorithm:

- You are given a set amount of calls per each named bucket.
- Any calls past this limit will result in 429 errors.
- Buckets are replenished after 10 seconds from initial request.

### Buckets

There are distinct buckets that you may be calling against, none of these affect each other and can be used up independently of one another.

| Method | Path | Limit |
| -------: | --------------------------- | :---: |
| | `/users` | 20 |
| `PATCH` | `/users/:id` | 2 |
| | `/users/:id/default_avatar` | 255 |
| | `/bots` | 10 |
| | `/channels` | 15 |
| `POST` | `/channels/:id/messages` | 10 |
| | `/servers` | 5 |
| | `/auth` | 3 |
| `DELETE` | `/auth` | 255 |
| | `/safety` | 15 |
| | `/safety/report` | 3 |
| | `/swagger` | 100 |
| | `/*` | 20 |

### Headers

There are multiple headers you can use to figure out when you can and cannot send requests, and to determine when you can next send a request.

| Header | Type | Description |
| ------------------------- | :------: | ------------------------------------------------ |
| `X-RateLimit-Limit` | `number` | Maximum number of calls allowed for this bucket. |
| `X-RateLimit-Bucket` | `string` | Unique identifier for this bucket. |
| `X-RateLimit-Remaining` | `number` | Remaining number of calls left for this bucket. |
| `X-RateLimit-Reset-After` | `number` | Milliseconds left until calls are replenished. |

### Rate Limited Response

When you receive `429 Too Many Requests`, you will also receive a JSON body with the schema:

```typescript
interface Response {
// Milliseconds until calls are replenished
retry_after: number;
}
```

## Permissions

Revolt's permission system works by sequentially applying allows then denies.

[//]: # (TODO: Add flowchart via mermaid)

If you are looking to implement permissions in a library, I highly recommend reading either `revolt.js` or `delta` source code since all the routines are well commented and should be relatively easy to understand.

### Values

The following permissions are currently allocated:

<details>
<summary>Permissions</summary>

| Name | Value | Bitwise | Description |
| --------------------- | :-----------: | :-------: | ------------------------------------------------------- |
| `ManageChannel` | `1` | `1 << 0` | Manage the channel or channels on the server |
| `ManageServer` | `2` | `1 << 1` | Manage the server |
| `ManagePermissions` | `4` | `1 << 2` | Manage permissions on servers or channels |
| `ManageRole` | `8` | `1 << 3` | Manage roles on server |
| `ManageCustomisation` | `16` | `1 << 4` | Manage emoji on servers |
| `KickMembers` | `64` | `1 << 6` | Kick other members below their ranking |
| `BanMembers` | `128` | `1 << 7` | Ban other members below their ranking |
| `TimeoutMembers` | `256` | `1 << 8` | Timeout other members below their ranking |
| `AssignRoles` | `512` | `1 << 9` | Assign roles to members below their ranking |
| `ChangeNickname` | `1024` | `1 << 10` | Change own nickname |
| `ManageNicknames` | `2048` | `1 << 11` | Change or remove other's nicknames below their ranking |
| `ChangeAvatar` | `4096` | `1 << 12` | Change own avatar |
| `RemoveAvatars` | `8192` | `1 << 13` | Remove other's avatars below their ranking |
| `ViewChannel` | `1048576` | `1 << 20` | View a channel |
| `ReadMessageHistory` | `2097152` | `1 << 21` | Read a channel's past message history |
| `SendMessage` | `4194304` | `1 << 22` | Send a message in a channel |
| `ManageMessages` | `8388608` | `1 << 23` | Delete messages in a channel |
| `ManageWebhooks` | `16777216` | `1 << 24` | Manage webhook entries on a channel |
| `InviteOthers` | `33554432` | `1 << 25` | Create invites to this channel |
| `SendEmbeds` | `67108864` | `1 << 26` | Send embedded content in this channel |
| `UploadFiles` | `134217728` | `1 << 27` | Send attachments and media in this channel |
| `Masquerade` | `268435456` | `1 << 28` | Masquerade messages using custom nickname and avatar |
| `React` | `536870912` | `1 << 29` | React to messages with emojis |
| `Connect` | `1073741824` | `1 << 30` | Connect to a voice channel |
| `Speak` | `2147483648` | `1 << 31` | Speak in a voice call |
| `Video` | `4294967296` | `1 << 32` | Share video in a voice call |
| `MuteMembers` | `8589934592` | `1 << 33` | Mute other members with lower ranking in a voice call |
| `DeafenMembers` | `17179869184` | `1 << 34` | Deafen other members with lower ranking in a voice call |
| `MoveMembers` | `34359738368` | `1 << 35` | Move members between voice channels |
</details>

## Uploading Files

File uploads work by first sending a file to the server and then using the ID provided.

You can find out what kinds of files you can upload by visiting [autumn.revolt.chat](https://autumn.revolt.chat).
This may depend on your instance, so you should determine the endpoint from the root API response.

To upload a file, pick the desired tag then send a **POST** to `{endpoint}/{tag}` along with a `multipart/form-data` body with one field `file` that contains the file you wish to upload.

You will receive the following JSON response:

```json
{
"id": "0"
}
```

You can use the ID wherever a file is required in the API.

Code sample in JavaScript using Fetch API:

<Code code={importedCode} lang="ts" title="example.ts" />

### Serving images

For caching purposes, use the following URL templates for file previews:

| Tag | URL |
| ----------- | ------------------------------------ |
| icons | `{endpoint}/icons/{id}?max_side=256` |
| banners | - |
| emojis | - |
| backgrounds | `{endpoint}/backgrounds/{id}?width=1000` |
| avatars | `{endpoint}/icons/{id}?max_side=256` |
| attachments | `{endpoint}/attachments/{id}?max_side=512` |

Parameters may be forced in the future. Missing URLs _to be added_.

## Changelog

You can find the API changelog on the [releases page on GitHub](https://github.com/revoltchat/backend/releases)!

## Legacy Changelog

### Gap in data

This is missing stuff between the one above and the one below.

### 20230120-1: New Account Events

This update adds two new events:

- `UserPlatformWipe { user_id: String; flags: Int; }`
- `Auth { event_type: 'DeleteSession' | 'DeleteAllSessions'; [..] }` (see [Auth](/stack/bonfire/events#auth))

It also adds a new user flag of value `8` which represents a user who has been flagged and removed as spam.

It also adds one REST routes:

- `GET /users/<user_id>/flags`: Fetch user flags

If your account is disabled, login will no longer throw an error, instead it will return `Disabled { user_id: String }` with status code 200.

You must now also specify a list of reactions when enabling restrict reactions.

### 20220903-1: Changes to role colours, masquerades, members and user timeouts

Role colours now support most valid CSS gradients and colours up to 128 characters and which satisfy the following Regex:

```regex
(?i)^(?:[a-z ]+|var\(--[a-z\d-]+\)|rgba?\([\d, ]+\)|#[a-f0-9]+|(repeating-)?(linear|conic|radial)-gradient\(([a-z ]+|var\(--[a-z\d-]+\)|rgba?\([\d, ]+\)|#[a-f0-9]+|\d+deg)([ ]+(\d{1,3}%|0))?(,[ ]*([a-z ]+|var\(--[a-z\d-]+\)|rgba?\([\d, ]+\)|#[a-f0-9]+)([ ]+(\d{1,3}%|0))?)+\))$
```

You can now also masquerade role colours per-message, simply include the `colour` property matching the properties above.

All members now include a `joined_at` property which indicate when the timestamp at which they joined a certain server.

All members now also have a `timeout` property which can be changed by `PATCH /servers/<server_id>/members/<user_id>`, users will not be able to interact with the server until the time expires. A visual indicator will also display on the user's end as well as for others in chat:

![Timeout UI](../../../assets/api/updates/timeout.png)

### 20220901-1: Reactions Update

This update adds support for message reactions, including the following REST routes:

- `PUT /channels/<id>/messages/<id>/reactions/<emoji>`: Add reaction to message
- `DELETE /channels/<id>/messages/<id>/reactions/<emoji>`: Remove reaction from message
- `DELETE /channels/<id>/messages/<id>/reactions`: Remove all reaction from a message

It adds a new permission `React` with value `536870912`.

It adds three new events:

- `MessageReact { id: String; channel_id: String; user_id: String; emoji_id: String; }`
- `MessageUnreact { id: String; channel_id: String; user_id: String; emoji_id: String; }`
- `MessageRemoveReaction { id: String; channel_id: String; emoji_id: String; }`

### 20220707-1: Emoji Update

This update adds support for server emojis, including the following REST routes:

- `GET /custom/emoji/<id>`: Get an existing emoji
- `PUT /custom/emoji/<id>`: Create a new emoji (uses Autumn id)
- `DELETE /custom/emoji/<id>`: Delete an emoji
- `GET /server/<id>/emojis`: Fetch all emoji in a server

It adds a new permission `ManageCustomisation` with value `8`.

It includes a new field in the `Ready` payload: `emojis?: Emoji[]`.

It adds two new events:

- `EmojiCreate(Emoji)`
- `EmojiDelete { id: String }`

### 20220608-1: Friends API v2

To accomodate the new Unicode usernames, the existing add friend route is being split into two different routes:

- `PUT /users/{target}/friend`: Accept friend request where `{target}` is an ID
- `POST /users/friend`: Send friend request (with body `{ username: string }`)

The old route will stop accepting usernames in a week, see [20220608-2](/changes/20220608-friends-api-v1-deprecation).

### 20220608-2: 'Send Friend' Deprecation

The `PUT /users/{target}/friend` route will stop accepting usernames in place of `{target}`.
11 changes: 11 additions & 0 deletions new/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Revolt Wiki
description: Get started building your docs site with Starlight.
template: splash
hero:
tagline: Welcome to Revolt's documentation. Everything you need to contribute to Revolt, build apps or bots, or to learn more about the project can be found here.
actions:
- text: Get started
link: /guides/contrib/
icon: right-arrow
---
19 changes: 19 additions & 0 deletions new/src/content/docs/reference/endpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Endpoints
---

You can connect to the API on the following URLs:

| URL | Release | Description |
| ----------------------------- | :--------: | --------------------------- |
| `https://api.revolt.chat` | Production | Primary API endpoint |
| `https://app.revolt.chat/api` | Production | API endpoint for old client |
| `https://revolt.chat/api` | Staging | API endpoint for new client |

You can connect to the events server on the following URLs:

| URL | Release | Description |
| ------------------------------ | :--------: | ------------------------------ |
| `wss://ws.revolt.chat` | Production | Primary events endpoint |
| `wss://app.revolt.chat/events` | Production | Events endpoint for old client |
| `wss://revolt.chat/events` | Staging | Events endpoint for new client |
39 changes: 25 additions & 14 deletions src/faq.md → new/src/content/docs/resources/faq.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Frequently Asked Questions
---
title: 'Frequently Asked Questions'
---
import { Badge } from '@astrojs/starlight/components';

This page includes several frequently asked questions and explanations.

All of these answers are written from the perspective of the project owner.

**Last Update:** 10th May 2024
<Badge text="Last Update: 10th May 2024" variant="caution" size="medium" />
<br />

```admonish info collapsible=true title="Why another project?"
<details>
<summary><Badge text="Why another project?" variant="note" /></summary>
I think this is best explained with a bit of history:
- Revolt started as a passion project
- It grew way beyond any of our expectations
@@ -17,23 +22,27 @@ Beyond that:
- At the time, there was also a relative void of competition in this specific genre of chat platforms. There were Guilded, Discord, and Matrix but these are all either closed-source or cater to a different audience.

PS. I've had a few people say, 'why not just contribute to X?', the answer is quite simple, I just didn't know about any of these projects (i.e. Matrix).
```
</details>

```admonish info collapsible=true title="How are we funded?"
<details>
<summary><Badge text="How are we funded?" variant="note" /></summary>
Revolt is entirely funded through donations, we have amassed a significant amount of money from donations alone. (financial transparency reports coming soon :tm:)

The month-to-month income of Revolt covers our operational costs and leaves enough spare to cover yearly expenses and the occassional one-time expense, such as for additional hardware.

We have monetisation plans lined up for the future, however it is not our intention to paywall existing features, instead where possible we intend to pass down costs such as for file storage or voice bandwidth.
```
</details>

<details>
<summary><Badge text="'X' feature when?" variant="note" /></summary>

```admonish info collapsible=true title="'X' feature when?"
Please take a look at [our roadmap on GitHub](https://github.com/orgs/revoltchat/projects/6/views/4).

If you find something is not listed, it could be [being worked on somewhere](https://github.com/orgs/revoltchat/projects/3) or have been [requested as a feature](https://github.com/orgs/revoltchat/discussions/categories/feature-suggestions).
```
</details>

```admonish info collapsible=true title="Does Revolt have federation?"
<details>
<summary><Badge text="Does Revolt have federation?" variant="note" /></summary>
As of right now, Revolt does not feature any federation and **it is not in our feature roadmap**.

However, this does not necessarily mean federation is off the table, possible avenues are:
@@ -45,9 +54,10 @@ However, this does not necessarily mean federation is off the table, possible av
Any federation that is implemented MUST exercise caution in:
- Preventing spam and abuse: moderators should be able to block malicious actors
- Protecting user data: users should be able to redact all of their information and messages
```
</details>

```admonish info collapsible=true title="What can I do with Revolt and how do I self-host?"
<details>
<summary><Badge text="What can I do with Revolt and how do I self-host?" variant="note" /></summary>
In general:
- The Revolt branding is used to represent the platform, revolt.chat.
- You may use the branding as-is to promote the platform and your community on the platform.
@@ -69,9 +79,10 @@ As a third-party platform:
You can self-host Revolt by:
- Using [Docker Compose and our recommended guide](https://github.com/revoltchat/self-hosted).
- Building individual components yourself from the [source code](https://github.com/revoltchat).
```
</details>

```admonish info collapsible=true title="Can you verify my server/bot?"
<details>
<summary><Badge text="Can you verify my server/bot?" variant="note" /></summary>
Currently, you can only apply to verify servers given that you have a valid reason to believe verification is necessary for your community. Verification is intended to provide protection for server owners from copy cats and to provide authenticity to users as such we are not just giving it out to anyone because that would defeat the purpose.

However if you would like to get a server verified, you should satisfy one of the following criteria:
@@ -85,7 +96,7 @@ However if you would like to get a server verified, you should satisfy one of th
Server verification also comes with a vanity invite, so please have one ready if you want to apply. To apply, drop an email at [contact@revolt.chat](contact@revolt.chat).

We also periodically prune verification from servers that have fallen into disrepair and / or otherwise are no longer active.
```
</details>

For questions about the Revolt platform, you may want to go to our knowledge base:

10 changes: 10 additions & 0 deletions new/src/content/docs/resources/libraries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Libraries
---

The following libraries are provided by the Revolt team:

- [revolt.js](https://github.com/revoltchat/revolt.js): JavaScript library built with Solid primitives
- [revolt.py](https://github.com/revoltchat/revolt.py): Python library

You can find a host of [community created libraries here](https://github.com/revoltchat/awesome-revolt#-api-libraries).
68 changes: 68 additions & 0 deletions new/src/content/docs/ru/guides/contrib.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Contribution Guide
---

This is the contribution guide for developers wanting to help out with Revolt.

## Repository Lifecycle

### Making Commits

- Sign-off your commits ([Git flag](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff)), [read here about DCO obligations](https://developercertificate.org/).
- Sign commits where possible, [learn more about that here](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).
- Commit using [Conventional Commit style](https://www.conventionalcommits.org/en/v1.0.0-beta.2/).
- Use `prettier` in relevant repositories using Typescript, use `cargo fmt` in those using Rust.
**Note:** PRs should only format files that have been changed to avoid conflicts.
- Try to keep each PR bound to a single feature or change, multiple bug fixes may be fine in some cases.
This is to avoid your PR getting stuck due to parts of it having conflicts or other issues.

### Merging Pull Requests

To keep commit history nice and tidy, always use [Conventional Commit style](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) for any merge commit messages. And where possible:

1. `Squash and Merge` for bug fixes / small features, especially if the fix has multiple iterations, [example](https://github.com/revoltchat/revite/pull/492), or if the commits don't follow conventional commit style.

Beyond this point you should usually check with a maintainer on how to merge, and should only proceed with the following if the commits follow [Conventional Commit style](https://www.conventionalcommits.org/en/v1.0.0-beta.2/):

2. Prefer to `Rebase and Merge` where possible.
3. Create a merge request with commit message similar to `merge: remote-tracking branch abc into xyz (#1)`.

## What can I help with?

The main project board can serve as a helpful starting point:

1. If you are new to the code base or are looking for issues we really need help with, look at ["What can I help with?"](https://github.com/orgs/revoltchat/projects/3/views/11)
2. Issue Board ["Free Issues"](https://github.com/orgs/revoltchat/projects/3/views/1): issues that anyone can pick up and are generally free to work on
3. Issue Board ["Todo"](https://github.com/orgs/revoltchat/projects/3/views/1): these are issues that are probably fine to pick up, but please ask first since a lot of these tend to be complicated and potentially already planned
4. Working on new issues and fixes: ideally you should run new features by us, most fixes are probably going to be alright though, we wouldn't want to reject any PRs that we don't deem suitable after work has already been done. If it's a fix, make sure to make an issue for it first, if it's a new feature, it may be better suited in [Feature Suggestions](https://github.com/revoltchat/revolt/discussions/categories/feature-suggestions)

Any issues marked with "Future Work" or with a milestone greater than the current milestone are out of bounds and should not be worked on since it's likely that the team already has a plan in place, any work you may do may conflict with prior ideas, and your work may potentially be rejected if it does fit the criteria exactly. In general, these issues are just postponed to reduce long term technical debt, i.e. allow current issues to be handled.

## Project Guidance

Please read the additional relevant guidance on:

- [Developing for Backend](https://github.com/revoltchat/backend?tab=readme-ov-file#development-guide) (contrib guide TBA)
- [Developing for Frontend](https://github.com/revoltchat/frontend?tab=readme-ov-file#development-guide) (contrib guide TBA)
- [Contributing to Android](https://revoltchat.github.io/android/contributing/guidelines/)

## Other ways to help

You can contribute to Revolt in a variety of ways:

### 1. Feedback

The easiest, but most important, way to contribute to Revolt is to voice your opinion and give us feedback.
We want to hear what you think and appreciate and await your feature suggestions, bug reports and general opinions on everything Revolt has to offer.

Within the Revolt app, you can navigate to the [**feedback tab**](https://app.revolt.chat/settings/feedback), or you can open an issue on the relevant [GitHub repo](https://github.com/revoltchat).

### 2. Translate

Revolt is used by users all around the world; as such, it's more accessible if the user interface is available in a variety of languages.
You can contribute translations through [**Weblate**](https://weblate.insrt.uk/engage/revolt/).

### 3. Donate

Revolt is not backed by a big company, is not currently monetised (for example, via a subscription service) and does not serve you advertisements; as such, Revolt currently relies entirely on donations.
You can learn more about donating [here](https://insrt.uk/donate) - if you want to make a larger donation, please consult me first.
11 changes: 11 additions & 0 deletions new/src/content/docs/ru/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Revolt Wiki
description: Get started building your docs site with Starlight.
template: splash
hero:
tagline: Welcome to Revolt's documentation. Everything you need to contribute to Revolt, build apps or bots, or to learn more about the project can be found here.
actions:
- text: Get started
link: /ru/guides/contrib/
icon: right-arrow
---
11 changes: 11 additions & 0 deletions new/src/content/docs/ru/reference/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Example Reference
description: A reference page in my new Starlight docs site.
---

Reference pages are ideal for outlining how things work in terse and clear terms.
Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you're documenting.

## Further reading

- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework
106 changes: 106 additions & 0 deletions new/src/content/docs/ru/resources/faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
title: 'Frequently Asked Questions'
---
import { Badge } from '@astrojs/starlight/components';

This page includes several frequently asked questions and explanations.

All of these answers are written from the perspective of the project owner.

<Badge text="Last Update: 10th May 2024" variant="caution" size="medium" />
<br />

<details>
<summary><Badge text="Why another project?" variant="note" /></summary>
I think this is best explained with a bit of history:
- Revolt started as a passion project
- It grew way beyond any of our expectations
- We might as well keep going since there is an interest in this space

Beyond that:
- Revolt has been a great learning experience, including development, management, and running the infrastructure for a large project. Revolt has also taught me a lot about different concepts and programming languages, and really, that's how developers learn. We make cool projects to try to better how we work, it doesn't matter if someone has done it before as long as you can attempt to do the same. Reinventing the wheel is part of the process.
- At the time, there was also a relative void of competition in this specific genre of chat platforms. There were Guilded, Discord, and Matrix but these are all either closed-source or cater to a different audience.

PS. I've had a few people say, 'why not just contribute to X?', the answer is quite simple, I just didn't know about any of these projects (i.e. Matrix).
</details>

<details>
<summary><Badge text="How are we funded?" variant="note" /></summary>
Revolt is entirely funded through donations, we have amassed a significant amount of money from donations alone. (financial transparency reports coming soon :tm:)

The month-to-month income of Revolt covers our operational costs and leaves enough spare to cover yearly expenses and the occassional one-time expense, such as for additional hardware.

We have monetisation plans lined up for the future, however it is not our intention to paywall existing features, instead where possible we intend to pass down costs such as for file storage or voice bandwidth.
</details>

<details>
<summary><Badge text="'X' feature when?" variant="note" /></summary>

Please take a look at [our roadmap on GitHub](https://github.com/orgs/revoltchat/projects/6/views/4).

If you find something is not listed, it could be [being worked on somewhere](https://github.com/orgs/revoltchat/projects/3) or have been [requested as a feature](https://github.com/orgs/revoltchat/discussions/categories/feature-suggestions).
</details>

<details>
<summary><Badge text="Does Revolt have federation?" variant="note" /></summary>
As of right now, Revolt does not feature any federation and **it is not in our feature roadmap**.

However, this does not necessarily mean federation is off the table, possible avenues are:
- Implement our own federation protocol
- Implement a promising up and coming federation protocol, polyproto
- Implement the Matrix protocol (unlikely, obtuse and unstable)
- Implement the XMPP protocol (battle-tested and stable)

Any federation that is implemented MUST exercise caution in:
- Preventing spam and abuse: moderators should be able to block malicious actors
- Protecting user data: users should be able to redact all of their information and messages
</details>

<details>
<summary><Badge text="What can I do with Revolt and how do I self-host?" variant="note" /></summary>
In general:
- The Revolt branding is used to represent the platform, revolt.chat.
- You may use the branding as-is to promote the platform and your community on the platform.
- You should not use the branding in order to appear as if you are associated with the Revolt team.
- Please make explicit distinctions between Revolt (the platform, "revolt.chat") and the Revolt software.
- The Revolt software is unbranded and only associated by name.

If you have any concerns or questions, please liase with us at [hello@revolt.chat](hello@revolt.chat).

As a third-party platform:
- You **must** provide correct attribution in line with our software licenses:

If you are using official images (GitHub Packages / Docker Hub), attribution is included.
If you are modifying the software and using it in production, you must publish the changes to the source publicly in line with AGPLv3. (In addition to providing attribution back to the original project.)
- You are **solely responsible** for whatever happens on your third party instance, we provide no warranty or liability for what happens on 3rd party instances.
- You **must not** appear to associate with Revolt / revolt.chat unless if granted explicit written permission. In regards to custom clients, provide a warning of any potential risks or clear it with us.
- You **may not** use any of the Revolt branding or brand assets to advertise or promote your third party instance.

You can self-host Revolt by:
- Using [Docker Compose and our recommended guide](https://github.com/revoltchat/self-hosted).
- Building individual components yourself from the [source code](https://github.com/revoltchat).
</details>

<details>
<summary><Badge text="Can you verify my server/bot?" variant="note" /></summary>
Currently, you can only apply to verify servers given that you have a valid reason to believe verification is necessary for your community. Verification is intended to provide protection for server owners from copy cats and to provide authenticity to users as such we are not just giving it out to anyone because that would defeat the purpose.

However if you would like to get a server verified, you should satisfy one of the following criteria:

- Official community for a well-established open source project
- Official community for any other well-established product, service, or person
- Large and active distinct pre-existing community

Distinct means the community is unique and well-known (& has an active presence) off platform. This means we are not currently verifying generic servers that centre around a topic unless if it meets one of the first two criteria. Though in special circumstances, well known on platform communities may also be considered.

Server verification also comes with a vanity invite, so please have one ready if you want to apply. To apply, drop an email at [contact@revolt.chat](contact@revolt.chat).

We also periodically prune verification from servers that have fallen into disrepair and / or otherwise are no longer active.
</details>

For questions about the Revolt platform, you may want to go to our knowledge base:

- [What badges can I get?](https://support.revolt.chat/kb/account/badges)
- [How old do I have to be to use Revolt?](https://support.revolt.chat/kb/safety/minimum-age-guidelines)
- [Are there any restrictions on servers being on Discover?](https://support.revolt.chat/kb/safety/discover-guidelines)
- [(... and more)](https://support.revolt.chat)
2 changes: 2 additions & 0 deletions new/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
1 change: 1 addition & 0 deletions new/src/public/permissions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions new/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "astro/tsconfigs/strict"
}