Trashmunchers is a location based game developed to promote sustainability at the University of Exeter. The objective of the game is for players to feed Trashmonsters at different recycling points scattered across campus in order for their team to gain control of the Trashmonsters. Players can visit their nearest Trashmonster and take a picture of what they are recycling. By doing so, they are awarded a certain amount of points based on the size of what they recycled. In addition to this, they are given a certain amount of carbon dependant on the size of their trash to represent their impact on sustainability.
Styled using black.
Prerequisites:
- Have Python installed (Link to download: https://www.python.org/downloads/)
- Have pipenv installed (Steps to installation: https://pypi.org/project/pipenv/#installation)
- Have a local version of the repository (How to clone a repository: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)
Steps:
- Open a terminal (Windows - PowerShell or Command Prompt, UNIX - Terminal)
- Open the src folder in a terminal
- Run
pipenv install
to download all dependencies
- Enter the pip environment shell
pipenv shell
- You should be met with a message confirming that you have entered the pipenv shell
- Enter src folder
cd src
- Create a developer user
python manage.py createsuperuser
- Enter the details that you would like the account to have (username, email and password)
- If already deployed, go to host-ip/admin (for us: http://38.242.137.81:8000/admin/) and login
- If it hasn't been deployed (being run locally), run
python manage.py loaddata teams
to initialise the teams - Then, run
python manage.py runserver
- Go to localhost:8000/admin and login to see if it was successfully created
- If it hasn't been deployed (being run locally), run
- Now, you can manage all users, teams and trashmonsters in the database. (It is also possible to edit team names in src/trashusers/fixtures/teams.json)
.
├── github # Used to update backend host link
├── design_documents # Markdowns containing information about game and technical design choices
│ ├── .obsidian # JSONs for styling markdowns
│ ├── GDD.md # Information about game design choices
│ ├── TDD.md # Information about technical design choices (Needs to be completed)
│ └── TrashImagesApp.md # Instructions on how to run the TrashImages APIs locally to ensure that they can be used for deployment
├── src # Source files
│ ├── assests # JSONs for styling markdowns
│ ├── media/images # Contains the images submitted by users
│ ├── trashimages # Django app used for image handling
│├── migrations # Used to create tables in the database from models.py
│├── __init__.py
│├── admin.py # File where models are registered on the admin site for use by the admin
│├── apps.py # Name of the application
│├── models.py # Definition of the tables
│├── serializer.py # Outlines the JSON format that requests will be received/sent in
│├── tests.py # Unit tests for this API
│├── urls.py # List of registered urls that lead to endpoints
│└── viewsets.py # Outlines what happens when a user accesses a URL. For more info, visit https://www.django-rest-framework.org/api-guide/viewsets/
│ ├── trashmain # Main Django app for configuration (Initial API endpoint)
│├── __init__.py
│├── asgi.py
│├── auxillary.py # Used to get a player's team
│├── permissions.py # Used to check if a player is a gamekeeper or a player to restrict them from certain endpoints
│├── settings.py # Contains settings used for configuration to ensure that the app runs as intended. Must include created APIs in INSTALLED_APPS
│├── urls.py # List of registered urls that lead to endpoints. Defined for every application created
│└── wsgi.py
│ ├── trashmonsters # Django app for handling the game's monsters
│├── migrations # Used to create tables in the database from models.py
│├── __init__.py
│├── admin.py
│├── apps.py # Handles server startup to ensure that database isn't constantly recreated and overwritten
│├── config.json # Contains "monster eating" interval and maximum distance leeway
│├── jobs.py # Handles the score decreasing methods using a scheduler
│├── models.py
│├── serializer.py
│├── tests.py # Unit tests for this application
│├── urls.py
│└── viewsets.py
│ ├── trashusers # Django app for handling users
│├── fixtures
│├── teams.json # JSON file that is used to create three teams on startup
│├── migrations
│├── __init__.py
│├── admin.py
│├── apps.py
│├── models.py
│├── serializer.py
│├── tests.py
│├── urls.py
│└── viewsets.py
│ ├── db.sqlite3 # Database where information is stored
│ ├── manage.py # Autocreated by Django. Used for executing Django related tasks (e.g., running the server)
│ └── requirements.txt # List of dependencies used for deployment
├── trashmunchers # Contains cache files
│├── trashmunchers/__pycache__
│└── trashsite/__pycache__
├── .gitignore # Prevents certain files from being pushed to the repository
├── Dockerfile # Used to install the latest dependencies upon deployment
├── Pipfile # Contains all project dependecies required for the application to be built
├── Pipfile.lock # Declares all project dependecies, their latest available versions and the hashes for those files
├── INFOFORGROUP.txt # Information for development team on how to maintain program
├── docker-compose.yml # Used to run the Django server through Docker
├── readme.md
├── requirements.txt # List of dependencies used for deployment
├── run-docker.sh # Shell script to run the Docker server
├── Trashmunchers Testing Strategy.pdf # Document outlining the testing strategy used for this product
├── LICENSE # License used for this repository
└── api_documentation.md # Information about API endpoints
Owen Lee |
Ellie Kelemen |
William Liversidge |
Vignesh Mohanarajan |
Scarlett Parker |
Malik Besta |