Skip to content

Commit

Permalink
doc: update README and add screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuget committed Oct 5, 2023
1 parent 7eb0077 commit 13c29cd
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 119 deletions.
47 changes: 11 additions & 36 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
DISPLAYING_NAME="Your name"
AVATAR_URL=

# -------
# Bluesky
# -------

BLUESKY_ENABLED=true
BLUESKY_URL=https://bsky.social
BLUESKY_IDENTIFIER=
BLUESKY_PASSWORD=

# --------
# Mastodon
# --------

MASTODON_ENABLED=true
MASTODON_URL=https://piaille.fr
MASTODON_ACCESS_TOKEN=

# -------
# Twitter
# -------

TWITTER_ENABLED=true
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_SECRET=

# ----------
# S3 Storage
# ----------

# MinIO config for docker-compose
MINIO_ROOT_USER=minio-admin
MINIO_ROOT_PASSWORD=my-secured-password

MINIO_ENDPOINT=http://localhost:9000
MINIO_REGION=eu-fr-1
MINIO_BUCKET_NAME=threadr-app
MINIO_MEDIA_PATH=media
MINIO_ACCESS_KEY=minio-admin
MINIO_SECRET_KEY=my-secured-password

# MinIO config for docker-compose
MINIO_ROOT_USER=minio-admin
MINIO_ROOT_PASSWORD=my-secured-password
MINIO_ACCESS_KEY="${MINIO_ROOT_USER}"
MINIO_SECRET_KEY="${MINIO_ROOT_PASSWORD}"

# ----------------
# Data persistence
Expand All @@ -50,3 +20,8 @@ POSTGRES_USER=postgres-admin
POSTGRES_PASSWORD=postgres-password
POSTGRES_DB=threadr
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?schema=public"

# ---------------
# Scheduling jobs
# ---------------
REDIS_URL=redis://localhost:6379
130 changes: 47 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

Threadr is a small (#workinprogress) web application that helps users of micro-blogging platforms to write great threads and allows them to crosspost in one click their content to Bluesky, Mastodon and Twitter/X.

## Core features

* Write thread
* Add, edit, remove messages
* Add, describe, remove message images (up to 4 by message)
* Save a thread
* List all threads (by status, e.g. `draft`, `scheduled`, `published`)
* Publish a thread
* Schedule (and cancel) a thread publication
* Configure platforms in a settings manager
* display name
* avatar
* Bluesky activation and configuration
* Mastodon activation and configuration
* Twitter activation and configuration

## Installation

For now, Threadr only works in localhost.
Expand All @@ -24,14 +40,24 @@ $ docker compose up -d

**4/** Configure your MinIO instance

MinIO console is accessible on [localhost:9001](http://localhost:9001) (credentials in `.env`file, cf. `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD`)
MinIO console is accessible on [localhost:9001](http://localhost:9001). Credentials are defined in `.env`file, cf. `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD`. By default, values are "minio-admin" / "my-secured-password".

![MinIO login screen](./docs/minio_login.png)

Create a bucket (ex: "threadr-app" in `.env.sample`).

In the settings, configure MinIO region (ex: "eu-fr-1" in `.env.sample`).
![Create a MinIO bucket](./docs/minio_create_bucket.png)

In the MinIO settings, configure MinIO region (ex: "eu-fr-1" in `.env.sample`).

![Region Configuration in MinIO](./docs/minio_configure_region.png)

> ⚠️ It is recommanded to declare a custom policy with dedicacted path in `readonly` acces for anonymous visitors
![Add anonymous access rule](./docs/minio_configure_anonymous_access_rule.png)

![Anonymous access rule result](./docs/minio_bucket_access_policy.png)

**5/** Run Threadr locally

```shell
Expand All @@ -45,93 +71,21 @@ $ npm run dev -- -o
<img src="/threadr.png" width="480">
</p>

## Configuration

All configuration option are set in the `.env` file.

<details>

<summary>Editing threads, messages and media</summary>

**`DISPLAYING_NAME`: string**

The name displayed on the header of each message in the Editor.


**`AVATAR_URL`: URL**
**7/** (bonus) You can follow your scheduled threads in BullMQ console

The URL to an avatar image (eg: the one of your avatar on X/Twitter).
Run the following command :

</details>

<details>

<summary>Publishing on Bluesky</summary>

**`BLUESKY_ENABLED`: boolean**

Activate or deactivate posting on Bluesky platform.

**`BLUESKY_URL`: URL**

Bluesky is based on the [Authenticated Transfer Protocol](https://atproto.com/guides/overview).
Today, Bluesky API endpoint URL is `https://bsky.social` but maybe one day it will be a different one.

**`BLUESKY_IDENTIFIER`: string**

The username of the Bluesky publisher account.

**`BLUESKY_PASSWORD`: string**

The password of the Bluesky publisher account.

</details>

<details>

<summary>Publishing on Mastodon</summary>

**`MASTODON_ENABLED`: boolean**

Activate or deactivate posting on Mastodon platform.

**`MASTODON_URL`: URL**

The Mastodon instance URL.Check that the instance allows API.

**`MASTODON_ACCESS_TOKEN`: string**

The token of the Mastodon publisher app.

</details>

<details>

<summary>Publishing on Twitter</summary>

**`TWITTER_ENABLED`: boolean**

Activate or deactivate posting on Twitter platform.

> cf. [the official Twitter documentation](https://developer.twitter.com/en/docs/authentication/oauth-1-0a/api-key-and-secret) about how to generate tokens.
**`TWITTER_CONSUMER_KEY`: string**

The Twitter app Consumer Key.

**`TWITTER_CONSUMER_SECRET`: string**

The Twitter app Consumer Secret.
```shell
$ npx bullmq-dashboard-runnable thread-schedules -P 3001
```

**`TWITTER_ACCESS_TOKEN`: string**
Then access [localhost:3001](http://localhost:3001).

Twitter app’s authentication access token.
![BullMQ console](./docs/bullmq_console.png)

> cf. [OAuth 2.0 Authorization Code](https://developer.twitter.com/en/docs/authentication/oauth-2-0/authorization-code)
**`TWITTER_ACCESS_SECRET`: string**
## Configuration

Twitter app’s authentication access secret.
</details>
All configuration option are set in the `.env` file.

<details>

Expand Down Expand Up @@ -190,4 +144,14 @@ The PostgreSQL administration account password (used for docker-compose postgres

The PostgreSQL database.

</details>

<details>

<summary>Scheduling thread publication</summary>

**`REDIS_URL`: (Redis) URL**

The Redis database URL, used by BullMQ.

</details>
Binary file added docs/bullmq_console.png
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 docs/minio_bucket_access_policy.png
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 docs/minio_configure_anonymous_access_rule.png
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 docs/minio_configure_region.png
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 docs/minio_create_bucket.png
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 docs/minio_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 13c29cd

Please sign in to comment.