Mineshafter-Squared Documentation
Notice: These documents are a bit out of date. If you have any questions with what has changed or something just does not seem to make sense, feel free to contact me.
###Project Status: Initial Release For a more in depth look at what is done and what is planned please reference the Status page.
Table of Contents
- Getting Started
- Contributing
- Coding Philosophy
- The Asset Pipeline
- CSS and LESS
- JavaScript
- Views
- Server Query API
Getting Started
To get this project up and running on a Windows machine you will need to install the following:
- PHP - The project assumes that you have PHP installed at C:\php. If you have it installed in a different location, or want to install it elsewhere, you will need to modify the start-server.bat file and replace the two instance of C:\php with your desired location.
- MySQL - You need to get mysql setup and change the database config file (in application/config/database.php) to use that database. There is a sql-setup.sql file you need to import to get the MineshafterSquared database structure setup.
- You need to copy the contents of database\data to C:\ProgramData\MySQL\MySQL Server 5.5\data. (You will need to do this anytime there is a database update).
- Alternatively you can set datadir in your MySql config file to the location of database\data on your computer. (This prevents you from having to do anything ever again).
- OpenSSL - If you are getting errors talking about issues with curl try installing OpenSSL.
NGINX is the web server of choice and this repo comes with a fully configured NGINX environment. Just double click the start-server.js file and navigate to http://localhost in your browser.
- Site Setup Go to http://localhost/setup to get the database setup with default values.
Once The Server is Started
Site: localhost Database Management: phpMyAdmin
Contributing
If you want to help develop the site there are a few things I would ask you to do / follow:
- Follow The Code Igniter Style Guide for PHP - This is a very good clean coding style and want to keep this project as readable and maintainable as possible.
- Follow the idiomatic.js Style Guide for JavaScript - This is another great read for keeping JavaScript style consistent. When in doubt, follow what this guide says.
- Comment Everything - Comments help everyone understand what you did, how, and why. Please try to leave useful comments and keep with the commenting style of the rest of the project.
- Create Issues - If you find a bug, or have an idea for a feature, please create a GitHub Issue for it. This will help us keep track of everything that is important in maintaining and evolving the site and service.
- Update Documentation - If you find an area of the documentation that is hard to follow or is misleading please add to or refine the document. Also make sure to update documentation for anything you change or add.
- Follow Our Coding Philosophy - There is a general philosophy we follow when approaching code, it would be nice if you could become familiar with it.
Our Coding Philosophy
There are a few guiding principles I like to follow when programming.
- Keep It Simple - Simple code is preferred over complex and convoluted code. This is simple to follow, break lines up if they get too long and use short, meaningful names for variables and functions.
- HTML is NOT for Structure - HTML should describe data, that is it. Use descriptive HTML 5 tags to describe what data the page is displaying. Grouping items only as it logically makes sense.
- CSS IS for Structure - CSS should be used to structure the webpage and control how it looks. A webpage should be able to entirely change it's layout only by modifying its CSS. This makes sure the site can be modified to accommodate any future changes with minimal changes anywhere else on the site.