be360:ocme:frontend

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
be360:ocme:frontend [2026/07/30 10:17] luca.bottolibe360:ocme:frontend [2026/07/30 10:51] (current) luca.bottoli
Line 5: Line 5:
 Dedicated: WhatsappTemplates (ID: i-072df39da22f6bd3d)\\ Dedicated: WhatsappTemplates (ID: i-072df39da22f6bd3d)\\
 Directories: ''/var/www/ocme''\\ Directories: ''/var/www/ocme''\\
-OS: ***LORENZO***\\+OS: ***TO DO***\\
 SSH login: admin@52.28.158.203\\ SSH login: admin@52.28.158.203\\
 Hours of operation: 24/7 Hours of operation: 24/7
Line 60: Line 60:
  
 ---- ----
-=== app.js === +=== dist === 
-Application codeIt create the endpoint "/webhook/image".\\ +Folder that contains the build of the project. 
-Sample request:+To run the build enter ''/var/www/ocme'' and run 
 <code> <code>
-POST https://wabfimmdemo.ccaas.becloudsolutions.com/webhook/image +yarn build 
-+cp -r /var/www/ocme/dist//var/www/wa-template.beincontact.becloudsolutions.com
- "phone":"3519970274", +systemctl restart apache2
- "URL":"https://i.4cdn.org/g/1594686838367.png" +
-}+
 </code> </code>
-On request, it add "00" in front of the phonenumber, it [[https://nodejs.org/api/fs.html#fscreatewritestreampath-options|create a WriteSteam]] in the ''/Storage'' folder with name pattern ''phone + "_" + timestamp + ".jpg"'' and then download the image from the link in the stream. 
  
-\\+---- 
 +=== src === 
 +These folders contain the files for building the project's frontend. The web page consists of routes corresponding to each of Ocme's WA accounts (Italian, English, American, etc.), plus a debug page and an unflag page.
  
-=== Storage === +---- 
-Contains images that are gonna to be sent in the FTP connection.+=== Italian, English, American, etc. page == 
 +This page is composed of two sections:  
 +  * On the top left 3 picklists respectively to navigate to the pages of other WA accounts or to the debug page or to the unflag pages 
 +  * Central section for sending WhatsApp templates, featuring: picklist to select the template language, message text, box to enter the recipient's number and send button.
  
-\\+---- 
 +=== Debug page === 
 +The debug page is used to monitor the progress status of WhatsApp templates sent from the various accounts. 
 +Here, too, there are picklists in the top-left corner and a central section. 
 +The table allows searching based on information in any of the columns, includes a "Refresh" button to update the results, and displays the sent WhatsApp templates row by row.
  
-=== uploadFtp.sh === +---- 
-Bash script that upload to Fimm's FTP all images sent in the lat 60 minutes using [[https://www.ncftp.com|ncftp]].\\ +=== Unflag page === 
-It runs with a [[https://en.wikipedia.org/wiki/Cron|cronjob]] every second minute of each hours, in order to discriminate if it needs to upload the images in the ''$yesterdayDate'' folder or in the ''$todayDate'' folder.\\ +The unflag page is used to remove the "custom template" flag from contact records in MongoDB. Like the debug page, it features picklists in the top-left corner and a central table
-It also handle logs creation and clear ''wab.log''.+The table offers the same functionality as the one on the debug page but displays all contacts in MongoDB/BeTracker that have the "template" flag enabledRows can be selected to activate the "Unflag" button; once the user confirms the action, the "template" flag is removed for the selected contacts.
  
-\\ +---- 
- +=== Apache config === 
-=== Certs === +***TO DO***
-Contains certificates to enable https endpoint in ''app.js''.\\ +
-To create: +
-<code> +
-openssl req -nodes -new -x509 -keyout server.key -out server.cert +
-</code> +
- +
-\\ +
- +
-=== wab.log === +
-Pm2 log file. Every hour is cleaned by ''uploadFtp.sh'' and saved in the ''/Logs/Webhook'' folder. +
- +
-\\ +
- +
-=== Logs === +
-Contains hourly logs for both FTP and webhooks interactions. +
- +
-\\ +
- +
-=== node_modules, package.json, package-lock.json === +
-Standard [[https://nodejs.org/|NodeJS]] stuff.\\ +
- +
-\\ +
- +
-=== Nginx config === +
-Located at ''/etc/nginx/sites-available/node.conf'', all endpoints are served in HTTPS.\\ +
-  Port 5000: AQP +
-  Port 5001: ComoAcque +
-  Port 5002: 2iReteGas_Lotto_5 +
-  Port 5003: 2iReteGas_Lotto_6 +
- +
-\\+
  
 +----
 === Active cronjobs === === Active cronjobs ===
-  Automated SSL certs renewal: ''0 0 25 */2 sudo certbot --nginx renew --all --force-renewal'' +***TO DO***
-  Automated [[https://www.gnu.org/software/findutils/manual/html_node/find_html/Invoking-updatedb.html#Invoking-updatedb|updatedb]] command: ''*/30 * * * /usr/bin/updatedb'' +
-  * For each Fimm's customer there is a separated cronjob ''2 * * * * /home/admin/be360fimm-*/uploadFtp.sh'' +
- +
-\\+
  
- --- //[[lorenzo.cesana@becloudsolutions.com|Lorenzo Cesana]] 2024/03/26 09:25//+ --- //[[luca.bottoli@becloudsolutions.com|Luca Bottoli]] 2026/07/30 00:00//
  • be360/ocme/frontend.1785406672.txt.gz
  • Last modified: 2026/07/30 10:17
  • by luca.bottoli