Skip to content

MemeLabs strims development

slugalisk edited this page Jul 18, 2020 · 10 revisions

Getting started

Setting up development environments for MemeLabs' projects

Requirements

Setup

Projects

Rustla2

https://github.com/MemeLabs/Rustla2

git clone https://github.com/MemeLabs/Rustla2.git
cd Rustla2/
cp .env.example .env
# if on macos, read this block https://github.com/MemeLabs/Rustla2#setup 
sed -i "s/JWT_SECRET=/JWT_SECRET=$(head -c 22 /dev/urandom | base64 | tr -dc A-Za-z0-9)/" .env

For UI development only:

Update API_WS in the .env config with the production WebSocket API URL.

API_WS=wss://strims.gg/ws

Install the dependencies and start the webpack dev server

npm ci
npm run dev-server

You can access the dev server from your browser at http://localhost:3000.

For server development:

Follow these steps to set up a Twitch API client, ensuring to update the .env config. In the .env config file, comment out SSL_CERT_PATH and SSL_KEY_PATH and change PORT to 3001

pushd api/; git submodule update --init; popd

# should be standing in the root of the project
# this will create a development container, allowing for easy building
docker run \
  --name strims-api-dev \
  -v $(pwd):/Rustla2:rw \
  --workdir /Rustla2 \
  --net host \
  -it \
  --entrypoint /bin/bash \
  docker.pkg.github.com/memelabs/rustla2/rustla2-api:thirdPartyBase

# once inside container
cd /Rustla2/api
# to build and run the server
cmake . && make -j $(nproc --all)
./rustla2_api --alsologtostderr
# to run tests
cmake . && make test

After first run, the Sqlite DB will be created, then follow these steps for creating a new user.

chat-gui

https://github.com/MemeLabs/chat-gui

For a live chat (connected to a chat server)

git clone https://github.com/MemeLabs/chat-gui.git
cd chat-gui/
cp .env.example .env

The .env config file should look like this (depending on setup)

API_URI=http://localhost:8282
LOGIN_URI=http://localhost:3001/login
WEBSOCKET_URI=ws://localhost:8282/ws
WEBPACK_DEVSERVER_HOST=0.0.0.0
WEBPACK_DEVSERVER_HTTPS=false

Building and running is done like this:

# For development
npm run build

# Start webpack server at http://localhost:8282/
npm run start

For a mock chat with fake messages

https://github.com/MemeLabs/chat-gui/tree/master/assets/dev

For browser-only emote testing

https://poubelle.xyz/emotemaker

chat

https://github.com/MemeLabs/chat

https://github.com/MemeLabs/chat.git
cd chat/

Create a settings.cfg with the following contents (changing the values jwtsecret to the generated one):

[default]
listenaddress = :9998
maxthrottletime = 300000000000
dbfile = chatbackend.sqlite
jwtcookiename = jwt
jwtsecret = {your jwt secret}
apiuserid = 11111111-1111-1111-1111-111111111111
messagecachesize = 250
usernameapi = http://localhost:3001/api/username/
viewerstateapi = http://localhost:3001/api/admin/viewer-states
debug = true
maxprocesses = 0
chatdelay = 300000000
# run the server 
go run .
# execute unit tests
go test .

modbot

https://github.com/MemeLabs/modbot

tsgg

https://github.com/MemeLabs/tsgg

android

https://github.com/MemeLabs/strims-android

Clone this wiki locally