Follow this installation guide to set up Luminosity
Installation
Packages used:
Requirements
- PHP Version ≥ 7.0 (ext-mbstring and ext-exif enabled)
- Composer package management (optional)
- MySQL drivers
Setup Luminosity
Follow the given steps to setup Luminosity.
1. Setup Project
- Clone project in htdocs directory using
git clone git@github.com:cmd3BOT/Luminosity.git
Rename application/Config/Config.example.php
to Config.php
- When remotely hosting your site typically the URL would not contain the folder name but only the host name. Therefore, when deploying we can change the environment in Config.php from
local
to prod
.
define("ENVIRONMENT", "local");
$basePath = ENVIRONMENT === "local" ? '/'.basename(dirname(__DIR__, 2)) : '';
define('BASE_FOLDER', $basePath);
/**
* Set URLROOT for application.
* Note: Host name should not have trailing slashes.
* Eg: https://luminosity-dev.herokuapp.com or http://localhost
*/
define('URLROOT', "http://<hostname>".BASE_FOLDER);
2. App Configurations
Setup the app configurations in the Config file carefully to avoid any unexpected errors
- Add SMTP Mail details to app.
To setup using Gmail
define("SMTP_HOST", 'smtp.gmail.com');
define("SMTP_USERNAME", 'username@gmail.com');
define("SMTP_MAIL", 'username@gmail.com');
define("SMTP_PASSWORD", 'password');
define("SMTP_PORT", 587); // default mail port
Using Gmail requires access from less secure apps
More options: Sendgrid, Mailjet
define('EMAIL_API_TOKEN', '...');
- Cloudinary has been used as the image host for application. Cloudinary works in the default
demo
mode as given. Creating your own cloud will allow only validated images from your cloud on the application. Allowed Image Extensions can be set in the console at settings/uploads/<UPLOAD_PRESET>/Upload Control
Reference Upload API
// Default values for demo cloud
define('IMG_CLOUD_NAME', 'demo');
define('IMG_UPLOAD_URL', 'https://api.cloudinary.com/v1_1/'.IMG_CLOUD_NAME.'/image/upload');
define('IMG_API_KEY', '');
define('IMG_API_PRESET', 'docs_upload_example_us_preset');
You can modify the allowed size and extensions for user uploaded images in WriteModel
if($array['bytes'] <= 10000000 && in_array($array['format'], ['jpg','jpeg','gif','webp','png'])
&& isset($array['secure_url'])) {
return $array['secure_url'];
}
3. Setup Database
Use MySQL database for the application.
- Add database credentials to the Config file
define("DB_HOST", "localhost");
define("DB_USER", "root");
define("DB_PASS", "");
define("DB_NAME", "luminosity");
Issues
In case of a problem you can open an issue