Move documentations to external folder
7
docs/comty-cli/_category_.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "Comty CLI",
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -3,4 +3,3 @@ sidebar_position: 1
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
Me pica el splungus
|
7
docs/comty-js/_category_.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "Comty.JS",
|
||||
"position": 2,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
37
docs/comty-js/getting-started.md
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Getting Started with Comty.JS
|
||||
[https://github.com/ragestudio/comty.js](https://github.com/ragestudio/comty.js)
|
||||
|
||||
Welcome to Comty.JS, the official JavaScript library for interacting with the Comty API! This library is designed to simplify communication with Comty services, whether you're building a server-side application or a client-side interface.
|
||||
|
||||
## What is Comty.JS?
|
||||
|
||||
Comty.JS provides a convenient wrapper around the Comty API, handling authentication, request management, real-time communication via WebSockets, and more. It aims to make your development process smoother and more efficient by abstracting away the complexities of direct API interaction.
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- **Simplified API Access:** Easy-to-use models for various Comty services like Authentication, Posts, User Management, Music, Chats, and more.
|
||||
- **Authentication Handling:** Built-in support for server keys and user token-based authentication, including automatic token refresh.
|
||||
- **WebSocket Integration:** Seamlessly connect to Comty's real-time services.
|
||||
- **Addon System:** Extend the library's functionality with custom addons.
|
||||
- **Environment Aware:** Works in both Node.js (server-side) and browser (client-side) environments.
|
||||
- **Request Management:** Uses `axios` for HTTP requests with interceptors for automatic token attachment and error handling.
|
||||
|
||||
## Who is this for?
|
||||
|
||||
This library is for developers who want to:
|
||||
|
||||
- Integrate their JavaScript or TypeScript applications with Comty.
|
||||
- Build features that utilize Comty's social, music, or other platform functionalities.
|
||||
- Quickly set up communication with the Comty API without dealing with raw HTTP requests and WebSocket management.
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **[Installing Comty.JS](./installing.md)**: Learn how to add the library to your project.
|
||||
2. **[Client Initialization](./client-initialization.md)**: Understand how to set up and configure the Comty.JS client.
|
||||
3. **[Authentication](./authentication.md)**: Dive into how authentication works with Comty.JS.
|
||||
|
||||
We're excited to see what you build with Comty.JS!
|
103
docs/comty-js/installing.md
Normal file
@ -0,0 +1,103 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Installing Comty.JS
|
||||
|
||||
To get started with Comty.JS, you need to add it as a dependency to your project. The library is available on npm.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* Node.js (version 12 or higher recommended, as per `jsonwebtoken` and `sucrase` dependencies)
|
||||
* A package manager like npm or Yarn
|
||||
|
||||
## Installation
|
||||
|
||||
You can install Comty.JS using either npm or Yarn:
|
||||
|
||||
### Using npm
|
||||
|
||||
```bash
|
||||
npm install comty.js
|
||||
```
|
||||
|
||||
### Using Yarn
|
||||
|
||||
```bash
|
||||
yarn add comty.js
|
||||
```
|
||||
|
||||
This will download Comty.JS and add it to your project's `node_modules` directory. The following dependencies will also be installed:
|
||||
|
||||
* `@foxify/events`: ^2.1.0
|
||||
* `axios`: ^1.8.4
|
||||
* `js-cookie`: ^3.0.5
|
||||
* `jsonwebtoken`: ^9.0.0
|
||||
* `jwt-decode`: ^4.0.0
|
||||
* `linebridge-client`: ^1.1.1
|
||||
* `luxon`: ^3.6.0
|
||||
* `socket.io-client`: ^4.8.1
|
||||
|
||||
For development, if you plan to contribute or build the library locally, you'll also need:
|
||||
|
||||
* `@ragestudio/hermes`: ^1.0.1 (used for building the project)
|
||||
|
||||
## Importing the library
|
||||
|
||||
Once installed, you can import Comty.JS into your project:
|
||||
|
||||
### ES Modules (JavaScript or TypeScript)
|
||||
|
||||
```javascript
|
||||
import createClient from 'comty.js';
|
||||
// or for specific models if needed (though typically client is the main entry)
|
||||
// import { AuthModel, PostModel } from 'comty.js/models'; // Adjust path based on actual export structure if modular imports are supported
|
||||
```
|
||||
|
||||
### CommonJS (Node.js)
|
||||
|
||||
```javascript
|
||||
const createClient = require('comty.js');
|
||||
// or for specific models
|
||||
// const { AuthModel, PostModel } = require('comty.js/models'); // Adjust path
|
||||
```
|
||||
|
||||
If you look at the `package.json`, the main entry point is `"./dist/index.js"`.
|
||||
|
||||
```json comty-project/public-repo/comty.js/package.json#L3
|
||||
{
|
||||
"name": "comty.js",
|
||||
"version": "0.65.5",
|
||||
"main": "./dist/index.js",
|
||||
"description": "Official Comty API for JavaScript",
|
||||
"homepage": "https://github.com/ragestudio/comty.js",
|
||||
"author": "RageStudio <support@ragestudio.net>",
|
||||
"scripts": {
|
||||
"build": "hermes build"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@foxify/events": "^2.1.0",
|
||||
"axios": "^1.8.4",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"linebridge-client": "^1.1.1",
|
||||
"luxon": "^3.6.0",
|
||||
"socket.io-client": "^4.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ragestudio/hermes": "^1.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Now you're ready to initialize the client and start interacting with the Comty API.
|
||||
|
||||
## Next Steps
|
||||
|
||||
* **[Client Initialization](./client-initialization.md)**: Learn how to set up and configure the Comty.JS client.
|
7
docs/development/_category_.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "Development",
|
||||
"position": 1,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
64
docs/development/getting-started.md
Normal file
@ -0,0 +1,64 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
# Getting Started
|
||||
We strongly recommend using Linux or macOS for development. Other platforms, such as Windows, can cause multiple issues.
|
||||
|
||||
Using Docker dev containers is also a nice choice.
|
||||
|
||||
## Dependencies
|
||||
- Node.js (v18 or higher)
|
||||
> Install [manually](https://nodejs.org/en/download/) or use [nvm](https://github.com/nvm-sh/nvm) tool (or similar tools).
|
||||
|
||||
- Python (3.10 or higher)
|
||||
|
||||
- [node-gyp](https://github.com/nodejs/node-gyp#installation) Install globally `npm install -g node-gyp`
|
||||
|
||||
- FFmpeg & FFprobe (^6.0 or higher)
|
||||
> On Linux you can use built-in script to install it in your system-wide `packages/server/scripts/installLatestFfmpeg.sh` (uses CURL)
|
||||
|
||||
- (Recomended) Use [npm](https://docs.npmjs.com/cli/v11/configuring-npm/install) package manager.
|
||||
|
||||
- (Optional) [Docker](https://docs.docker.com/get-docker/), used for develop/building/deploy.
|
||||
|
||||
## Getting files
|
||||
- Getting the repository
|
||||
```shell
|
||||
git clone --recurse-submodules https://github.com/ragestudio/comty && cd comty
|
||||
```
|
||||
|
||||
- Installing all dependencies
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
## Setup Gateway
|
||||
Comty uses a custom gateway to handle all requests and manage backend services. This gateway has two available engines for serving requests:
|
||||
- `nginx`: Currently recommended.
|
||||
- `http_proxy`: Obsolete, used in previous versions. Probably broken.
|
||||
|
||||
You can select an available engine by setting the `GATEWAY_MODE="<engine>"` environment variable. This can also be declared in the `.env` file.
|
||||
|
||||
By default, the gateway uses NGINX (as a proxy) to handle requests, so you'll need to set up this dependency.
|
||||
|
||||
It can be installed system-wide or by linking a static binary to `packages/server/nginx-bin`
|
||||
|
||||
> On Linux you can use built-in script to statically install
|
||||
`packages/server/scripts/installNginxStatic.sh` (needs CURL)
|
||||
|
||||
## First Setup
|
||||
This will execute some tasks to initialize for first time your resources, like S3, Databases...etc.
|
||||
If you already initialized previously, skip this step.
|
||||
|
||||
- Run server setup script (if needed)
|
||||
```shell
|
||||
npm run setup:server
|
||||
```
|
||||
|
||||
Also can you use the `--force` flag to force the execution of this tasks again.
|
||||
|
||||
### Starting the development server
|
||||
- You can use the command `npm run dev` to start all development servers.
|
||||
```shell
|
||||
npm run dev
|
||||
```
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"label": "Client SDK",
|
||||
"position": 2,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
Me pica el splungus
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"label": "Comty™ CLI",
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
Me pica el splungus
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"label": "Comty.JS",
|
||||
"position": 1,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Installing
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"label": "Spectrum™ API",
|
||||
"position": 4,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
Me pica el splungus
|
@ -1 +0,0 @@
|
||||
# Meet or TOS
|
0
docs/.gitignore → docusaurus/.gitignore
vendored
@ -40,6 +40,7 @@ const config = {
|
||||
/** @type {import("@docusaurus/preset-classic").Options} */
|
||||
({
|
||||
docs: {
|
||||
path: "../docs",
|
||||
sidebarPath: "./sidebars.js",
|
||||
//editUrl: "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
|
||||
},
|
||||
@ -68,12 +69,12 @@ const config = {
|
||||
position: "left",
|
||||
label: "Docs",
|
||||
},
|
||||
{
|
||||
type: "docSidebar",
|
||||
sidebarId: "legal",
|
||||
position: "left",
|
||||
label: "Legal",
|
||||
},
|
||||
// {
|
||||
// type: "docSidebar",
|
||||
// sidebarId: "legal",
|
||||
// position: "left",
|
||||
// label: "Legal",
|
||||
// },
|
||||
{
|
||||
href: "https://github.com/ragestudio/comty",
|
||||
label: "GitHub",
|
||||
@ -98,7 +99,7 @@ const config = {
|
||||
{
|
||||
label: "Comty",
|
||||
href: "https://comty.app/@ragestudio",
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
@ -108,6 +109,9 @@ const config = {
|
||||
theme: prismThemes.github,
|
||||
darkTheme: prismThemes.dracula,
|
||||
},
|
||||
colorMode: {
|
||||
defaultMode: "dark",
|
||||
},
|
||||
}),
|
||||
}
|
||||
|
@ -13,9 +13,8 @@
|
||||
|
||||
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
||||
const sidebars = {
|
||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||
docs: [{type: 'autogenerated', dirName: '.'}],
|
||||
legal: [{type: 'autogenerated', dirName: '.'}],
|
||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||
docs: [{ type: "autogenerated", dirName: "." }],
|
||||
}
|
||||
|
||||
export default sidebars;
|
||||
export default sidebars
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |