Main readme

This commit is contained in:
qvalentin 2023-01-22 13:05:50 +01:00
parent ac93ae02e0
commit cdfc0849cf
3 changed files with 34 additions and 6 deletions

22
Readme.md Normal file
View File

@ -0,0 +1,22 @@
# Jitsi Rooms
Provides a small wrapper UI around Jitsi Meet with discord like rooms functionality.
## Architecture
The application consists of:
- a plugin for the Jitsi Meet component prosody that pushes event data to a rest endpoint
- written in Lua
- location: ./prosody
- also provides a Jitsi Meet setup with docker
- a backend that accepts the events with an rest endpoint and distributes it to the clients via websockets
- written in Haskell
- location: ./backend
- a frontend that uses the Jitsi Meet iFrame Api and connects to the backend via websockets
- written in Typescript with react and vite
- location: ./frontend
## Development
Each subfolder contains a Readme with instructions

View File

@ -1 +1,6 @@
# jitsi-rooms
## Development
`stack build`
`stack stack run`

View File

@ -6,19 +6,20 @@ import Network.Wai
import Network.Wai.Handler.Warp (run)
import WebSocket (ServerState, broadcast)
-- todo: use ReaderT instead of curring the state
-- then add a MVar for storing the room Data, including users that are not in any room yet
app :: MVar ServerState -> Application
app state _ respond = do
app state req respond = do
putStrLn "I've done some IO here"
currentState <- takeMVar state
broadcast "dsa" currentState
putMVar state currentState
withMVar state $ \currenState -> broadcast "body of req" currenState
respond $
responseLBS
status200
[("Content-Type", "text/plain")]
"Hello, Web!"
""
runWebServer :: MVar ServerState -> IO ()
runWebServer state = do
putStrLn $ "http://localhost:8080/"
putStrLn "http://localhost:8080/"
run 8080 $ app state