2022-02-20 12:30:45 +01:00
|
|
|
|
# Kafkatorio
|
|
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
Kafkatorio streams what happens on a [Factorio](https://www.factorio.com/) server to
|
|
|
|
|
|
[Apache Kafka](https://kafka.apache.org/), and turns it into a live website for the server:
|
2022-10-30 18:53:21 +01:00
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
* **Map** – a live map of every surface, with terrain, resource patches (with their size or
|
|
|
|
|
|
number of wells), buildings (with their direction and recipe), belts, and players moving in real
|
|
|
|
|
|
time.
|
|
|
|
|
|
* **Production** – what's produced and consumed per minute, and science packs used, over the
|
|
|
|
|
|
last 10 minutes up to the last 7 days, for all surfaces or one.
|
|
|
|
|
|
* **Research** – what's researched, the current research and queue, and how many science packs are
|
|
|
|
|
|
left. Shown as a filterable list, or as a tree like the game's technology screen.
|
2022-09-03 11:15:43 +02:00
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
It's built for Factorio 2.0, and works with large mod packs (it's used with Space Exploration and
|
|
|
|
|
|
Krastorio 2).
|
2022-09-03 11:15:43 +02:00
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
This is a fork of [adamko-dev/kafkatorio](https://github.com/adamko-dev/kafkatorio), updated for
|
|
|
|
|
|
Factorio 2.0, with the production and research pages and many fixes.
|
2022-09-03 11:15:43 +02:00
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
## Running it yourself
|
2022-10-30 18:53:21 +01:00
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
You need a Factorio server running in Docker, and a machine to build the images on.
|
|
|
|
|
|
**[The guide](./docs/guide.md)** covers building, configuring, connecting the Factorio server,
|
|
|
|
|
|
and putting the website behind a reverse proxy, with a ready-made setup for Unraid.
|
2022-09-03 11:15:43 +02:00
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
## How it works
|
2021-10-20 00:51:35 +02:00
|
|
|
|
|
2022-10-30 17:21:32 +01:00
|
|
|
|
```mermaid
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
flowchart LR
|
|
|
|
|
|
factorio["Factorio server<br/>+ kafkatorio-events mod"]
|
|
|
|
|
|
syslog[events-server-syslog]
|
|
|
|
|
|
kafka[(Kafka)]
|
|
|
|
|
|
processors[events-processors]
|
|
|
|
|
|
web[events-server-web]
|
|
|
|
|
|
map["web-map<br/>(nginx)"]
|
|
|
|
|
|
browser([Browser])
|
|
|
|
|
|
|
|
|
|
|
|
factorio -- "packets in the server log<br/>(Docker syslog log driver)" --> syslog
|
|
|
|
|
|
syslog -- "checks the server's token" --> kafka
|
|
|
|
|
|
kafka <--> processors
|
|
|
|
|
|
kafka --> web
|
|
|
|
|
|
web -- "REST + WebSocket" --> map
|
|
|
|
|
|
map --> browser
|
|
|
|
|
|
```
|
2022-10-30 17:21:32 +01:00
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
1. The mod, [`events-mod`](./modules/events-mod) (written in TypeScript, compiled to Lua), listens
|
|
|
|
|
|
to in-game events, groups and de-bounces them, and prints them as JSON packets to the server
|
|
|
|
|
|
log.
|
|
|
|
|
|
2. Docker's syslog log driver forwards the Factorio container's log to
|
|
|
|
|
|
[`events-server-syslog`](./modules/events-server-syslog). Each server's log is tagged with a
|
|
|
|
|
|
token (a JWT), so only known servers are accepted. The packets go to a Kafka topic.
|
|
|
|
|
|
3. [`events-processors`](./modules/events-processors) uses Kafka Streams to turn the packets into
|
|
|
|
|
|
map tiles, buildings, resource patches, and so on.
|
|
|
|
|
|
4. [`events-server-web`](./modules/events-server-web) serves the tiles and the other data over a
|
|
|
|
|
|
REST API, and pushes live updates (such as players moving) over a WebSocket.
|
|
|
|
|
|
5. [`web-map`](./modules/web-map) is the website (Kotlin/JS, with Leaflet for the map). Its nginx
|
|
|
|
|
|
also forwards `/kafkatorio/` to `events-server-web`, so the whole site is on a single port.
|
|
|
|
|
|
|
|
|
|
|
|
The packet format is defined once in [`events-library`](./modules/events-library) (Kotlin), which
|
|
|
|
|
|
also generates the mod's TypeScript types.
|
|
|
|
|
|
|
|
|
|
|
|
## Building
|
|
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
|
./gradlew build # build and test
|
|
|
|
|
|
./gradlew :modules:events-mod:distZip
|
|
|
|
|
|
# the mod: modules/events-mod/build/distributions/
|
2022-10-30 17:21:32 +01:00
|
|
|
|
```
|
|
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
See [the guide](./docs/guide.md#1-build-the-docker-images-and-the-mod) for building the Docker
|
|
|
|
|
|
images.
|
|
|
|
|
|
|
2021-12-06 22:15:26 +01:00
|
|
|
|
## License
|
|
|
|
|
|
|
Rewrite the README and setup guide, and fix the example Compose setup
The README describes what Kafkatorio does now (the live map, production
and research pages), that this is a Factorio 2.0 fork, and how the
services fit together.
The guide is rewritten as numbered steps, from building the images to a
public website: configuration, creating the server's token locally
(instead of typing the secret into jwt.io), connecting the Factorio
server's log, sending the existing map, exporting icons and names, and
the reverse proxy. Also: the Unraid setup, updating, and troubleshooting.
It warns that the mod portal's kafkatorio-events is the original, for
Factorio 1.1, with overlapping version numbers, so players must install
the mod zip by hand.
The example docker-compose.yml lost all data when containers were
recreated (e.g. on every update), and exposed Kafka, which has no
authentication, on all interfaces. It's now based on the Unraid setup:
Kafka data, map tiles, state and icons are kept next to it, only the
website is exposed, and the optional Factorio server (--profile factorio)
starts after the syslog server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:36:01 +01:00
|
|
|
|
Kafkatorio is licensed under the
|
2022-10-30 18:57:30 +01:00
|
|
|
|
[**GNU General Public License v3.0**](https://choosealicense.com/licenses/gpl-3.0/).
|