Files
seatmapv2/README.md
2023-01-30 13:19:22 +01:00

268 lines
7.1 KiB
Markdown

<div align="center">
<img src="https://dl.zinomedia.de/4netplayers.png" alt="Logo">
<h3 align="center">Docker Minecraft Api</h3>
<p align="center">
Serve information about minecraft docker mods, their available versions and needed executables.
</p>
<br/>
</div>
### Built With
[![Laravel][Laravel.com]][Laravel-url]
<br/>
<details>
<summary>Table of Contents</summary>
<ol>
<li>
<a href="#usage">Usage</a>
<ul>
<li><a href="#mods">Mods</a></li>
<li><a href="#revisions">Revisions</a></li>
<li><a href="#executables">Executables</a></li>
</ul>
</li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#tests">Tests</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#license">License</a></li>
</ol>
</details>
<br/>
## Usage
_An automatically generated and interactive API documentation with (live) responses is available at **/idoc**._
<br/>
##### Mods
**/api/v1/mods**: Get all mods
- Include: `revisions` | `revisions.executable`
- Sort: `name` | `projectUrl`
- Example: `/api/v1/mods?include=revisions.executable&sort[projectUrl]`
<details>
<summary>Example response</summary>
```json
{
"data": [
{
"id": 427,
"name": "10 YEARS OF MINECRAFT MAP",
"mindRam": 2048,
"projectUrl": "https://www.minecraft.net"
},
{
"id": 428,
"name": "Technic - The 1.7.10 Pack",
"mindRam": 4096,
"projectUrl": "https://www.technicpack.net/modpack/the-1710-pack.453902"
}
]
}
```
</details>
**/api/v1/mods/{id}**: Get mod by id
- Include: `revisions` | `revisions.executable`
- Sort: `name` | `projectUrl`
- Example: `/api/v1/mods/1337?include=revisions.executable&sort[projectUrl]`
<details>
<summary>Example response</summary>
```json
{
"data": {
"id": 426,
"name": "Minecraft Vanilla",
"mindRam": 2048,
"projectUrl": "https://www.minecraft.net"
}
}
```
</details>
<br/>
##### Revisions
**/api/v1/revisions**: Get all revisions
- Include: `executable` | `mod` | `executable,mod`
- Sort: `version`
- Example: `/api/v1/revisions?include=executable,mod&sort[version]`
<details>
<summary>Example response</summary>
```json
{
"data": [
{
"id": 7542,
"modId": 426,
"executableId": 8,
"version": "1.19.3"
},
{
"id": 7543,
"modId": 426,
"executableId": 8,
"version": "1.19.2"
}
]
}
```
</details>
**/api/v1/revisions/{id}**: Get revision by id
- Include: `executable` | `mod` | `executable,mod`
- Sort: `version`
- Example: `/api/v1/revisions/1337?include=executable,mod&sort[version]`
<details>
<summary>Example response</summary>
```json
{
"data": {
"id": 7556,
"modId": 426,
"executableId": 5,
"version": "1.16"
}
}
```
</details>
<br/>
##### Executables
**/api/v1/executables**: Get all executables
- Include: `revisions` | `revisions.mod`
- Sort: `name` | `key`
- Example: `/api/v1/executables?include=revisions.mod&sort[name]`
<details>
<summary>Example response</summary>
```json
{
"data": [
{
"id": 5,
"name": "Java 8",
"key": "JAVA_8"
},
{
"id": 6,
"name": "Java 11",
"key": "JAVA_11"
}
]
}
```
</details>
**/api/v1/executables/{id}**: Get executable by id
- Include: `revisions` | `revisions.mod`
- Sort: `name` | `key`
- Example: `/api/v1/executables/1337?include=revisions.mod&sort[name]`
<details>
<summary>Example response</summary>
```json
{
"data": {
"id": 5,
"name": "Java 8",
"key": "JAVA_8"
}
}
```
</details>
<br/>
## Contributing
If you have a suggestion that would make this better, please fork the repo and create a pull request. Before cloning this project, you should ensure that your local machine has PHP and Composer installed. To get a local copy up and running follow these steps.
1. Clone the repo and install composer packages:
```
git clone https://gitlab.4players.de/4np/apis/docker-minecraft-api.git
composer install
```
2. After composer installation create .env file in your project root folder & copy everything from .env.example file into .env file. Then run `php artisan key:generate`, which will generate an APP_KEY in .env file for you. After, setup your DB_DATABASE, DB_USERNAME & DB_PASSWORD in .env file.
3. Run migrations and import json to database:
```
php artisan migrate
php artisan json:import
```
4. Serve the project via `php artisan serve` or [Laravel Homestead](https://fourplayers.atlassian.net/wiki/spaces/4NET/pages/1035206657/Homestead+Installation).
<br/>
## Tests
Tests are available.\
A HTML coverage report is available in tests/Coverage.
<br/>
## Contact
Marlon Maschkiwitz - marlon.maschkiwitz@4players.io <br/>
Project Link - https://gitlab.4players.de/4np/apis/docker-minecraft-api
<br/>
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/github_username/repo_name.svg?style=for-the-badge
[contributors-url]: https://github.com/github_username/repo_name/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/github_username/repo_name.svg?style=for-the-badge
[forks-url]: https://github.com/github_username/repo_name/network/members
[stars-shield]: https://img.shields.io/github/stars/github_username/repo_name.svg?style=for-the-badge
[stars-url]: https://github.com/github_username/repo_name/stargazers
[issues-shield]: https://img.shields.io/github/issues/github_username/repo_name.svg?style=for-the-badge
[issues-url]: https://github.com/github_username/repo_name/issues
[license-shield]: https://img.shields.io/github/license/github_username/repo_name.svg?style=for-the-badge
[license-url]: https://github.com/github_username/repo_name/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/linkedin_username
[product-screenshot]: images/screenshot.png
[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
[Next-url]: https://nextjs.org/
[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
[React-url]: https://reactjs.org/
[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
[Vue-url]: https://vuejs.org/
[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
[Angular-url]: https://angular.io/
[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
[Svelte-url]: https://svelte.dev/
[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
[Laravel-url]: https://laravel.com
[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
[Bootstrap-url]: https://getbootstrap.com
[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
[JQuery-url]: https://jquery.com