Any messages posted to Argora.xyz will directly get posted to your Twitter account!
This application is comprised of an Express backend with a React frontend.
First, get all dependencies. In the root of the project run cd express && yarn && cd ../react && yarn && cd ..
Second, make a copy of the .env-example
file and name it .env
cp .env-example .env
. You will need to populate the different variables. Comments are given in the file to guide you through. You will need to apply to a Twitter Developer Account to create this bridge.
To run in development, you will have to
-
Add all environment variables
-
Run the react development server
cd react && yarn start
(it will run on port 8080). -
Ngrok to that port
ngrok http 8080 -host-header="localhost:8080"
. Take the Ngrok https endpoint and add it toFRONTEND_URL
environment variable. -
Run the backend server
cd express && yarn start
, it will run the server on port 3000. -
On the Twitter developer page, go to your Project > Authentication Settings > Edit. Under
Callback URL
andWebsite URL
add the Ngrok URL. -
Head over to the Ngrok URL and the frontend will show up.
To deploy to production, make sure that at some point in the deployment, you run cd react && yarn build
to get a built out optimized frontend code. The express server will then fetch the react code from the build server and send it to the requester.
An example of a heroku build process can be seen in the main package.json
in the folder root.
Don't forget to change the Twitter Developer Project Callback and Website URL with the one of your bridge!