Feel free to tackle any of the issues at https://github.com/levimeahan/shinobi-chronicles/issues - Assign yourself or drop a comment mentioning you're working on it so others know. You can also drop any questions on the issue to clarify exactly what needs to be done.
You can also create a new issue if there's something you want to add that's not on the list and get the yay/nay from a maintainer on it to avoid building something that's not going to get approved.
Once you've created a pull request, ping @Lsmjudoka
on the #sc-coding Discord channel for review.
If you want to work on a large feature (either in the Issues tab or not), the recommendation is to write up a proposal with the details (from a gameplay perspective) and post it in the #sc-coding channel on discord, tagging @Lsmjudoka for review. Then the details of the feature and compensation can be agreed upon before work is started.
Fork repo on GitHub (top right)
Clone your fork to your local machine (you can find the URL to clone under "Code")
Create a new branch for your changes
Make the changes and test them on your local environment, then commit them to the branch
Push the branch to your forked repo on GH
Open a pull request from your fork/branch to the primary repo (levimeahan/shinobi-chronicles
) and main
branch
After pull request is merged (and before starting work on a new feature if it's been more than a day or two) update your local fork from the original repo
git remote add upstream https://github.com/levimeahan/shinobi-chronicles.git
git pull upstream main
You need an environment with four to five things:
your-username/shinobi-chronicles
), on your GitHub accountYou can use any IDE and setup you want if you have the know-how, but this guide lays out one way to get started quickly with minimal PHP environment/Git knowledge.
shinobi_chronicles
and give it a password (doesn't matter what it is, can just be "password") > check "create database with same name and grant all permissions"secure/vars.sample.php
secure/vars.php
composer install
composer install
in the previous step)vendor/bin/phinx seed:run
We use composer for managing some dependencies and info about PHP version.
Once installed, navigate to your SC directory in your CLI and run composer install
.
We use Phinx for simple migration management. The documentation on writing migrations is here: https://book.cakephp.org/phinx/0/en/migrations.html
Initial Setup
composer install
to install Phinx.vendor/bin/phinx seed:run
to populate your database with tables/data.
Quick Cheatsheet
vendor/bin/phinx migrate
vendor/bin/phinx create MyCoolMigration
vendor/bin/phinx migrate
command to execute itvendor/bin/phinx migrate -t <timestamp>
db/migrations
folder. The filename should look like 20110103081132_my_cool_migration.php
, in this case 20110103081132
is the timestamp.vendor/bin/phinx rollback
vendor/bin/phinx rollback -t <timestamp>
vendor/bin/phinx rollback -d 20230101
See /db/SampleSQLMigration.php
for a simple example of creating a migration that uses raw SQL queries.
To get started you will need to have Docker installed. Easiest way is to install the Docker Desktop app via https://www.docker.com/products/docker-desktop/ Once installed you will need to have the Docker Desktop app running to start the Docker Engine (this isn't needed if you install docker separately)
This app provides an easy way to see what containers are currently running on your system and what images are downloaded. If you are not using an IDE with built in Docker support (such as PHPStorm) this makes the process a little more GUI driven.
Before starting docker, it's recommended to install dependencies with composer install
(step 9 at the beginning of this readme).
Otherwise, they'll be re-installed every time you destroy the docker image or upgrade a dependency version.
Update environment variables inside /docker/.env these will be used for the creation of database and automatically updated in the SC Files.
Once updated, run the docker stack by running the command docker compose --env-file ./docker/.env up -d
After the stack is built and running, you can navigate to http://localhost/ (default port is 80, this can be modified in the docker compose file) to access the SC game. Additionally, you can navigate to http://localhost:8080 to access phpmyadmin (a sql browser/editor) then log in with the db credentials you provided in the .env file.
NOTICE: The docker stack ALWAYS runs the seed and migrations for the database after start up. This means if you don't create a user after the first startup it's possible the seed will run again.
This varies by system, but generally:
Windows
ext-mbstring
);extension=mbstring.dll
- Remove the semicolon and save the fileLinux
These extensions are usually managed by your package manager, try
installing, prefixed with php<version>-
. Examples
Ubuntu: sudo apt-get install php8.0-mbstring
CentOS / RedHat: sudo yum install php8.0-mbstring
Note about ext-dom
xml
extension, install thatWe use Node.js and NPM to install Javascript packages for some advanced
UI interfaces using ReactJS and other libraries, such as the Battle page.
(see the ui_components
directory for the full list)
If you are not making changes to any of these pages, you do not need to install Node.js and NPM.
npm install
Some of the syntax used in these components (e.g. JSX) is not natively available in browsers, so we have to compile the source code into plain JavaScript for it to run in browsers.
The editable source code lives in ui_components/src
.
The compiled output lives in ui_components/build
build
folder, as it will be overwritten when the components are compiled.When developing advanced UI components, navigate to the root SC directory in a terminal window
and run npm run watch-ui
to automatically compile source files from the src
directory to
compiled version in the build
directory.
$ProjectFileDir$\node_modules\.bin\babel
$FilePathRelativeToProjectRoot$ --out-dir ui_components/build/$FileDirRelativeToSourcepath$
ui_components/build/
$ContentRoot$
Scope
file[shinobi-chronicles]:ui_components/src//*
ui_components/src
You will need to install Composer and run composer install
to install the PHPUnit
testing framework.
Run composer test
to run all tests.
For more on writing tests with PHPUnit, see the docs for PHPUnit here: https://phpunit.readthedocs.io/en/9.5/
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y --enablerepo=remi-php80 php php-cli php-mysqlnd
composer install
vendor/bin/phinx seed:run
vendor/bin/phinx migrate