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 # jitsi-rooms
## Development
`stack build`
`stack stack run`

View File

@ -6,19 +6,20 @@ import Network.Wai
import Network.Wai.Handler.Warp (run) import Network.Wai.Handler.Warp (run)
import WebSocket (ServerState, broadcast) 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 :: MVar ServerState -> Application
app state _ respond = do app state req respond = do
putStrLn "I've done some IO here" putStrLn "I've done some IO here"
currentState <- takeMVar state withMVar state $ \currenState -> broadcast "body of req" currenState
broadcast "dsa" currentState
putMVar state currentState
respond $ respond $
responseLBS responseLBS
status200 status200
[("Content-Type", "text/plain")] [("Content-Type", "text/plain")]
"Hello, Web!" ""
runWebServer :: MVar ServerState -> IO () runWebServer :: MVar ServerState -> IO ()
runWebServer state = do runWebServer state = do
putStrLn $ "http://localhost:8080/" putStrLn "http://localhost:8080/"
run 8080 $ app state run 8080 $ app state