From 3f041a53eb6df9d8f056ebd255bfeea26de5c4b5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 6 Apr 2020 20:30:05 -0500 Subject: [PATCH] Add dev instructions to README --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index 09b22512c..4cfe5573b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,49 @@ This is the frontend for [Soapbox](https://soapbox.pub). It is based on [Gab Social](https://code.gab.com/gab/social/gab-social)'s frontend which is in turn based on [Mastodon](https://github.com/tootsuite/mastodon/)'s frontend. +# 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 +``` + +It will serve at `http://localhost:3036` by default. + +It will proxy requests to the backend for you. +For Pleroma no other changes are required, just start Pleroma and it should begin working. + +## Using with Mastodon + +For Mastodon you will need to edit `webpack/development.js` and change the proxy port to 3000: `const backendUrl = 'http://localhost:3000';` then restart the soapbox-fe dev server. + +Streaming will not work properly without extra effort. + +Due to Mastodon not supporting authentication through the API, you will also need to authenticate manually. +First log in through the Mastodon interface, view the source of the page, and extract your access_token from the markup. +Then open soapbox-fe, open the console, and insert the following code: + +```js +window.localStorage.setItem('soapbox:auth:user', JSON.stringify({access_token: "XXX"})); +``` + +Replace `XXX` with your access token. +Finally, refresh the page, and you should be logged in. + # License soapbox-fe is free software: you can redistribute it and/or modify