Soapbox mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
Alex Gleason 517e9f088c
Improve README explanation and local dev instructions
2 years ago
.github Move FUNDING.yml to .github/FUNDING.yml 2 years ago
.gitlab/issue_templates Add Bug issue template 2 years ago
.husky Use lint-staged with Husky to only lint changed files 3 years ago
app refactor 2 years ago
custom Copy custom instance files into the build 3 years ago
docs Docs: add "Developing a backend" 2 years ago
installation Mastodon nginx: remove try_files from @mastodon-packs 2 years ago
jest Upgrade Jest to v28 2 years ago
tailwind gradient-purple, gradient-blue --> gradient-start, gradient-end 2 years ago
types/redux-immutable FIX ROOT STATE TYPE!!!!! 2 years ago
webpack Upgrade Tabler to v1.73.0, use new import paths, remove Webpack hack 2 years ago
.editorconfig Add .editorconfig 4 years ago
.env.example Patron updates 4 years ago
.eslintignore eslintignore: /custom/** 2 years ago
.eslintrc.js ESLint: add no-duplicate-imports rule 2 years ago
.gitignore Produce a junit.xml during test:coverage 2 years ago
.gitlab-ci.yml GitLab CI: try jest --runInBand 2 years ago
.lintstagedrc.json Revert "Merge branch 'revert-f59d977a' into 'develop'" 3 years ago
.stylelintrc.json Start adding dark mode 3 years ago
.tool-versions Upgrade to Node 18 2 years ago
CHANGELOG.md Bump version to v1.3.0, update CHANGELOG.md 3 years ago
COFE_OF_CONDUCT.md Replace code of conduct with cofe of conduct 4 years ago
LICENSE Add LICENSE and README 5 years ago
README.md Improve README explanation and local dev instructions 2 years ago
babel.config.js eslint: indent switch statements 2 years ago
dangerfile.ts Danger: fix test files glob 2 years ago
jest.config.js Update tests for Jest v28, apply uuid hack 2 years ago
jsdoc.conf.js JSDoc scaffolding 3 years ago
package.json Merge remote-tracking branch 'origin/develop' into phone-input 2 years ago
postcss.config.js Add Tailwind 3 years ago
renovate.json Renovate: add GitHub access token for release notes 4 years ago
soapbox-screenshot.png Update README 3 years ago
tailwind.config.js Tailwind: reduce xl breakpoint to 1280px 2 years ago
tsconfig.json tsconfig: don't exclude any files 2 years ago
webpack.config.js eslint: indent switch statements 2 years ago
yarn.lock Merge remote-tracking branch 'origin/develop' into phone-input 2 years ago

README.md

Soapbox FE

Soapbox FE Screenshot

Soapbox FE is a frontend for Mastodon and Pleroma with a focus on custom branding and ease of use. It's part of the Soapbox project.

Try it out

Visit https://fe.soapbox.pub/ and point it to your favorite instance.

🚀 Deploy on Pleroma

Installing Soapbox FE on an existing Pleroma server is extremely easy. Just ssh into the server and download a .zip of the latest build:

curl -L https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs/artifacts/v2.0.0/download?job=build-production -o soapbox-fe.zip

Then unpack it into Pleroma's instance directory:

busybox unzip soapbox-fe.zip -o -d /opt/pleroma/instance

That's it! 🎉 Soapbox FE is installed. The change will take effect immediately, just refresh your browser tab. It's not necessary to restart the Pleroma service.

To remove Soapbox FE and revert to the default pleroma-fe, simply rm /opt/pleroma/instance/static/index.html (you can delete other stuff in there too, but be careful not to delete your own HTML files).

🐘 Deploy on Mastodon

See Installing Soapbox over Mastodon.

How does it work?

Soapbox FE is a single-page application (SPA) that runs entirely in the browser with JavaScript.

It has a single HTML file, index.html, responsible only for loading the required JavaScript and CSS. It interacts with the backend through XMLHttpRequest (XHR).

Here is a simplified example with Nginx:

location /api {
  proxy_pass http://backend;
}

location / {
  root /opt/soapbox;
  try_files $uri index.html;
}

(See mastodon.conf for a full example.)

Soapbox incorporates much of the Mastodon API, Pleroma API, and more. It detects features supported by the backend to provide the right experience for the backend.

Running locally

To get it running, just clone the repo:

git clone https://gitlab.com/soapbox-pub/soapbox-fe.git
cd soapbox-fe

Ensure that Node.js and Yarn are installed, then install dependencies:

yarn

Finally, run the dev server:

yarn dev

That's it! 🎉

It will serve at http://localhost:3036 by default.

You should see an input box - just enter the domain name of your instance to log in.

Tip: you can even enter a local instance like http://localhost:3000!

Troubleshooting: ERROR: NODE_ENV must be set

Create a .env file if you haven't already.

cp .env.example .env

And ensure that it contains NODE_ENV=development. Try again.

Troubleshooting: it's not working!

Run node -V and compare your Node.js version with the version in .tool-versions. If they don't match, try installing asdf.

Local Dev Configuration

The following configuration variables are supported supported in local development. Edit .env to set them.

All configuration is optional, except NODE_ENV.

NODE_ENV

The Node environment. Soapbox FE checks for the following options:

  • development - What you should use while developing Soapbox FE.
  • production - Use when compiling to deploy to a live server.
  • test - Use when running automated tests.

BACKEND_URL

URL to the backend server. Can be http or https, and can include a port. For https, be sure to also set PROXY_HTTPS_INSECURE=true.

Default: http://localhost:4000

PROXY_HTTPS_INSECURE

Allows using an HTTPS backend if set to true.

This is needed if BACKEND_URL is set to an https:// value. More info.

Default: false

Yarn Commands

The following commands are supported. You must set NODE_ENV to use these commands. To do so, you can add the following line to your .env file:

NODE_ENV=development

Local dev server

  • yarn dev - Run the local dev server.

Building

  • yarn build - Compile without a dev server, into /static directory.

Translations

  • yarn manage:translations - Normalizes translation files. Should always be run after editing i18n strings.

Tests

  • yarn test:all - Runs all tests and linters.

  • yarn test - Runs Jest for frontend unit tests.

  • yarn lint - Runs all linters.

  • yarn lint:js - Runs only JavaScript linter.

  • yarn lint:sass - Runs only SASS linter.

Contributing

We welcome contributions to this project. To contribute, first review the Contributing doc

Additional supporting documents include:

Customization

Soapbox supports customization of the user interface, to allow per instance branding and other features. Current customization features include:

  • Instance name
  • Site logo
  • Favicon
  • About page
  • Terms of Service page
  • Privacy Policy page
  • Copyright Policy (DMCA) page
  • Promo panel list items, e.g. blog site link
  • Soapbox extensions, e.g. Patron module
  • Default settings, e.g. default theme

Customization details can be found in the Customization doc

License & Credits

Soapbox FE is based on Gab Social's frontend which is in turn based on Mastodon's frontend.

Soapbox FE is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Soapbox FE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Soapbox FE. If not, see https://www.gnu.org/licenses/.