Browse Source

Update ricochet-js

Jeremie Pardou-Piquemal 2 years ago
parent
commit
7684839e90
6 changed files with 231 additions and 113 deletions
  1. 2 2
      .env.dist
  2. 2 1
      .github/workflows/cypress.yml
  3. 15 4
      README.md
  4. 1 1
      backend/.env.dist
  5. 209 103
      backend/package-lock.json
  6. 2 2
      backend/package.json

+ 2 - 2
.env.dist

@@ -1,10 +1,10 @@
 ##### Front ####
 
 # API URL
-VITE_API_ENDPOINT=http://localhost:3001
+VITE_API_ENDPOINT=http://localhost:4050
 
 # Socket configuration
-VITE_SOCKET_URL=http://localhost:3001
+VITE_SOCKET_URL=http://localhost:4051
 VITE_SOCKET_PATH=/socket.io
 
 # Set to 1 to remove Welcome dialog

+ 2 - 1
.github/workflows/cypress.yml

@@ -27,7 +27,8 @@ jobs:
         env:
           VITE_NO_WELCOME: 1
           VITE_CI: 1
-          VITE_SOCKET_URL: https://ricochetjs.herokuapp.com/
+          VITE_SOCKET_URL: https://public.jeremiez.net/
+          VITE_SOCKET_PATH: /wamp/socket.io
           VITE_API_ENDPOINT: https://ricochetjs.herokuapp.com/
           VITE_RICOCHET_SITEID: airboardgame
           ACTIONS_ALLOW_UNSECURE_COMMANDS: true

+ 15 - 4
README.md

@@ -113,7 +113,7 @@ cp site.dist.json site.json
 cp .env.dist .env
 ```
 
-Generate an encrytion key:
+Generate an encryption key:
 
 ```sh
 npx ricochet --generate-key
@@ -143,9 +143,19 @@ code executed by ricochetjs in another terminal:
 npm run watch
 ```
 
+you also need an instance of `wire.io` so in another terminal, execute:
+
+```sh
+# Need npm >= v7
+PORT=4051 npx wire.io
+```
+
+See [wire.io](https://github.com/jrmi/wire.io) documentation for more information
+on how to configure it.
+
 ### Client
 
-in another terminal, go back to project root and execute:
+In another terminal, go back to project root and execute:
 
 ```sh
 cd <project_root>/
@@ -162,8 +172,9 @@ Then you can start the client:
 npm start
 ```
 
-Now you should have three terminals:
+Now you should have four terminals:
 
 * the one with ricochetjs server instance. Backend logs can be found here
 * one terminal with auto build on change for backend files
-* one with React frontend server
+* another with `wire.io` server running
+* and a last one with React frontend server

+ 1 - 1
backend/.env.dist

@@ -3,7 +3,7 @@ RICOCHET_SECRET_KEY=
 
 # --- Ricochet configuration start here
 
-SERVER_PORT=3001
+SERVER_PORT=4050
 SERVER_HOST=localhost
 
 # memory, disk or s3 storage are available

File diff suppressed because it is too large
+ 209 - 103
backend/package-lock.json


+ 2 - 2
backend/package.json

@@ -18,6 +18,7 @@
     "clean-webpack-plugin": "^3.0.0",
     "copy-webpack-plugin": "^7.0.0",
     "dotenv-webpack": "^7.0.2",
+    "ricochet-js": "^0.10.0",
     "transform-loader": "^0.2.4",
     "webpack": "^5.38.1",
     "webpack-cli": "^4.7.0",
@@ -27,7 +28,6 @@
     "btoa": "^1.2.1",
     "dotenv": "^8.2.0",
     "node-fetch": "^2.6.1",
-    "pino-tiny": "^1.0.0",
-    "ricochet-js": "^0.9.1"
+    "pino-tiny": "^1.0.0"
   }
 }

Some files were not shown because too many files changed in this diff