Introduction Goal Install
Welcome
Thank you for using our website!
This is the official documentation and will help you on your way to install, update, modify, configure any part of your website. We constantly update this documentation with the intent of making the processes you need help with, easier.
Introduction
Goal
How to edit, configure and deploy website on your dedicated server or on cloud.
Install
Installing and configuring packages or modules will take somewhere between 5-15 minutes.
You can setup the packages on your local machine and use "localhost" as the domain where it is needed or host the packages on a server and use your own domain.
Packages
Apache with Database
1. Download Xampp and click the downloaded file to Install
The following warnings may appear in some cases when installing: (click "yes" and "ok")


In the installing process you only need the following components selected and only click next:
2. Open Xampp and access php.ini
2.1. In php.ini, under "Paths and Directories" look for extension_dir= and uncomment it (remove ";" before it; in some cases it already is uncommented)
2.2. On the apache module click on Config, then php(php.ini) under "Dynamic Extensions" add the following:
This snippet is for example purposes. Changes may have to be made.
Copy
extension=php_openssl.dll
extension=php_mbstring.dll
extension=php_mysqli.dll
2.3. Save changes to php.ini before closing the file.
3. Download the package here
4. Open the folder where you installed XAMPP, go to htdocs/ and unzip your downloaded package file (from step 1)
Skip the Ubuntu steps bellow
Apache Ubuntu configuration
1. Download the package here
2. In php.ini, under "Dynamic Extensions" add the following: (along with the other extensions)
      extension=php_openssl.so
      extension=php_mbstring.so
      extension=php_mysqli.so
3. Restart Apache server
4. Unzip content to a new folder (Ex: "mywebsite")
5. Visit your website on portalfin.com
6. Export the website you created by clicking "Download website data for installed package" then add the files to "www/website" in the package file.
7. Access your domain.com in browser
Database Configuration
1. In XAMPP click start on Apache module and MySQL module
2. In browser access localhost/phpmyadmin (if it's hosted on a server, access your database website)
3. Create new database (click on new above information schema) and name it however you want Ex: "mydatabase" and click “Create�?
4. In your unzipped folder ("mywebsite" folder) go to \www\config\ and edit "your_config" with your specific information
Notice: Pay attention to the path you use at DOC_ROOT so that you use only slashes (" / ")
This snippet is for example purposes. Changes may have to be made.
Copy
{
"DOC_ROOT":"<"C:/xampp/htdocs/mywebsite/www">",
"BASE_REF":"localhost/mywebsite/www/",
"APP_NAME":"My App",
"MYSQL_HOSTNAME":"localhost",
"MYSQL_PORT":"3306" ,
"MYSQL_USER":"root",
"MYSQL_PASS":"",
"MYSQL_DATABASE":"mydatabase",
"BASENAME":"localhost"
}
Click here for config explanations
"DOC_ROOT":"C:/xampp/htdocs/mywebsite/www",
From this path, the website files are loaded. The location is in the root folder where you installed xampp (you can quick access the xampp files by clicking Explore ), in htdocs. After you unzip the downloaded package into htdocs, copy the full path from mywebsite folder, /www and paste it into DOC_ROOT.
"BASE_REF":"localhost/mywebsite/www/",
The BASE_REF is the url where your website is visible. Installing with XAMPP, the BASE_REF should be "localhost/mywebsite/www/"
"APP_NAME":"My App",
This is the name of your app/website, it can be whatever you want.
"MYSQL_HOSTNAME":"localhost",
The ip or address where the database server is hosted. In case you are hosting it on your local machine, it is either 127.0.0.1 or localhost
For more in-depth steps on how to access, configure and start the xampp database go to this link
"MYSQL_PORT":"3306" ,
Your database port that is usually found in the app you are using to host the database
"MYSQL_USER":"root"
This is the username of your database and by default all apps use root but it can be changed to whatever you want.
Follow this link to change it.
"MYSQL_PASS":"password"
This is the password of your database and by default it might me empty or "user", "admin".
Follow this link to change it.
"MYSQL_DATABASE":"mydatabase",
This is the database that your website is using. Add the exact name of it, where are the tables that you need or where you want the tables installed
"BASENAME":"localhost"
The BASENAME is the domain of your website or "localhost" if installed with XAMPP or any other apache distribution.
("mywebsite" is the name of you website folder)
5. In your browser access localhost/mywebsite/www/initial_db_install.php to initialize and add the data to your database.
If it's hosted on your server access mywebsite.com/mywebsite/www/initial_db_install.php
6. OPTIONAL - If you need to update the database with your products/restaurant, add to the /mywebsite/www/ path the csv file of your products and run in browser http://mywebsite.com/mywebsite/www/update_database.php ( or localhost/mywebsite/www/update_database.php )
7. Access in browser localhost/mywebsite/www/ ( or http:/mywebsite.com/mywebsite/www/ )
OPTIONAL: Personal Website
1. To add your website visit your website on portalfin.com (the default website is generated initially)
2. Export the website you created by clicking "Download website data for installed package" then add the files to "www/website" in the package file.
Apache without Database
1. Install Xampp and open it
2. On the apache module click config and open php(php.ini).
3. In php.ini, under "Dynamic Extensions" add the following: (along with the other extensions)
This snippet is for example purposes. Changes may have to be made.
Copy
      extension=php_openssl.dll
      extension=php_mbstring.dll
4. Download the package here
5. Open the folder where you installed xampp, go to htdocs/ and paste your package files into a new folder (Ex: "mywebsite")
6. In "mywebsite" folder go to \www\config\ edit your_config and add the following (if not existent) and save the file
This snippet is for example purposes. Changes may have to be made.
Copy
{
"DOC_ROOT":"<"C:/xampp/htdocs/mywebsite/www">",
"BASE_REF":"localhost/mywebsite/www/",
"APP_NAME":"My App",
"BASENAME":"localhost"
}
Click here for config explanations
"DOC_ROOT":"C:/xampp/htdocs/mywebsite/www",
From this path, the website files are loaded. The location is in the root folder where you installed xampp (you can quick access the xampp files by clicking Explore ), in htdocs. After you unzip the downloaded package into htdocs, copy the full path from mywebsite folder, /www and paste it into DOC_ROOT.
"BASE_REF":"localhost/mywebsite/www/",
The BASE_REF is the url where your website is visible. Installing with XAMPP, the BASE_REF should be "localhost/mywebsite/www/"
"APP_NAME":"My App",
This is the name of your app/website, it can be whatever you want.
"BASENAME":"localhost"
The BASENAME is the domain of your website or "localhost" if installed with XAMPP or any other apache distribution.
7. In XAMPP click Start on the apache module
8. Access your in browser localhost/mywebsite/www/ ( or http:/mywebsite.com/mywebsite/www/ )
9. To add your website visit your website on portalfin.com (the default website is generated initially)
10. Export the website you created by clicking "Download website data for installed package" then add the files to "www/website" in the package file.
Apache Ubuntu configuration
1. Download the package here
2. In php.ini, under "Dynamic Extensions" add the following: (along with the other extensions)
      extension=php_openssl.so
      extension=php_mbstring.so
3. Restart Apache server
4. Unzip content to a new folder (Ex: "mywebsite")
5. In "mywebsite" folder go to \www\config\ edit your_config and add the following (if not existent)
This snippet is for example purposes. Changes may have to be made.
Copy
{
"DOC_ROOT":"<"C:/xampp/htdocs/mywebsite/www">",
"BASE_REF":"localhost/mywebsite/www/",
"APP_NAME":"My App",
"BASENAME":"localhost"
}
6. Download your exported website and unpack in www/website folder
7. Access your domain.com in browser
Edit, configure and deploy Website in Node Environment with Database
1. Download the package here in a folder like C:\mywebsite
2. Go to the folder where package is downloaded C:\mywebsite
3. Unzip the downloaded file : C:\mywebsite\unzipWebsite
4. Download and install Node.js
5. Open the terminal (type cmd in windows search)
6. Click on Command Prompt (App) that is on the top and then type
      cd C:\mywebsite\unzipWebsite
7. Type: npm install
8. Download php for windows from link in folder C:\mywebsite
9. Click on downloaded php for window v7.4 (remember the path)
10. In the php folder you installed, rename php.ini-development to php.ini
11. In php.ini, under "Dynamic Extensions" add the following:
This snippet is for example purposes. Changes may have to be made.
Copy
      extension=php_openssl.dll
      extension=php_mbstring.dll
      extension=php_mysqli.dll
12. In php.ini, under "Paths and Directories" uncomment extension_dir = "ext" (delete “;�? to uncomment , in some cases it already is uncommented)
13. Download Mysql installer community (first one)
14. Open Mysql installer and add MySQL Server and MySQL Workbench (look for the latest version for each)
15. Configure the MySQL Server with your settings
16. Open MySQL Workbench and access the server you created
17. In the top menu, Create a new schema in the connected server
18. Name your database, click apply then finish.
19. In the folder you cloned the repository \www\config\ edit your_config.json:
This snippet is for example purposes. Changes may have to be made.
Copy
{
"DOC_ROOT":"<"C:/mywebsite/www">",
"BASE_REF":"localhost",
"MYSQL_HOSTNAME":"localhost",
"MYSQL_PORT":"3306",
"MYSQL_USER":"root",
"MYSQL_PASS":"password you set for your server",
"MYSQL_DATABASE":"mydatabase",
"APP_NAME": "My App"
}
Click here for config explanations
"DOC_ROOT":"C:/mywebsite/www",
From this path, the website files are loaded. The location is in the root folder where you unzipped your package. Copy the full path from mywebsite folder, /www and paste it into DOC_ROOT.
"BASE_REF":"localhost/mywebsite/www/",
The BASE_REF is the url where your website is visible.
"APP_NAME":"My App",
This is the name of your app/website, it can be whatever you want.
"MYSQL_HOSTNAME":"localhost",
The ip or address where the database server is hosted. In case you are hosting it on your local machine, it is either 127.0.0.1 or localhost
For more info on how to check your hostname check this link
"MYSQL_PORT":"3306" ,
Your database port that is usually found in the app you are using to host the database
"MYSQL_USER":"root"
This is the username of your database and by default all apps use root but it can be changed to whatever you want.
"MYSQL_PASS":"password"
If you configured your database using MYSQL Workbench then you set your own passoword
Follow this link for more info.
"MYSQL_DATABASE":"mydatabase",
This is the database that your website is using. Add the exact name of it, where are the tables that you need or where you want the tables installed
20. In the folder you cloned the repository \nodejsconfig\ edit config.json (you will need the path to where you installed php)
      Example:
      "php_cgi_folder": "E:/php",
      "php_cgi_php_ini":"E:/php/php.ini"
21. Open the terminal in the local folder of the clone and run "node server"
22. Open your browser on mywebsite.com:9090 (the port may be different to where the server is listening, you can see the port in the terminal after running the "node server" command)
23. In the browser, to your domain, add /initial_db_install to initialize and add the data in the database
24. If you need to update the database with your products/restaurant, run in browser to your domain http://mywebsite.com/update_database.php
25. To add your website visit your website on portalfin.com (the default website is generated initially)
26. Export the website you created by clicking "Download website data for installed package" then add the files to "www/website" in the package file.
Node without Database
Node.js (v7.+) version of the pack is easier to install and controll. Follow the next steps to setup your website:
1. Download the package here and unzip.
2. Install Node.js
3. Open the terminal (search cmd in windows search)
4. Install node dependencies in the local folder where you cloned the repository (npm install)
      In the cmd go to the folder you unzipped: cd C:/mywebsite
      Type: npm install
5. Install php for windows ( https://windows.php.net/download/ ) v7.4 (remember the path)
6. In the php folder you installed, rename php.ini-development to php.ini
7. In php.ini, under "Dynamic Extensions" add the following:
This snippet is for example purposes. Changes may have to be made.
Copy
      extension=php_openssl.dll
      extension=php_mbstring.dll
8. In php.ini, under "Paths and Directories" uncomment extension_dir = "ext" (in some cases it already is uncommented)
9. In the folder you cloned the repository \www\config\ edit your_config.json:
This snippet is for example purposes. Changes may have to be made.
Copy
{
"DOC_ROOT":"<"C:/mywebsite/www">",
"BASE_REF":"localhost",
"APP_NAME": "My App"
}
Click here for config explanations
"DOC_ROOT":"C:/mywebsite/www",
From this path, the website files are loaded. The location is in the root folder where you unzipped your package. Copy the full path from mywebsite folder, /www and paste it into DOC_ROOT.
"BASE_REF":"localhost/mywebsite/www/",
The BASE_REF is the url where your website is visible.
"APP_NAME":"My App",
This is the name of your app/website, it can be whatever you want.
10. In the folder you cloned the repository \nodejsconfig\ edit config.json (you will need the path to where you installed php)
      Example:
      "php_cgi_folder": "E:/php",
      "php_cgi_php_ini":"E:/php/php.ini"
11. Open the terminal in the local folder of the clone and run "node server"
12. Open your browser on mywebsite.com:9090 (the port may be different to where the server is listening, you can see the port in the terminal after running the "node server" command)
13. To add your website visit your website on portalfin.com (the default website is generated initially)
14. Export the website you created by clicking "Download website data for installed package" then add the files to "www/website" in the package file.
Modules
Download modules from your website to make insight changes like improving or adding functions that you need to behave differently. Some modules have dependencies some are standalone, but it's all up to your website to see what you need.
Cart
Dependencies: LoginDB; can use SendMail
** if you don't need this SendMail package or have other requirements, you can use any other php package that can be loaded by autoloader, and can be accessed by $package["SendMail"]; your package needs to use the parameters shown in SendMail code example (subject, email, email_to, sent_from, message); and have "init" and "send" methods available;
Supports PayPal and Stripe payments;
This snippet is for example purposes. Changes may have to be made.
Copy
Package comes with config file that should contain your vendor authentication credentials:
[{
"system":"paypal",
"mode":"sandbox/live",
"username":"yourname-facilitator_api1.domain.ro",
"password":"2****V****H****4",
"signature":"A****B****D****S****g****p****1****J****j****P****G****M",
"currency_code":""
},
{
"system":"stripe",
"mode":"sandbox/live",
"username":"",
"password":"sk_****_Y****8****6****R****owr5",
"signature":"pk_****_T****S****A****I****gKDx"
}]
Mail Sender
Uses sendmail package (there is a sendmail package for windows inside pack)
How to use in your php code:
This snippet is for example purposes. Changes may have to be made.
Copy
if (isset($package["SendMail"])) {
$mdata = array();
$mdata["subject"] = APP_NAME ." - First Mail";
$mdata["email"] = ;
$mdata["email_to"] = ;
$mdata["sent_from"] = "The ". APP_NAME . " mailing system";
$mdata["message"] = "Visit the link: Take a look " . "If you encounter problems accessing the hyperlink, please try to copy and paste the following link into the browser address bar ". urldecode(HTTP_HOST);
$package["SendMail"]->init();
$mresp = $package["SendMail"]->send($mdata);
return "Account verification message was sent again to your email.";
}
Login
Package used to log in end-user, and keep track of unlogged user
Create your module
Modules defined in Packages folder are automatically loaded at runtime from config/clientConf.php, if they meet certain specifications:
      - the string used as main package class name should be the same as the package folder name and the php file where it is defined(case sensitive);
      - each package has access to database connection and website data defined in /website/website_data.json: $package = load_packs($db, $wdata);
      - the autoloader will load classes defined in their own folder with specific names:
            ex: MyModule class will be loaded on runtime if there is a MyModule.php is inside packages/MyModule folders, and is accessible;
This snippet is for example purposes. Changes may have to be made.
Copy
** inside MyModule.php
/* ----- define namespace ----*/
namespace packages\MyModule;
/* ----- use uther packages like SendMail ----*/
use \packages\SendMail;
class MyModule {
private $conn;
private $wid;
public function __construct($mysqlObject, $wdata) {
$this->conn = $mysqlObject->getconninfo(); // you can use the existing created connection to database
$this->wid = $wdata["wId_idd"]; // you have access to the internal website_id
}
public function after_load() { // gets called after module classes initialization; it can be executed if you need code executed after initialization; is not mandatory;
if(isset($_GET["some_parameter"])) {
$protocol = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
header("Location: " . ($protocol . $_SERVER["HTTP_HOST"] . "/"));
die();
};
}
public static function getInstance() { // use it like MyModule::getInstance(); or gain access to class by calling $package["MyModule"]; $package is global; inside functions do: global $package;
if (self::$instance == null) {
self::$instance = new Singleton();
}
return self::$instance;
}
/* ----------- define your other methods -----/*
}
If you only want to run a js file into your website:
     1. you can add your js file into js/ folder
     2. edit /helpers/templates/header_webgen.tpl and add <script type="text/javascript" src="js/<"your_js_file">.js"></script>


If you want to exchange data between the web site and server:

     - create a new folder, packages/MyRoute; have a public folder with js and/or css files

     - If you want access to existing database connection, we recommend using step 1 (autoloading modules);

     - edit /helpers/templates/header_webgen.tpl and add <script type="text/javascript" src="js/<"your_js_file">.js"></script>
This snippet is for example purposes. Changes may have to be made.
This snippet is for example purposes. Changes may have to be made.
Copy

- into packages/MyRoute folder have a php that will respond to your client request;

ex: MyRouteServer.php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
define("DEF_BASE", "../..");
define("CLIENT_SIDE", 2);
define("PREV_SIDE", 1);
require_once(DEF_BASE . "/config/clientConf.php");
if (isset($_GET["the_first_request"])) {
//
echo "OK";
}
?>

- the client will send requests to yourdomain.com/JQpackdb/packages/MyRoute/MyRouteServer.php
Add your JS to your website
1. write a function into your js that is going to be called when you upload it
Example:
function myWidget(elem, options) {
     elem.append("23123");
     elem.css("background-color","blue");
     elem.css("color","white");
}
**elem - the row or column in which the widget is going to be placed
**options - options of the website that you may need and use for your widget
2. add your widget.js to your server so it can be accessed through an URL
     Example: http://mywebsite.com/plugins/widget2/widget2.js
     OR
2.1 add your widget.js along with a new file metadata.json in a .zip file
      - metadata.json should have the data like this: (be sure that the "start" and js function have the exact same name)
This snippet is for example purposes. Changes may have to be made.
Copy
{"name":"name your widget", "initjs":"widget.js", "start":"myWidget"}
3. On your portalfin website go to "Content" in the menu above
4. Hover over "Your Widgets" in the dialog
5. Click on "Add New Widget"
**If you uploaded your js file on a remote server follow these steps:
          6. Choose a name for your widget
          7. In "Your javascript file location" add the link to your widget from step 2
          8. In the last input add the name of the function in your js (on step 1, the function name is "myWidget")
**If you made a .zip file follow these steps:
          6. Click "Upload" and select the .zip file from your computer
9. Click save and your widget will be shown under "Your Widgets" In the Content dialog (from step 3)
FAQ
What Package should I Download
Node or Apache
This is really a personal choice, but we recomment Apache Xampp for starters because it is easier and faster to setup and Node for advanced users/programmers.
With Databse or Without
If your website contains widgets from the following list then you should use a package without databse.
No database Widgets:
- Any text/title/divider/link based widget
- Calculator
- Images/Sliders
- Carousel
- Videos
- Events
- Icons
- Book
- Datagrids
- Business Hours
- Map (for map you will need to add a google key into the \www\config\k file to work properly)
- Calendar
- RSS

If your website contains widgets from the following list then you should use a package with databse.
Database Widgets:
- Product Store
- Restaurant
- Property Store
- Forms
How do i set up the Map widget
If you don't have the map widget on your website, but want to add it
1. Make sure you have added the map widget to your website on portalfin.com
2. Download your website files.
3. Update your website files on your local machine in xampp\htdocs\mywebsite\www\website.
Make the map work on your website
1. Activate your server and access your website.
2. The following status of the map widget should appear:
3. To get yourself a google maps api key you must follow the steps from this link
4. The key you just requested above must be added into the k.json file located in \xampp\htdocs\mywebsite\www\config
5. You will have to enable billing on the google development platform to make the map work and you're set.
How do I update the website files
1. Request a download link for your website from portalfin.com and check your email.
2. Open the zip from the download link.
3. Open your local website folder in xampp to the folder in the picture bellow.
4. Copy the files from the zip and paste them into the local website folder you opened at step 3.
5. Replace all the files that pop up.
Which are the compatible widgets
We constantly update the documentation with the newest working widgets that you can use on your exported website.
Check the following list with all the currently working widgets:
No database Widgets:
- Any text/title/divider/link based widget
- Calculator
- Images/Sliders
- Carousel
- Videos
- Events
- Icons
- Book
- Datagrids
- Business Hours
- Map (for map you will need to add a google key into the \www\config\k file to work properly)
- Calendar
- RSS
Database Widgets:
- Product Store
- Restaurant
- Property Store
- Forms