Quick Links — ?
TOC: Setup On Your Machine — "How To" — ?
...scanning for headingsAn Introduction
If this is too technical / you are not a developer, feel free to reach out to Imran for support / install over remote control.
Why?
Just like for personal files, we have a "My Documents" folder created, we ask you to create an AmadeusWeb folder for:
- Setups (the installers we are about to download)
- Programs (like FTPSync which just run in-situ)
- xampp (the bundled local server mentioned below)
- "all" for all the websites we will "clone" from "bitbucket"
Why File Based?
Being a "file based" cms / web builder means that we make use of "version control" technology like git / github.com / bitbucket.org to synchronize and backup YOUR website and the "builder" - builder.amadeusweb.com.
For now, just keep these words at the back of your mind until we have created a glossary.
Unified folder structures
Once we have git installed and apache running locally (pointing to the all folder as it's document root), localhost will run the sites in all. This means that
D:\AmadeusWeb\all\amadeus will be served when https://localhost/amadeus/ is visited in the browser. The Code Explorer will show the "local" paths. For eg:
http://localhost/amadeusweb/www/ preview.amadeusweb.com
http://localhost/our-sites/imran/ imran.yieldmore.org
https://wiseowls.life/ wiseowls.life
When logged in to hostdime, those domains / subdomains will be pointed to say "all/our-sites/imran"
Convention over Configuration
By matching the same folder structure on everyone's machine AND the common amadeusweb server - at hostdime.com) - we use the power of "convention" not configuring different folders on different developer machines differently.
On A Laptop / Desktop
As tech evolved, we switched from 32 bit processors to 64. Check your machine and install the appropriate ones from the links provided.
We use several open source software for this, a trial bound BeyondCompare and a site upload tool for windows Imran wrote in 2007.
Main Working Folder
If there is no "D" Drive, you may have to go to Disk Management and Shrink Volume to create a D:\ drive if it doesnt exist, or any drive other than C (which data will get lost in the event of an OS / hardware failure).
Create folder D:\AmadeusWeb\all (for reasons stated above).
Site and Builder Repositories
Git is a system for creating, backing up, and merging changes made to the files of a software application. Since we use files (no database in AmadeusWeb) everywhere - content (md html php txt), assets (jpg, png, pdf), and sheets (tsv) - the "site" code is a separate repository like the ones seen here.
Git is a command line utility, more suited for developers who work in linux. In windows (and mac / linux) we use the graphic interface of "TortoiseGit". With these two, website, code and framework can be managed.
NOTE: These are abstract concepts more easily understod if you "explored" this www "site" on bitbucket - Each website, including the builder and the main amadeusweb.com are "repositories" hosted in bitbucket. History of changes can be seen in "commits" like here. Individual files - like this very one - setup on yur machine can be seen too.
Install **git
Git requires to check-in and check-out line endings as is, so make sure to select this correctly in the Wizard. If you miss this, in git bash, you can run git config -global core.autocrlf "false".
Install tortoisegit**
TortoiseGit First Run Wizard requires a email - give team@yieldmore.org and your name.
Tortoise will have the Clone option in folder right click. Give it the clone path of bitbucket/amadeusweb/amadeus/ into "all" folder which will be the localhost root (setup in Apache in the next step).
Installing a Web Server
Typically we buy hosting "space" - a server running linux, but in AmadeusWeb, for a number of reasons, we develop locally and only push changes via Secure FTP. While a php standalone installed with Chocolatey is possible, this method has now been deprecated.
The local server is Apache.
- Download xampp which is a bundle of Apache (server) and the php programming language.
- Install to D:\AmadeusWeb\xampp\
- Open it's xampp-control.exe as an "administrator" (elevated permissions)
- Click Apache > Config and look for "DocumentRoot" and the "<Directory " line after it and change it from "D:/AmadeusWeb/xampp/htdocs" to "D:/AmadeusWeb/all" - after this a start/restart of Apache will be needed in xampp control panel - then it will start running localhost from the "all" folder.
- Try running apache (it should show in green if ports 80 / 433 are available and its able to start running)
- Tick the checkbox at the beginning of the Apache row to install as a service. If a service, it will run automatically on each boot, else you will have to run xampp-control everytime and hit run.
Downloading and running websites
See the code explorer and download whichever site you need. Use the domain checker tool / data file to know the paths it needs to be extacted to.
Remember all this is "Source Available" and PROPRIETARY - we we will not allow server deployments (to your own server) without joining through one of our programs / as a client / partner.
Downloading via git
This is the only way. Else you will not be able to get updates.
- Go to the bitbucket repository - say https://bitbucket.org/amadeusweb/amadeus - whose clone path is the 'url' parameter relative to localhost/ - so "all" click the clone button and copy the url.
- Right click on the relative path (creating it if necessary) and click Git Clone (tortoise git button).
- In the window which comes up, just say OK. (very rarely does the git folder differ from the clone path. Follow the localhost "url variable" in case of any doubt.
NB: Remember to always do a git pull when starting working / you know a change has been made. This applies to your "site" repository AND the "builder" repository.
Theme and Asset Download
Extract the theme assets (see below) that your site is using - for Amadeus, this is biz-land. To know what theme is being used, look in
- ./code/cms.php - pre code flavour way
- ./site-cms.php - called by the code flavour so if not set here, it will default to what is being set in the flavour.
- in case using the 'site' framework file (reads config from ./data/site.tsv), else if not set, it defaults to 'biz-land'.
//this line means it cannot be set as an am_var, unless we introduce another ternary on this line 73. 'theme' => isset($siteVars['theme']) ? $siteVars['theme'] : 'biz-land'
This assumes a theme has been created and zipped as per this page.
- Save the zip from the theme downloads page into the theme folder. For instance, for Amadeus the theme is biz-land.
- Extract "here" and get all the assets - css, js and default images.
- Load / refresh the website and see that there are no missing assets.
- Additionally, if planning to use decks, the revealjs will need to be downloaded and extracted to the assets folder.
NOTE: If this step is not done properly for the theme the current website is using / trying to use you will get a lot of 404 not found errors and the website will appear broken / plain white.
NOTE: If it asks to replace files that already exist, say skip, else you can revert them in tortoisegit's check for modifications window.
Making Your Own Website
We recommend using the YM code Flavour to jump start your development.
Create a bitbucket repository for your website / ask Imran to set it up for you - using his shared account so you dont need to create your own. If you are approaching us through a locality, group or institution, we recommend setting up a single shared account for yourselves.
Note that the bitbucket app key can be had from Imran for account amadeuswebdev / the new amadeuswebwork one.
Install a Code Editor like VSCode on any platform or PSPad on Windows.
Our "learning" section should be able to give more details on how to do things / you need to reach out to someone in our team.
Publishing Changes (over sFTP)
Before uploading to a server, you will need an FTP Client like FTPSync or Beyond Compare.
Setting Up on Mobile
The following Apps need to be installed:
- Git Client - PocketGit on Android
- Server in Mobile - AWebServer - Android - screenshot
- Code Editor - APhPEditor - Android
In a folder called Magique in the Mobile (configured as the server's wwwroot), the Amadeus repository needs to be cloned.
Server should run on port 8080 (or any) - see port substitution code in cms.php
'url' => $local ? replace_vars('http://localhost%port%/amadeus/', 'port') : 'https://amadeusweb.com/',
NOTE: for Mobile & Standalone Development
- Php is detected when Magique is the containing folder.
- Url rewriting is only configued when running in apache (not the standalone php server we use in env setup). Hence, inner pages will have an index.php/ just after the url.
- A new method has been made available and can be seen in action as:
<a href="<?php echo am_page_url('creatively-yours/');?>">a course</a>
- The menu and recursive menu already use this.
- In renderFile (md/txt) its %page-url%
Old Command Line Setup
Deprecated in 2024 in favour of xampp as too difficult
(Do Panic)
Install Chocolatey
Chocolatey, dubbed "The Package Manager for Windows" is a system for installing (with dependancies) packages like PHP which have different prerequisites depending on the version, service pack and hotfixes installed in windows. The PowerShell and choco install commands below to be run in CMD Prompt with Administrator privileges. REM indicates a batch file remark and is the source where said command is from.
Install PHP
With administrator command prompt using the chocolatey instructions below on windows or on mac.
rem https://docs.chocolatey.org/en-us/choco/setup
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
rem https://community.chocolatey.org/packages/php
choco install php --package-parameters='"/ThreadSafe"'
Running PHP Standalone Server
- Make a batch file called run-web.bat in the web folder with "php -S localhost:80".
- Always make sure this is running while doing development, else localhost will not open.
- Make sure Skype or anything else is not using port 80 - or if unable to change that, you can do the replace_vars in local url, running it from a different port.
- Run the server (bat file) and open localhost/amadeus/.