🌐 Add English docs

This commit is contained in:
LittleSheep 2024-09-28 15:53:51 +08:00
parent 608bdc5d28
commit 8b4b6eb703
7 changed files with 262 additions and 8 deletions

View File

@ -1,18 +1,17 @@
---
icon: mdi-airplane-landing
title: Landing
description: Welcome to Solsynth LLC's Knowledge Base, the Solar Archive!
title: Welcome to Landing
description: Welcome to Solsynth's Knowledge Base - The Solar Archive
---
![Solar Archive Thumbnail](/thumbnails/docs/solar-archive-thumbnail.webp)
Welcome to the Solsynth library!
Welcome to the Solsynth Archive!
The Solsynth Database, also known as the Sun Archive, is the largest known repository of Solsynth LLC products. It is operated by Solsynth LLC. Content and resources are provided by the community, with official oversight and corrections.
The Solsynth Archive, also known as the Solar Archive, is the largest known product database of Solsynth LLC. It is operated by Solsynth LLC and community-driven, with content and resources provided by the community, while being officially monitored and corrected.
We are still building the archive, but in the future all of our materials will be available here.
The archive is still under construction, but in the future, you will be able to access all our materials here.
You can contribute to our documentation by Forking our [Capital](https://git.solsynth.dev/Goatworks/Capital) to edit files within `content/<lang>/docs` and submit PRs.
Whether it's adding new content, fixing something that's incorrect, feel free to contribute.
You can contribute to our documentation by forking our [Capital](https://git.solsynth.dev/Goatworks/Capital) repository and submitting PRs to modify the files under `content/<lang>/docs`. Contributions are welcome, whether its adding new content or correcting inaccuracies.
*P.S. You can use Solarpass to log in to the Solsynth Code Repository with a single click.*
*P.S. You can use Solarpass for one-click login to the Solsynth Code Repository.*

View File

@ -0,0 +1,23 @@
---
icon: mdi-web
title: Solar Network
description: The Next-Generation Social Network by Solsynth LLC
---
![Solar Archive Thumbnail](/thumbnails/docs/solar-network-user-manual.webp)
Solar Network is a social network developed by Solsynth LLC, aiming to become the next-generation social network.
## Tech Stack
The Solar Network project follows the classic frontend-backend separation architecture, with the entire project divided into two parts: the frontend (Solian) and the backend (Hydrogen.Dealer, Hydrogen.Passport, etc.).
### Frontend
The frontend of Solar Network is a cross-platform client built with Flutter. For more details, check the [related page](solar-network/solian).
### Backend
The backend of Solar Network follows what we define as a "mid-service" architecture. Compared to microservices, each individual service is responsible for more tasks and is larger in scope, allowing us to maintain multiple projects more easily. At the same time, issues with a single service won't cause an overall outage.
At the center of it all is our core service — Hydrogen.Dealer, which serves as both the service discovery system and mid-service gateway. It is also the only external interface for Solar Network, with `api.sn.solsynth.dev` being the gateway exposed by Hydrogen.Dealer.

View File

@ -0,0 +1,9 @@
---
icon: mdi-palette
title: Creator Program
description: Welcome to the Solar Network Creator Program, Let's Co-create Solar Network
---
The Creator Program is an initiative by Solar Network designed to encourage users to create content. The goal of the program is to help creators use Solar Network to produce higher-quality content.
Join the Creator Program to receive more official support, get early access to new features, and provide valuable feedback to shape the future of Solar Network!

View File

@ -0,0 +1,38 @@
---
icon: mdi-sticker-emoji
title: Stickers and Sticker Packs
description: Stickers, Emotes, and Emojis
---
Stickers help users express their emotions better on Solar Network. This article introduces how to upload and use a sticker.
## Sticker Packs
Stickers must be part of a sticker pack. To create a sticker pack, go to the "Creator Hub" > "Stickers" section on the website sidebar.
## Stickers
Before creating a sticker, youll need to prepare the content. It is recommended to use a PNG or GIF image that is 1024x1024 pixels (minimum 128x128). The background can be transparent or not, but avoid solid color fills. Large white fills may cause discomfort for users in dark mode, akin to a flashbang.
Once the sticker pack is created, open it and select the plus symbol under "Actions" to add a sticker.
You might need to upload an attachment for the sticker material. After uploading, fill in the "Attachment" field with the Random ID (the series of characters after the #) from the completed upload. If the content displays correctly, the connection is successful.
After that, simply fill out the form to finish.
## Usage
To use a sticker, type a placeholder in your content, formatted as `:<pack prefix><sticker alias>:`.
For example, if a sticker pack has the prefix `solar` and a sticker alias `Hello`, the resulting placeholder would be `:solarHello:`.
Dont worry if that seems confusing—most of the time, we provide automatic suggestions. Simply type a colon in the Solian text box, followed by part of the placeholder, and suggestions will appear.
### Size Variations
In Solar Network, you may notice stickers appear in different sizes due to Smart Resize. The rules are as follows:
1. If only one sticker is present, it will appear at 128x128.
2. If three or fewer stickers are present, they will appear at 32x32.
3. If more than three stickers are present, or if stickers are embedded within text, they will appear at 20x20.
These adjustments are applied within a single paragraph.

View File

@ -0,0 +1,10 @@
---
icon: mdi-oci
title: Open Program
description: Welcome to the Solar Network Open Program, Let Us Help Your Application Grow
---
The Open Program is a collection of developer-friendly APIs and tools from Solar Network.
We adhere to principles that aim not to burden developers — no unnecessary encryption of parameters, no parameter obfuscation, and user-friendly API interfaces. We provide RESTful API endpoints to ensure the best possible developer experience.
Start exploring now and see what you can do with Solar Network!

View File

@ -0,0 +1,71 @@
---
icon: mdi-pencil-ruler
title: API Standards
description: The guidelines we follow when designing Solar Network service APIs
---
This article covers the paradigms we follow when designing Solar Network APIs, helping you better interact with our APIs for secondary development.
## Minimization
Our APIs aim to be minimalistic. Unlike some major platforms, where the response includes not only data but also a bunch of status codes, messages, and request IDs, we keep such information in the HTTP headers. The HTTP response body contains only the raw data, with no extra information (for paginated endpoints, an additional field for total count will be included).
## CRUD Operations
Our APIs generally follow RESTful design patterns. If you're unfamiliar with RESTful principles, heres how we practice it:
### Request Methods
- `GET` for fetching data
- `POST` for creating or performing some operations
- `PUT` for updating (though in RESTful principles it's also defined for creation, we dont use it that way)
- `PATCH` for updating (rarely used)
- `DELETE` for removing data
### Path Mapping
If you use `POST` to create data at an endpoint, using `GET` on the same endpoint will typically list the data.
Appending `/<id>` to the path will fetch a specific data entry. Switching the request method to `PUT` updates the entry, and using `DELETE` removes it.
If additional actions are needed, append paths after `/<id>`, usually for operations handled via `POST`.
Heres an example of path mapping for posts:
*Note: `:id` is a path parameter.*
- `GET /posts` - Retrieves a list of posts (paginated)
- `GET /posts/:id` - Retrieves a specific post
- `GET /posts/:id/replies` - Retrieves replies for a specific post (paginated)
- `POST /posts` - ~~Creates a post~~ (removed in the new version due to post types; use the specific post type creation endpoint)
- `PUT /posts/:id` - ~~Updates a post~~ (removed in the new version due to post types; use the specific post type update endpoint)
- `DELETE /posts/:id` - Deletes a post
- `POST /posts/:id/pin` - Pins a post
- `POST /posts/:id/react` - Reacts to a post
## Error Handling
We dont understand why, despite HTTP providing a complete set of status codes, other large companies still create their own. For HTTP status codes, heres a summary of common meanings:
- `500` - Internal Server Error — No need to worry; just file an issue if it happens frequently.
- `400` - Bad Request — Check the documentation and request body.
- `404` - Data not found or incorrect API path.
- `403` - Forbidden — You dont have permission.
- `401` - Unauthorized — API token required but not provided.
- `200` - Success
- `204` - No Content — Common for delete operations (though often forgotten during API development).
If the response status is not `2xx`, we usually return a `plain/text` response instead of `application/json`, providing a simple line of text indicating the error.
> If youre not good at English, dont keep asking us about errors — use a translator! Why else would we write error messages?
## Super Gateway
The Super Gateway refers to our [Hydrogen.Dealer](https://git.solsynth.dev/Hydrogen/Dealer). In most cases, you wont directly access our services; requests are forwarded through the Dealer gateway. Were not even sure why we created this.
Our API base URL is `api.sn.solsynth.dev`. How do you use it? Its simple. Access `/cgi/<service name>`, and this path will be forwarded to the corresponding services `/api` endpoint. In the latest version, we also introduced aliases for these services, making the URLs more readable.
- `/cgi/id` or `/cgi/auth` — Authentication service [Hydrogen.Passport](https://git.solsynth.dev/Hydrogen/Passport)
- `/cgi/uc` or `/cgi/files` — Attachment service [Hydrogen.Paperclip](https://git.solsynth.dev/Hydrogen/Paperclip)
- `/cgi/co` or `/cgi/interactive` — Post service [Hydrogen.Interactive](https://git.solsynth.dev/Hydrogen/Interactive)
- `/cgi/im` or `/cgi/messaging` — Messaging service [Hydrogen.Messaging](https://git.solsynth.dev/Hydrogen/Messaging)
> Fun fact: You might have noticed that the new aliases are actually the subdomains used before we had the Super Gateway.

View File

@ -0,0 +1,104 @@
---
icon: mdi-open-in-app
title: Solian Chain
description: Solian is the official cross-platform client developed by Solsynth LLC.
---
Solian is the cross-platform Solar Network client built with Flutter, and currently, its our only frontend.
# Usage
To use Solian, you can either download the client or open it directly in your browser. Thanks to Flutters cross-platform support, you can access the web version of Solian at https://lian.solsynth.dev. However, due to browser limitations, some features may be missing or affected.
## Download
There are many ways to download Solsynth, but make sure to download from officially certified channels.
1. The official release version from the repository: https://git.solsynth.dev/Hydrogen/Solian/releases
2. The test version from the official file storage: https://files.solsynth.dev/production01/solian
3. Official TestFlight (iOS and some macOS): https://testflight.apple.com/join/YJ0lmN6O
The Windows version is a portable version. You can place it in a directory you're familiar with and run it directly.
The web version also supports PWA (Progressive Web Application), which can replace some desktop usage.
## Installation
Below are the technical instructions for installing Solian on different platforms.
### Android
It is recommended to download the latest test version from the **file storage**. It has the latest fixes and is the most stable. ~~The test version is more stable than the stable version.~~
You can open and install the downloaded APK file directly. For Chinese phones, additional steps may be required for verification, but please avoid searching for and downloading from built-in app stores.
### iOS/macOS
Use TestFlight for installation. First, click the link above to download the TestFlight app. Then, click "Start Testing" in the second step of the link to join the test.
TestFlight has a limited number of testing slots. Once the time is right, we will release Solian on the App Store (non-China region), where you can search and download it.
### Windows
After downloading from any trusted source, extract it to a directory, and you can start using it.
**Note:** It seems that, due to a potential Flutter support issue, the Windows version often freezes for a while during the first startup before displaying the main window. Please be patient and avoid clicking repeatedly, as it may take 5 to 30 seconds. Repeated clicking may open multiple windows.
### Linux
Please build it yourself. I believe you can do it — good luck!
## Build It Yourself
### Preparing the Environment
Building Solian requires the Flutter SDK. Please download the latest version from the official site. Alternatively, you can download it from a China mirror.
After installing Flutter, follow the official documentation to install other platform-specific dependencies (e.g., Windows requires VS2022, Android requires Android Studio, and for iOS/macOS, its better to use the official pre-built version).
In addition to installing the Flutter SDK, we need Rust for system-level dependencies. Please download the latest version from the official Rust site.
Now that we have Flutter and Rust, we need one more thing — SQLite3, to support local databases for chat and future modules.
For Linux, you need to install the corresponding SQLite3 development dependencies:
```sh
# for ubuntu
sudo apt-get -y install libsqlite3-0 libsqlite3-dev
```
For Windows, download the
[sqlite3.dll](https://github.com/tekartik/sqflite/raw/master/sqflite_common_ffi/lib/src/windows/sqlite3.dll)
and place it in the running directory.
No additional steps are needed for macOS or mobile builds.
### Building the Code
Next, its time to build the code. Ensure that you have `git` installed on your build machine. Alternatively, you can download the code as a compressed archive.
Once `git` is installed, use the following command to clone the code:
```sh
git clone https://git.solsynth.dev/Hydrogen/Solian.git
```
Navigate to the corresponding directory and install dependencies using the following command:
```sh
flutter pub get
```
This will download dependencies from [pub.dev](https://pub.dev), hosted by Google. Connectivity within mainland China might be questionable. Refer to mirror sites for solutions.
Once the dependencies are installed, you can proceed with the build. Just one line of code:
```sh
# for windows
flutter build windows
# for macos
flutter build macos
# for linux
flutter build linux
# for ios
flutter build ipa
# for android
flutter build apk
```
You can also build other formats for Android, such as `aab`, but please prepare the necessary signing materials yourself.