This project is a used to gather data from Kickbase API endpoint and visualize it in a web interface, acting as alternative for the pro/member membership.
Note: This is a hobby project to test stuff with JSON and the cores of Python. Feel free to create issues and contribute.
You can find some screenshots of the frontend below, not all features are shown.
ℹ️ As of v1.4.0
If you want to run this in a Docker container, you'll first need to set some mandatory environment variables:
Variable | Required | Description |
---|---|---|
KB_MAIL |
Yes | Your Kickbase E-Mail. |
KB_PASSWORD |
Yes | Your Kickbase password. |
DISCORD_WEBHOOK |
Yes | The Discord webhook URL to send notifications to. |
RUN_SCHEDULE |
No | The cron expression when the script should fetch new information from the API. If not set, defaults to 10 2,6,10,14,18,22 * * * . |
WATCHPACK_POLLING |
Yes | Used to apply new changes in the filesystem on runtime. If not set, defaults to true . |
docker run -d \
--name=kickbase_insights \
--restart=unless-stopped \
-p <frontend_port>:3000 -p <backend_port>:5000 \
-e KB_MAIL=<kickbase_email> \
-e KB_PASSWORD=<kickbase_password> \
-e DISCORD_WEBHOOK=<discord_webhook> \
-e WATCHPACK_POLLING=true \
ghcr.io/casudo/kickbase-insights:<tag>
version: "3.8"
services:
kickbase-insights:
image: ghcr.io/casudo/kickbase-insights:<tag>
container_name: kickbase_insights
restart: unless-stopped
ports:
- <frontend_port>:3000 # Web GUI
- <backend_port>:5000 # Backend API (../api/livepoints)
environment:
- KB_MAIL=<kickbase_email>
- KB_PASSWORD=<kickbase_password>
- DISCORD_WEBHOOK=<discord_webhook>
- WATCHPACK_POLLING=true
If you run this container in your LAN (via IP), you'll need to change the following line in the App.js
file in the frontend/src
folder to this (obv. change <backend_port>
):
const response = await fetch('http://localhost:<backend_port>/api/livepoints')
If you make this container publically available via a domain, you'll need to create/update the following entry in your reverse proxy:
your.domain.com -> <container_ip_or_hostname>:3000
your.domain.com/api/livepoints -> <container_ip_or_hostname>:5000
Note: In order to this to work, both your reverse proxy and the container need to be in the same network.
Additional note: It may take some time to first run the container, so check the logs!
If you want to contribute to this project, you can follow the steps below to start the development environment.
docker run -dit --name=Kickbase -p <frontend_port>:3000 -p <backend_port>:5000 -e KB_MAIL=<kickbase_mail> -e KB_PASSWORD=<kickbase_password> -e DISCORD_WEBHOOK=<discord_webhook> -e WATCHPACK_POLLING=true ubuntu
Run this long command to setup the container:
mkdir /code && cd /code && apt update && apt upgrade -y && apt install tree nano python3 pip nodejs npm git -y && git clone https://github.com/casudo/Kickbase-Insights.git . && pip install -r requirements.txt && mkdir -p frontend/src/data/timestamps && mkdir logs && cd frontend && npm install
Now you're ready to go. Keep in mind that you'll first need to run main.py
to get the required data for the frontend.
You'll also need to manually run npm start
in the frontend
folder as well as python3 -u -m flask run --host=0.0.0.0 --port=5000
in the /code
folder.
Frontend:
- Market table: Maybe add ligainsider rating?
- Add base features
- Feed
- Lineup
- Next matches
- League table
- Top players
- Transfererlöse: Hold player for X days
- Sum. Transfererlöse: Add custom scale for chart
- Dev: Execution time
- Misc: Unsold starter players
- Fix TZ on frontend (market table)
- Reformat changelog
- Other menu layout (+ mobile responsive)
- Back to top button
- ToC on pages with lot of content
- Market value graph for players
Backend:
- Fix all TODOs
- Measure time of API calls and display them under Misc?
- Add best practice to seperate duplicate variables names from modules (e.g. user and user. Which one is the module and which one is the variable?)
- Fix TZ in Ubuntu image (Stackoverflow)
- Discord notifications
- Logging module for entrypoint.py and app.py
- Add linter/formatter
- Categorize components to frontend menu
- Better performance for some API calls (e.g. taken/free players)
- Battles: Spieltagsdominator: Fix placements being wrong for people with the same amount of mdWins
Misc:
- Add Postman workspace
- Add Workflow chart
- Add ./data, ./data/timestamp and logs/ folders to git
- Automatically disable caching
- @fabfischer for the inspiration and the currently great and working Kickbase+ web client
- @kevinskyba for providing the excellent Kickbase API documentation
- @roman-la for the base of the frontend
This project is licensed under the MIT License - see the LICENSE file for details