Websocket clock server web interface written in ReactJS/TypeScript
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Yann Weber ee7461d50d README.md update il y a 2 ans
public Initial commit il y a 2 ans
src Initial commit il y a 2 ans
.gitignore Initial commit il y a 2 ans
README.md README.md update il y a 2 ans
config.json Initial commit il y a 2 ans
package.json Initial commit il y a 2 ans
tsconfig.json Initial commit il y a 2 ans

README.md

Clock websocket React/TS UI

Web interface for websocket clock server writter in typescript/react.

Display a clock with possibility of changing timezone and adding alarms producing notifications using the JS Notifications API.

Example deployment here.

TODO

Replace the timezone update text input by two HTML selects, allowing to choose a continent and a city from selected continent. To implement this feature, the websocket server should implement a command returning a list of all available timezones.

Add some tests, using jest ?

Deployment

Configure & build

Install dependencies npm install

Change the WS_URL value according to server deployment configuration. edit src/config.json

Create an optimized production build npm run build

Copy ./build to webserver’s (/var/www/clock).

Nginx webserver configuration

Install nginx apt install nginx

Create server configuration

rm /etc/nginx/site-enabled/default
edit /etc/nginx/sites-available/clock
ln -s /etc/nginx/sites-available/clock /etc/nginx/sites-enabled/

Example server config :

server {
	listen 80 default_server;
	listen [::]:80 default_server;

	root /var/www/clock/;

	index index.html;

	server_name _;

	location / {
		try_files $uri $uri/ =404;
	}
}

Start a development server

npm run start