LaraTracker is a BitTorrent tracker TDD app written using Laravel.
Legacy code is any code without tests. Code without tests is bad code. It doesn't matter how well written it is; it doesn't matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don't know if our code is getting better or worse.
- Michael C. Feathers
PHP: 8.0+
SQL database: MySQL (min. 5.7, 8.0+ recommended), PostgreSQL or SQL Server
Caching: Redis (recommended) or Memcached
| BEP | Name | Link |
|---|---|---|
| 3 | The BitTorrent Protocol Specification |
http://www.bittorrent.org/beps/bep_0003.html |
| 7 | IPv6 Tracker Extension |
http://www.bittorrent.org/beps/bep_0007.html |
| 23 | Tracker Returns Compact Peer Lists |
http://www.bittorrent.org/beps/bep_0023.html |
| 31 | Failure Retry Extension |
http://www.bittorrent.org/beps/bep_0031.html |
| 36 | Torrent RSS feeds |
http://www.bittorrent.org/beps/bep_0036.html |
| 48 | Tracker Protocol Extension: Scrape |
http://www.bittorrent.org/beps/bep_0048.html |
| 52 | The BitTorrent Protocol Specification v2 |
http://www.bittorrent.org/beps/bep_0052.html |
Docker 18.06.0+
Docker-Compose 1.22.0+
-
Clone the project (note the
--recursiveflag)git clone --recursive [email protected]:X-Coder264/tracker.git
(if you did not run clone with
--resursivethen rungit submodule update --init docker/.dokman) -
Install the project
docker/install dev -v
-
Add
tracker.loc mail.tracker.locpointing to127.0.0.1to your/etc/hostsfile. -
You can now access the project on
tracker.loc:8888and Mailhog onmail.tracker.loc:8888. If you wish to change the default port create a new.envfile in the docker folder and change theNGINX_HTTP_PORTto whatever port you want.
Note: All default values can be seen in the same docker folder in the .env.dist file.
After changing any of these settings you'll need to rebuild your Docker images with docker/env dev build.
The docker/install dev command will automatically up your Docker containers, but you can up and down them later using these commands:
docker/env dev onand
docker/env dev offYou can restart all containers in the dev environment with this command:
docker/env dev restartYou can enter a specific container using (example for the PHP container):
docker/enter dev:phpIf you need to inspect the logs you can use the following commands:
docker/env dev logs php
docker/env dev logs nginxIf you want to for example run composer install in the dev environment on a fresh container you can use this command:
docker/run dev:php composer installAfter that the freshly created container will be removed.
These are just the basics of what Dokman can do, for other features please check Dokman's documentation here.
By default you can use Xdebug on the project. All you have to do is configure it in PHPStorm.
Put a breakpoint in some file where you want to debug and the first time you do this PHPStorm
will tell you that the remote file path is not mapped to any file path in the project. You should map
your local project folder to /app (in the Absolute path on the server column).
This must be mapped because the paths in the Docker container and the paths on the local machine do not match.
You can also debug CLI scripts, for example:
docker/enter dev:php xdebug ./artisan peers:deleteIf you want to run CLI scripts without debugging just ommit xdebug from the command.
At the moment there is only the dev environment in the Docker setup (as it can be seen in the docker/environments folder), but new environments can
be easily added in the future.
Thank you for considering contributing to LaraTracker! If you want to improve the project please consider sending a PR.
Every new feature or bug must have integration or unit tests that prove that the feature you made works or that the bug you found is actually fixed.
LaraTracker is open-sourced software licensed under the MIT license.