-
Notifications
You must be signed in to change notification settings - Fork 0
Build and Deployment
This article should give overall overview of how to deploy CUK system. What are its specifics and what should be avoided or what is recommended. Given to web-nature of the system, there is no such thing as build and only deployment will be discussed.
Deployment should be done on machine which is equipped with PHP 7.0 or higher with some HTTP web server, preferably Apache. For the database layer it is recommended to use MySQL, but CUK should be able to work with any well-known database server (thanks to Doctrine). The system uses Nette PHP framework.
CUK is designed to run only on secured web-servers which engage HTTPS protocol. Consider it during development and further deployment. HTTP protocol is not supported and there may be needed further modifications to make it work.
If you have only FTP access to the remote web-server all following steps has to be done on localhost and then transfered to the remote server, with a little extra work concerning database. Description of installation steps follows.
- First you have to clone git repository hosted on github:
git clone https://github.com/CatUnicornKiller/web-app
. This will create web-app directory in current folder, the directory will contain CUK web application with its source codes. - In the freshly cloned repository libraries are missing. Download and installation of them is performed using composer
composer install
. Which download and emplace all needed libraries into vendor folder. - Create a database with some suitable name and fill in the access information in
app/config/config.local.neon
. Example configuration file can be found inapp/config/config.local.example.neon
. Alongside database access there are multiple configuration options which can be set to web application. For further information about configuration please see separated Configuration article. - Create directories for article, events, profile and showroom images which are specified in configuration file.
- Setup the database schema by running
php index.php orm:schema-tool:update --force
, which will create database tables and relations from doctrine entities. - Fill database with initial values by running
php index.php db:fill
. This command will fill countries, initial faculty, admin user and initialize pages. For further details seefixtures
folder.
Do not forget to make directories temp/
and log/
writable, which is necessary for Nette to work.
It is critical that whole app/
, log/
and temp/
directories are not accessible directly via a web browser. See security warning for further details.
In CUK system there is payment gateway for the purposes of paying for events by participants. For this, payment gateway provided by FIO Bank is used. FIO uses external payment gateway implementation called EcommMerchant. Due to unclear licensing of Ecomm software and its APIs, PHP class EcommMerchant\Merchant
is missing in the provided CUK implementation.
Merchant class is responsible for calling remote payment gateway server API and performing start of the transaction, getting results, etc. Therefore not providing actual implementation is somehow hiding Ecomm API. If you want to use different payment gateway in your CUK deployment there have to be done probably extensive changes in the overall solution.
More about payment gateway, its implementation and integration within external service, can be found in separate article Payment Gateway.
The CUK system was developed and is ready to be served from the Apache webserver. Only thing which needs to be done is to setup a virtual host to point to the /
directory of the system and you should be ready to go.
Of course you can use also nginx webserver, but the system does not provide support for it by default and you have to make sure, that all the directories which should not have been publicly accessible are not.
The web application can be also started using built-in PHP webserver. But as stated above CUK only works with HTTPS protocol, therefore simple unsecure built-in server cannot be used.
CUK was developed in the Czech Republic and for the needs of IFMSA CZ. If you want to deploy CUK in the other country you have to take care of some czech texts mostly in the content of web pages. Translations are not yet provided by default in CUK and might be implemented in the future releases.
CUK system is written with major help of Nette 2.3 framework. So if you want to contribute to this project, at least basic knowledge of Nette framework is needed. Further description of architecture of whole project can be found in Architecture article. Any meaningfull contributions will be considered and eventually merged, so do not hesitate to reimplement nasty parts or add new features.
CUK is developed under MIT License thus it can be forked, modified or commercialize without any further restrictions.
CatUnicornKiller System
Author: Martin Polanka
License: MIT