Skip to content

Commit

Permalink
Update CONTRIBUTING.md to contain a rough description of the mapadroi…
Browse files Browse the repository at this point in the history
…d-packages
  • Loading branch information
Grennith committed Jun 30, 2021
1 parent 1435ca9 commit 29642ef
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 73 deletions.
52 changes: 49 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Contributing to Map'A'Droid
## Contributing to Map'A'Droid
***************************

The following summarizes the process for contributing changes.
Expand All @@ -13,10 +13,10 @@ Map'A'Droid utilizes `make` to build a consistent development environment across
* Python

Some of the dependencies will give additional information if its not installed.

Make Commands
**************

## Make Commands

The following `make` commands are available:

* `setup` - Install pre-commit and install the required git hooks. This should be run whenever new hooks are added (should be rare since most will be handled by pre-commit).
Expand All @@ -32,3 +32,49 @@ The following `make` commands are available:
* `unittests` - Execute `up` and run tox tests for py37
* `shell-<pyxx>` - Execute `up` and grant user-level access with the tox virtual environment selected. Including `RECREATE=1` will rebuild the tox environment
* `versions` - Lookup the current version for pip, pre-commit, docker, and docker-compose
**************


## Packages roughly explained
```
.
├── cache -> Definition for caching classes/services used
├── db -> Anything in regards to DB access and model definitions (i.e. table definitions)
│ ├── helper -> Helpers to query the DB. A class per table.
│ └── resource_definitions -> Definitions of tables adding comments to render madmin pages. Planned to be replaced by using the table definitions directly.
├── geofence -> Geofence-related calculations/GeofenceHelper
├── mad_apk -> Wizard and APK storage (filesystem, DB) in order to maintain APK files that can be installed on devices
├── madmin
│ └── endpoints -> folder containing all endpoints of MADmin (i.e. a class per route)
│ ├── api -> "/api/..."
│ │ ├── apks
│ │ ├── autoconf
│ │ └── resources
│ └── routes
│ ├── apk
│ ├── autoconfig
│ ├── control
│ ├── event
│ ├── map
│ ├── misc
│ ├── settings
│ └── statistics
├── mapping_manager -> MappingManager basically is a central component of MAD. All routemanagers and configurations are loaded here and queried by workers.
├── mitm_receiver -> MITMReceiver receives data of Pogo (endpoint configured in PogoDroid), provides endpoints for autoconf and provides settings/details about the mode the worker/device should scan with
│ └── endpoints
│ ├── autoconfig
│ └── mad_apk
├── ocr -> OCR related functionality to detect certain windows and handle situations
├── patcher -> DB migrations
├── plugins -> Plugins allow for ANY code to be executed at startup to provide additional functionality to MAD
│ └── endpoints -> The endpoints relevant for plugins are loaded as AIOHTTP sub-applications. Thus plugins are provided by a sub-application, each plugin is then served with an additional sub-application (if needed)
├── route -> Routemanagers for all the modes supported by MAD. The base class RouteManagerBase provides the core logic. Template Method was used here since the core logic of routemanagers is pretty much the same: calculate routes, maintain a priority queue (optional) and provide locations to workers upon request.
│ └── routecalc -> Clustering and route calculation algorithms - TSP being the biggest enemy ;)
├── tests -> Unit tests likely broken since those are of times before asyncio was introduced -> needs fixing
│ ├── api
│ └── mad_apk
├── utils -> Utility classes/methods as well as the DeviceUpdater class dealing with MADmin jobs
├── webhook -> WebhookWorker querying the DB for changes to send changes detected towards the configured endpoints
├── websocket -> All devices using RGC connect to the WebsocketServer which allows communication (back and forth), thus screenshots can be queried, clicks/swipes executed, location adjustments etc.
└── worker -> Each device is represented by a Worker. Template Method was used given Workers are relatively straight forward: Check everything is fine (if not, handle accordingly), teleport/walk to location, do something, repeat.
```
Empty file removed mapadroid/data_manager/__init__.py
Empty file.
51 changes: 0 additions & 51 deletions mapadroid/data_manager/dm_exceptions.py

This file was deleted.

19 changes: 0 additions & 19 deletions mapadroid/data_manager/resource_search.py

This file was deleted.

0 comments on commit 29642ef

Please sign in to comment.