Write web frontend #2

Open
opened 2025-03-19 13:44:49 +01:00 by oysteikt · 7 comments
Owner

While we now have all the data, it needs to be visualized somehow. Please create a web frontend for the project

While we now have all the data, it needs to be visualized somehow. Please create a web frontend for the project
oysteikt added the big label 2025-03-19 13:44:49 +01:00
Owner

I could do this. I just need to know how get the data.

I could do this. I just need to know how get the data.
Author
Owner

I think this either needs to be done after or in collaboration with #3. The only done part is the log ingestion stuff. It is currently running on bicep, so there is fresh and up to date data in postgresql.

Feel free to choose any language you like. It needs a postgres adapter though. There is sqlx for rust, sqlalchemy or raw psycopg2 for python, and likely others for other languages.

Alternatively, you could assume that the endpoints exist and make visualization data, and then specify what you need in #3

I think this either needs to be done after or in collaboration with #3. The only done part is the log ingestion stuff. It is currently running on `bicep`, so there is fresh and up to date data in postgresql. Feel free to choose any language you like. It needs a postgres adapter though. There is sqlx for rust, sqlalchemy or raw psycopg2 for python, and likely others for other languages. Alternatively, you could assume that the endpoints exist and make visualization data, and then specify what you need in #3
Author
Owner

The current data looks like this:

SELECT * FROM minecraft_login_sessions LIMIT 10;

   username   |        start        | duration
--------------+---------------------+----------
 user1        | 2013-10-29 14:29:58 |      251
 user1        | 2013-10-30 00:25:59 |     6582
 user1        | 2013-10-30 01:12:45 |     2491
 user2        | 2013-10-30 20:54:17 |      469
 user3        | 2013-10-31 16:10:54 |      266
 user4        | 2013-10-31 21:58:36 |       26
 user1        | 2013-11-01 02:26:24 |    13077
 user1        | 2013-11-01 18:29:59 |     1154
 user5        | 2013-11-01 18:31:24 |       36
 user1        | 2013-11-01 18:40:47 |      522

(redacted the usernames)

The duration is in seconds

The current data looks like this: ``` SELECT * FROM minecraft_login_sessions LIMIT 10; username | start | duration --------------+---------------------+---------- user1 | 2013-10-29 14:29:58 | 251 user1 | 2013-10-30 00:25:59 | 6582 user1 | 2013-10-30 01:12:45 | 2491 user2 | 2013-10-30 20:54:17 | 469 user3 | 2013-10-31 16:10:54 | 266 user4 | 2013-10-31 21:58:36 | 26 user1 | 2013-11-01 02:26:24 | 13077 user1 | 2013-11-01 18:29:59 | 1154 user5 | 2013-11-01 18:31:24 | 36 user1 | 2013-11-01 18:40:47 | 522 ``` (redacted the usernames) The duration is in seconds
Author
Owner

It is also possible to make more sophisticated endpoints, summing the amount per day per user, or average playtime, or accumulated playtime for all users per day, etc. There are some more ideas in #3

It is also possible to make more sophisticated endpoints, summing the amount per day per user, or average playtime, or accumulated playtime for all users per day, etc. There are some more ideas in #3
Owner

Yeah, maybe I should try making an endpoint first and see.

Yeah, maybe I should try making an endpoint first and see.
Author
Owner

Do you want to set up a test database, or do you want credentials to the existing one? The postgres instance is not available outside the PVV IP space, so either you have to test your code through an SSH tunnel (this is just a single command) or you have to be at PVV. It might be easier than dealing with setting up a test db though.

Do you want to set up a test database, or do you want credentials to the existing one? The postgres instance is not available outside the PVV IP space, so either you have to test your code through an SSH tunnel (this is just a single command) or you have to be at PVV. It might be easier than dealing with setting up a test db though.
Owner

It would be nice to have a test database, since I am not at PVV. A SSH tunnel would of course also work, but local testing is a bit more flexible.

It would be nice to have a test database, since I am not at PVV. A SSH tunnel would of course also work, but local testing is a bit more flexible.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Projects/minecraft-heatmap#2