"Bruderschaft Weight Loss" is the Progressive Web Application (PWA) to monitor weight changes in a group with a friends.
- Pilot version: https://bwl.pilot.teqfw.com/ - reset automatically on every commit to
main
; - Live version: https://bwl.wiredgeese.com/ - updated manually, you need invitation to sign up (there is no username-password sign-in in the app, one-time link is sent to user email for sign-in).
$ git clone [email protected]:flancer32/pwa_bwl.git
$ cd pwa_bwl
$ bash ./bin/deploy/dev.sh
Look up for dependencies sources in ./own_modules/
.
$ cd ./cfg
$ cp init.json local.json
$ nano local.json
...
Use mysql2
or pg
client to connect to RDBMS:
{
"db": {
"main": {
"client": "mysql2|pg",
"connection": {
"host": "127.0.0.1",
"user": "...",
"password": "...",
"database": "..."
}
}
}
}
NodeJS http2
server will use server.port
and web.urlBase
for the work:
{
"server": {
"port": 3000
},
"web": {
"urlBase": "project.com"
}
}
I use Apache Web server to secure HTTP requests/responses with TLS and redirect it to/from NodeJS http2
server:
<VirtualHost *:80>
ServerName project.com
LogLevel warn
ErrorLog /var/log/apache2/bwl_error.log
CustomLog /var/log/apache2/bwl_access.log combined
# Redirect all to HTTPS
RewriteEngine on
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName project.com
LogLevel warn
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
SSLCertificateFile /etc/letsencrypt/live/project.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/project.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
# Redirect all requests to HTTP2 server.
RewriteEngine on
RewriteRule "^/(.*)$" "h2c://localhost:3000/$1" [P]
</VirtualHost>
Use letsencrypt.org to issue TLS certificate for free (you need real domain name like bwl.your-domain.com
). This is simple config for your Apache for this case:
<VirtualHost *:80>
ServerName bwl.your-domain.com
LogLevel warn
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
DocumentRoot /var/www/html
<Directory /var/www/html/>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
All data will be lost:
$ npm run db-reset
Data will be backed up before and restored after:
$ npm run db-upgrade
$ npm run start
$ npm run stop
$ node ./bin/tequila.mjs --help