RetroShare/libresapi/src/webui
2015-11-08 00:08:03 +01:00
..
green-black.css Webui: added links on file names 2015-11-07 02:42:18 +01:00
gui.jsx Webui: Added video support into MediaPlayerWidget 2015-11-08 00:08:03 +01:00
index.html attempt to fix the webui not loading problem 2015-06-04 17:42:06 +00:00
Makefile webui: restored Makefile 2015-10-13 20:27:53 +02:00
package.json webui: 2015-04-29 11:57:56 +00:00
PeersTest.js webui: 2015-04-06 09:44:10 +00:00
README.md fixed path in webui readme 2015-05-11 18:24:13 +00:00
RsApi.js added html/css/js files for the webinterface 2015-03-30 14:40:20 +00:00
RsNodeHttpConnection.js added html/css/js files for the webinterface 2015-03-30 14:40:20 +00:00
RsXHRConnection.js webui: show a warning if JavaScript is disabled, show a warning when not connected to the server 2015-05-16 12:22:06 +00:00
Types.js added html/css/js files for the webinterface 2015-03-30 14:40:20 +00:00

A new approach to build a webinterface for RS

  1. get JSON encoded data from the backend, data contains a state token
  2. render data with react.js
  3. ask the backend if the state token from step 1 expired. If yes, then start again with step 1.

Steps 1. and 3. are common for most things, only Step 2. differs. This allows to re-use code for steps 1. and 3.

BUILD / INSTALLATION

- run (requires wget, use MinGW shell on Windows)
	make
- all output files are now in libresapi/src/webfiles
- use the --webinterface 9090 command line parameter to enable webui in retroshare-nogui
- set the --docroot parameter of retroshare-nogui to point to the "libresapi/src/webfiles" directory
	(or symlink from /usr/share/RetroShare06/webui on Linux, ./webui on Windows)
- retroshare-gui does not have a --docroot parameter. Use symlinks then.

DEVELOPMENT

- Ubuntu: install nodejs package
	sudo apt-get install nodejs
- Windows: download and install nodejs from http://nodejs.org
- Download development tools with the nodejs package manager (short npm)
	npm install
- run Retroshare with webinterface on port 9090
- during development, run this command (use MinGW shell on Windows)
	while true; do make ../webfiles/livereload --silent; sleep 1; done
- the command will copy the source files to libresapi/src/webfiles if they change
- it will trigger livereload at http://localhost:9090/api/v2/livereload/trigger

API DOCUMENTATION

- run
	node PeersTest.js
- this will print the expected schema of the api output, and it will try to test it with real data
- run retroshare-nogui with webinterface enabled on port 9090, to test if the real output of the api matches the expected schema

CONTRIBUTE

- if you are a web developer or want to become one
	get in contact!
- lots of work to do, i need you!