Server - Contents

ExpressJS - Extras

revised: 22-Dec-2021

Prerequisites: Basic Server (Debian 10.3 64bit) with Webmin, FTP, Firewall, Fail2Ban and iRedmail: a server linked with a domain name (eg. example.com) and familarity with creating and deploying a basic Javascript and HTML.
Secondly, one has succeeded to set up the 'slack' app in the previous related pages.

Ex1: ExpressJS Passport-Local Sqlite3

Enchancing the earlier 'stack' app with 'stackpassport'(.zip) with an ability for a web-master to register users under the username 'admin' (default password: 'a123s'). The entries are placed in a Sqlite3 database - a possible example where other databases (MySQL, Postgres etc.) could also be used. To get started, one is recommended to setup the app on both on the PC and on the Debian server and has gone through the README file. Remember to have sqlite3 functioning in both environments. The primary commands are as follows in a new directory called 'stackpassport':

Thereafter one would upload ad unzip 'stackpassport.zip' in the 'js' directory such that files therein are added to the directory 'stackpassport'.

sammy@imega:/js/stackpassport$ npm install // for the dependencies
sammy@imega:/js/stackpassport$ npm run dev // will have the app active at http://localhost:5000

Re-establish then the 'admin' password and establish correct email settings for the contact page. To have Nginx serve the website, put in the app's config.env file the entry: PORT=8080 and start PM2 on 'app.js'' to serve the backend.

Ex2: ExpressJS Passport-POP3

Prerequisites: as above.

This attractive setup enables an iRedmail-based server providing a small office with its domain-based email accounts to use the same accounts (together with their passwords) to acces private pages on its website, eliminating the need to have another set of users and passwords. This is done with Passport-POP3

Following the same steps above but upload instead this app setup 'stk_pop3'(.zip)

Express Express-PartB
Express-Deploy Express-Extras