This is the entirety of the source code running on swarfarm.com. Previously, a portion of the site was published on github as swarfarm_io. This was the code that dealt with uploaded user data, so I felt that being open about what it was doing was important. Now, I've decided to publish the entire codebase to get more eyes on the code and hopefully some contributions. This project was started as a learning experience, and my web development and python skills started out rusty. Some of that rust is still in the code today, so if you see something ugly it can probably be improved.
Work is ongoing to fully flesh out the REST API and recreate the frontend with the latest and greatest web development technologies. This opens the door to third-party clients and mobile apps. Any new features or major refinements are on hold until the new frontend is ready. The exceptions to that rule are bug fixes, data logging/report generation, and any minor effort improvements.
Any ideas should be raised as an issue first. If you want to contribute code for an idea, fork the repository and create a pull request. Any changes in data models that affects the database structure will be highly scrutinized and may be delayed in deployment if accepted.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python 2.7
- PostgreSQL 9.4
Additional prerequisites for production:
- nginx
- Redis
- RabbitMQ
-
Get your postgres set up with a user role and a database.
-
Install all the python packages, preferably in a virtual environment
pip install -r requirements.txt
-
Copy
.env.exampleto.envand edit the variables to fit your environment.- The minimum settings required to work in a development environment are
SECRET_KEYandDATABASE_URL. - See the Django documentation for
SECRET_KEYbefore continuing. CACHE_BACKENDandCACHE_LOCATIONcan be left unchanged and will utilize Django's dummy cache, which doesn't actually do anything.RECAPTCHA_PUBLIC_KEYandRECAPTCHA_PRIVATE_KEYmust be set to be able to submit forms in certain sections of the site. Create your own keys here.GOOGLE_API_KEYis used for Google's URL shortener API and is not required unless you are testing the Twitch.tv Nightbot API.
- The minimum settings required to work in a development environment are
-
Run all database migrations
python manage.py migrate
-
Create a superuser
python manage.py createsuperuser -
Load the bestiary data from the fixtures COMING SOON
-
Run the server
python manage.py runserver
There are no tests yet. I am a horrible person.
- Python
- Django - The web framework
- Django REST Framework - REST API for Django
- Celery - Asynchronous task runner
- Many other packages. See requirements.txt
This project is licensed under the Apache 2.0 License - see the LICENSE file for details
- SWProxy for easily extracting game data, which makes SWARFARM orders of magnitude easier to use.
- SWProxy-plugins for including the SwarfarmLogger.py plugin and making the data logs possible.