{"id":29191605,"url":"https://github.com/niner-games/magiedit.web","last_synced_at":"2026-01-20T16:25:50.565Z","repository":{"id":282858040,"uuid":"949874085","full_name":"niner-games/magiedit.web","owner":"niner-games","description":"A web application for building gamebooks, interactive literature, paragraph games and visual novels.","archived":false,"fork":false,"pushed_at":"2025-07-29T16:30:10.000Z","size":1280,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T19:05:12.571Z","etag":null,"topics":["adventure-game-engine","desktop-game-engine","game-engine","mobile-game-engine","paragraph-game-engine","php8","visual-novel-engine","web-game-engine","yii2-framework"],"latest_commit_sha":null,"homepage":"https://magiedit.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niner-games.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-17T09:25:53.000Z","updated_at":"2025-07-29T16:30:14.000Z","dependencies_parsed_at":"2025-06-18T19:18:47.164Z","dependency_job_id":"c9c62cf4-e615-4e55-90c4-f79b48c4e9fa","html_url":"https://github.com/niner-games/magiedit.web","commit_stats":null,"previous_names":["niner-games/magiedit"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/niner-games/magiedit.web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niner-games%2Fmagiedit.web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niner-games%2Fmagiedit.web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niner-games%2Fmagiedit.web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niner-games%2Fmagiedit.web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niner-games","download_url":"https://codeload.github.com/niner-games/magiedit.web/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niner-games%2Fmagiedit.web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adventure-game-engine","desktop-game-engine","game-engine","mobile-game-engine","paragraph-game-engine","php8","visual-novel-engine","web-game-engine","yii2-framework"],"created_at":"2025-07-02T01:01:17.302Z","updated_at":"2026-01-20T16:25:50.539Z","avatar_url":"https://github.com/niner-games.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--suppress ALL --\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.magiedit.com/\" target=\"_blank\"\u003e\n        \u003cimg src=\"LOGO.png\" alt=\"Logo of MagiEdit\" width=\"700\" height=\"272\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n**A web application for creating paragraph games and visual novels.**\n\n- [Requirements](#requirements)\n- [Deploy](#deploy)\n  * [Prepare](#prepare)\n  * [Install](#install)\n  * [Verify](#verify)\n- [Configure](#configure)\n  * [Environment](#environment)\n    * [General](#general)\n    * [Production](#production)\n  * [Database](#database)\n  * [Data](#data)\n  * [Mail](#mail)\n  * [Parameters](#parameters)\n- [Launch](#launch)\n  * [Home Page](#home-page)\n  * [Default User](#default-user)\n- [Test](#test)\n  * [Introduction](#introduction)\n  * [Acceptance](#acceptance)\n  * [Code](#code)\n  * [API](#api)\n\n*Table of contents generated with [markdown-toc](http://ecotrust-canada.github.io/markdown-toc/). Thank you.*\n\n---\n\nThis repository is licensed under the [BSD 2-Clause License](https://opensource.org/license/bsd-2-clause), allowing source \ncode usage and modification under the terms described in [LICENSE.md](https://github.com/niner-games/magiedit.web/blob/main/LICENSE.md).\n\nHowever, all binary builds (Windows, Android, iOS, macOS and Linux applications) or on-line version available at [MagiEdit](https://magiedit.com/)\nor [Niner Games’](https://ninergames.com/) websites are proprietary. Redistribution, modification, or resale of these without \nexplicit permission is not allowed.\n\n❤️ You’re welcome to explore, learn from, and reuse the code in this repo. But on-line version and published builds are a commercial \nproduct—please respect that distinction. Thank you. ❤️\n\n---\n\n## Requirements\n\nThe following components are required and must be installed:\n\n1. Local LAMP web server, e.g.: [XAMPP](https://www.apachefriends.org/index.html) equipped with a PHP interpreter in at least version **8.2.0**.\n\n2. Dependency manager [Composer](http://getcomposer.org/).\n\n3. [Git for Windows](https://gitforwindows.org/).\n\n4. Modern web browser, e.g. Firefox, Edge, Chrome, Safari (preferably -- in the latest version).\n\nThe application has been tested only in **Windows 11 Pro**, under the control of the XAMPP server and the **PHP 8.2.4** interpreter.\n\n## Deploy\n\n### Prepare\n\nIf [XAMPP](https://www.apachefriends.org/index.html) (or another LAMP-type package) is not installed, you can download it\nfrom [ApacheFriends.org](https://www.apachefriends.org/download.html).\n\nIf you do not have [Git for Windows](https://gitforwindows.org/), you can download it from [this page](https://gitforwindows.org/).\n\nIf you don't have [Composer](http://getcomposer.org/), you can install it using [this guide](https://getcomposer.org/doc/00-intro.md#installation-windows).\n\n### Install\n\nClone the main repository to a folder of your choice on your local disk:\n\n```bash\ngit clone git@github.com:niner-games/magiedit.web.git\n```\n\nUpdate all components:\n\n```bash\ncd magiedit.web\ncomposer update\n```\n\nThe `-ignore-platform-req=php` flag should only be used if you have [PHP version 8.2 or later](https://forum.yiiframework.com/t/current-version-of-yii-2-not-ready-for-php-8-2/135156/2?u=trejder).\n\nInitialize the production environment:\n\n```bash\nphp init --env=Production --overwrite=All --delete=All\n```\n\nIf you want to use a _root_ folder other than the default one, you need to [configure it](https://www.yiiframework.com/extension/yiisoft/yii2-app-advanced/doc/guide/2.0/en/start-installation#preparing-application).\n\n### Verify\n\nStart the web server and the MySQL / MariaDB database server.\n\nIf you are using Windows, make sure that your **web server is always started with administrator privileges**.\n\nThis is especially important in development and test environments. Without this, the application will not be able to read the _git\ncommit hash_ and _git tag number_. And it may show an incorrect or empty version of the application.\n\nNavigate to the folder where the application is installed in your web browser. Double check that your environment\nmeets the minimum requirements:\n\n[`http://localhost/niner-games/magiedit.web/requirements.php`](http://localhost/niner-games/magiedit.web/requirements.php)\n\nCheck all errors and warnings carefully. Before continuing, resolve any issues that you can resolve.\n\n## Configure\n\n### Environment\n\n#### General\n\nOpen the configuration file `common/config/main-local.php` and provide the name of the current environment, for example:\n\n```php\nputenv('ENVIRONMENT_NAME=prod');\n```\n\nThis is for informational reasons only (added to application version in the footer), but it is important to provide it.\nYou can use any name instead of `prod`. For example: `dev`, `test`, `pre-prod`, `uat`, `backup` etc.\n\nOpen the configuration file `frontend/config/main-local.php`, find `recaptcha` component in `components` section and provide \nyour own pair of site key and secret that are needed for this application to work.\n\n```php\n'recaptcha' =\u003e [\n    'class' =\u003e 'recaptcha\\ReCaptchaComponent',\n    'siteKey' =\u003e 'your-dev-or-prod-site-key',\n    'secretKey' =\u003e 'your-dev-or-prod-secret-key',\n],\n```\n\nYou can generate new pair at [Google reCAPTCHA admin site](https://www.google.com/u/1/recaptcha/admin/create). For more \ninformation visit [Google reCAPTCHA FAQ](https://developers.google.com/recaptcha/docs/faq). For security reasons, always\nuse separate pair and never re-use any pair in any environment or application!\n\nWhen generating key for DEV or TEST environments, include \"localhost\" and \"127.0.0.1\" domains in key settings. If you are \ngenerating a pair for production purposes, include an actual domain (i.e. \"magiedit.com\") in key settings.\n\n#### Production\n\nIf you have [initialized application in production mode](#install) then there's an extra `.htaccess` file generated in the\nroot folder to make sure that this root folder (i.e. domain) correctly points to `/frontend/web` folder, which is (or should\nbe) the only web-accessible folder in the entire application. You may want to check, if settings is this file does not break\nyour server's configuration.\n\nIn addition, there's a `baseUrl` property of `request` and `urlManager` components, nullified to empty string (`''`) in\n`fronted/config/main-local.php`. It is made so for the same reasons as above. You may want to check and possibly change \nthat file as well.\n\n### Database\n\nCreate the database manually (using the software of your choice) or by executing the following SQL command:\n\n```sql\nCREATE DATABASE magiedit;\n```\n\nCreate a separate user with at least `SELECT`, `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `ALTER`,\n`INDEX` and `DROP` privileges for this database:\n\n```sql\nCREATE USER 'scripts'@'localhost' IDENTIFIED VIA mysql_native_password USING 'P#gtitO@D:=~5C.7?IDyF1?dZ2Yo|*'; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON *.* TO 'scripts'@'localhost' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;\n```\n\n(change password `'P#gtitO@D:=~5C.7?IDyF1?dZ2Yo|*` [to different one](https://randomkeygen.com/) in above command)\n\nOpen file `common/config/main-local.php` and provide correct database server configuration, for example:\n\n```php\n$dbScheme = 'mysql';\n$dbHost = 'localhost';\n$dbName = 'magiedit';\n$dbUsername = 'scripts';\n$dbPassword = 'P#gtitO@D:=~5C.7?IDyF1?dZ2Yo|*';\n$dbCharset = 'utf8';\n```\n\n(change the password `'P#gtitO@D:=~5C.7?IDyF1?dZ2Yo|*` above to the one defined when creating the user)\n\n### Data\n\nRun all available data migrations:\n\n```bash\nphp yii migrate\n```\n\nThe database **must** be manually created by the user (two steps earlier) for the migrations to work.\n\n### Mail\n\nYou need to have a properly configured MX server (mail exchange server) to:\n\n- register a new user (→ send an email address verification message),\n- reset a forgotten password (→ send a password reset token).\n\nPlease open the file `common/config/main-local.php` and provide the correct MX server configuration, for example:\n\n```php\n$mailScheme = 'smtp';\n$mailHost = 'poczta.o2.pl';\n$mailUsername = 'username@o2.pl';\n$mailPassword = 'strong123P@SSWORD!';\n$mailPort = '587';\n```\n\nThen go to `frontend/config/params-local.php` and set the correct value for the `supportEmail` parameter:\n\n```php\n'supportEmail' =\u003e 'username@o2.pl'\n```\n\nMost mail servers require that you use **exactly the same values** (i.e. the same e-mail address) in all these places:\n\n- for `$mailUsername` in `common/config/main-local.php`\n- for `senderEmail` in `common/config/params-local.php`\n- for `supportEmail` in `frontend/config/params-local.php`\n\nI.e. you can only send emails using your account email address.\n\nHere is a couple of links, in case you would have troubles configuring MX:\n\n* using regular email accounts ([Using Built-in Transports](https://symfony.com/doc/current/mailer.html#using-built-in-transports)):\n  * [Gmail](https://support.google.com/mail/answer/56256?hl=en)\n  * [Outlook](https://www.microsoft.com/en-us/microsoft-365-life-hacks/organization/how-to-create-outlook-email-account#:~:text=Creating%20an%20Outlook%20account%20is%20easy%3A%201%20Go,email%20address.%20...%203%20Choose%20a%20username.%20)\n  * [iCloud](https://support.apple.com/guide/icloud/create-a-primary-icloudcom-email-address-mmdd8d1c5c/icloud)\n* using specialized email service ([Using a 3rd Party Transport](https://symfony.com/doc/current/mailer.html#using-a-3rd-party-transport)):\n  * [Amazon Simple Email Service](https://aws.amazon.com/ses/pricing/)\n  * [Mailchimp Transactional Email](https://mailchimp.com/pricing/transactional-email/)\n\nA technical email sent from this application may be considered as SPAM and blocked by your MX server. Or not delivered by\nany other reason. In this case, check the application logs for possible errors. If you're sending emails from a development\nenvironment, you can see each mail prepared for send, as it has a local copy stored in file, in `frontend/runtime/debug/mail`\nfolder.\n\n### Parameters\n\nGo to `common/config/params-local.php` and adjust the application configuration to your needs:\n\n```php\n'senderEmail' =\u003e 'username@o2.pl',\n'senderName' =\u003e 'MagiEdit',\n'user.passwordResetTokenExpire' =\u003e 3600,\n'user.passwordMinLength' =\u003e 8\n```\n\nSeveral files (namely `frontend/config/main-local.php` for all environments plus `common/config/codeception-local.php` and\n`frontend/config/test.php` on development and test environments) includes some predefined keys for `cookieValidationKey`\nproperty of the `request` component. These were generated using [randomkeygen.com service](https://randomkeygen.com/). If\nyou are extra sensitive over security, you may consider generating a completely new keys for each of your environments.\n\n## Launch\n\n### Home Page\n\nYour app should be ready to use. Launch your browser and go to:\n\n[`http://localhost/niner-games/magiedit.web/frontend/web/`](http://localhost/niner-games/magiedit.web/frontend/web/)\n\nFor more detailed testing instructions and technical documentation, visit the [project wiki](https://github.com/niner-games/magiedit.web/wiki).\n\n### Default User\n\nThis application comes with no users. In order to manage it, you must have at least one user in type of administrator. For\nsecurity reasons this is done manually. Please note, that you must have direct access to your database (through phpMyAdmin or\nany other database management tool) to complete this step.\n\n1. First, register a regular user account:\n\n[`http://localhost/niner-games/magiedit.web/frontend/web/account/signup`](http://localhost/niner-games/magiedit.web/frontend/web/account/signup)\n\n2. Receive account verification email and verify this account.\n\n3. Login to phpMyAdmin and go to `user` table in the `magiedit` database (adjust these to match your setup):\n\nhttp://localhost/phpmyadmin/index.php?route=/sql\u0026pos=0\u0026db=magiedit\u0026table=user\n\n4. Edit record that corresponds to your selected user and change the value of `type` column from `1` to `9`.\n\nYou are done. Now, you can log in with this user to the application, have access to [user management section](http://localhost/niner-games/magiedit.web/frontend/web/user/index)\nand change any other user to admin. Please note, that you must have at least one administrator in the system. You cannot\ndelete last administrator, and you cannot delete currently logged-in user. \n\n## Test\n\n### Introduction\n\nTests are located in `tests` directory. They are developed with [Codeception PHP Testing Framework](https://codeception.com/).\nBy default, there are 3 test suites:\n\n- `unit`\n- `functional`\n- `acceptance`\n\nTests can be executed by running\n\n```\nvendor/bin/codecept run\n```\n\nThe command above will execute unit and functional tests. Unit tests are testing the system components, while functional\ntests are for testing user interaction. Acceptance tests are disabled by default as they require additional setup since\nthey perform testing in real browser. \n\n### Acceptance\n\nTo execute acceptance tests do the following:  \n\n1. Rename `tests/acceptance.suite.yml.example` to `tests/acceptance.suite.yml` to enable suite configuration\n\n2. Replace `codeception/base` package in `composer.json` with `codeception/codeception` to install full-featured\n   version of Codeception\n\n3. Update dependencies with Composer \n\n    ```\n    composer update  \n    ```\n\n4. Download [Selenium Server](https://www.seleniumhq.org/download/) and launch it:\n\n    ```\n    java -jar ~/selenium-server-standalone-x.xx.x.jar\n    ```\n\n    In case of using Selenium Server 3.0 with Firefox browser since v48 or Google Chrome since v53 you must download [GeckoDriver](https://github.com/mozilla/geckodriver/releases) or [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/downloads) and launch Selenium with it:\n\n    ```\n    # for Firefox\n    java -jar -Dwebdriver.gecko.driver=~/geckodriver ~/selenium-server-standalone-3.xx.x.jar\n    \n    # for Google Chrome\n    java -jar -Dwebdriver.chrome.driver=~/chromedriver ~/selenium-server-standalone-3.xx.x.jar\n    ``` \n    \n    As an alternative way you can use already configured Docker container with older versions of Selenium and Firefox:\n    \n    ```\n    docker run --net=host selenium/standalone-firefox:2.53.0\n    ```\n\n5. (Optional) Create `yii2basic_test` database and update it by applying migrations if you have them.\n\n   ```\n   tests/bin/yii migrate\n   ```\n\n   The database configuration can be found at `config/test_db.php`.\n\n\n6. Start web server:\n\n    ```\n    tests/bin/yii serve\n    ```\n\n7. Now you can run all available tests\n\n   ```\n   # run all available tests\n   vendor/bin/codecept run\n\n   # run acceptance tests\n   vendor/bin/codecept run acceptance\n\n   # run only unit and functional tests\n   vendor/bin/codecept run unit,functional\n   ```\n\n### Code\n\nBy default, code coverage is disabled in `codeception.yml` configuration file, you should uncomment needed rows to be able\nto collect code coverage. You can run your tests and collect coverage with the following command:\n\n```\n#collect coverage for all tests\nvendor/bin/codecept run --coverage --coverage-html --coverage-xml\n\n#collect coverage only for unit tests\nvendor/bin/codecept run unit --coverage --coverage-html --coverage-xml\n\n#collect coverage for unit and functional tests\nvendor/bin/codecept run functional,unit --coverage --coverage-html --coverage-xml\n```\n\nYou can see code coverage output under the `tests/_output` directory.\n\n### API\n\nTo test the API, it's recommended to use the [Insomnia Portable](https://portapps.io/app/insomnia-portable/) application.\n\nYou can import the file _insomnia.json_  (available in the _console/migrations_ folder of the project)  into your copy of\nInsomnia Portable (note: this may not work with the standalone Insomnia version).  This will prepare all the environments \n(DEV, TEST, UAT, PROD) and API endpoints for testing.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniner-games%2Fmagiedit.web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniner-games%2Fmagiedit.web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniner-games%2Fmagiedit.web/lists"}