An instance of this website is hosted at clashtracker.ca. I recommend using that site so that all data gets congregated together and can be used by everyone. However, if you'd like to host your own instance of this site, the instructions are as follows.
Before starting, fork this repository so you have your own version of the code that you may work on.
I've hosted my website using Heroku, using a few of the add-ons for sending emails, the SQL DB and for API calls to the Clash of Clans API. Go to heroku.com and create an account, if you do not already have one. Create a new app and deploy your forked repo to the app; you can even hook it up in Heroku so that any new commits to a specific branch will automatically deploy to your app.
Add the following add-ons to your app:
*Only need one of these, but it's good to have both
In Heroku, go to your App Settings and click on 'Reveal Config Vars', there you can see your MySQL DB creds so you can log in. Add a new config var named 'PRODUCTION' and give it any value you want. The clashtracker app looks for that config variable to determine what do to in some circumstances.
Using the credentials found in the config vars, you can log into your MySQL server and run SQL queries on your DB. You should now run the sql/master.sql
file on your DB to set it up for the Clash Tracker app.
The first user that gets created in the DB gets assigned the admin role so they can access the developer page; go to the /signup.php
page, create your account and sign in.
Go to Clash of Clan's developer website and log in or create an account, if you don't already have one. Once logged in, go to My Account and Create a Key. Give it a name and a description and then you'll need the static IP addresses from Fixie and/or QuotaGuard Static. Each of these add-ons give you 2 IP addresses; make sure you add both of them to the same key.
Once you've created the API key, copy it and the IP addresses and go to the /dev.php
page. Under the API Keys section, add the IPs and their associated API keys. You can add multiple IP addresses to the same API Key by putting all IP addresses divided by spaces in the IPs input.
On the /dev.php
page, add the different static IP add-ons that you're using. For each one you've added, you'll need the config variable name, the monthly limit and one of the IP addresses for that add-on. Here are montly limits for the base plans of the add-ons mentioned above:
Add-on | Config Var Name | Monthly Limit of Base Plan |
---|---|---|
Fixie | FIXIE_URL | 500 |
QuotaGuard Static | QUOTAGUARDSTATIC_URL | 250 |
Clash Tracker is mainly developed by myself, however, feel free to fork and fix or add to Clash Tracker in any way you'd like and please submit a pull request to develop for any changes you make so that everyone can benefit from your hard work :)