MineGuardian-Backend banner

MineGuardian-Backend

10 devlogs
19h 46m

This is the backend for MineGuardian-Frontend (duh), it will be a python program listening and providing api endpoints for the Frontend, which can be found at https://flavortown.hackclub.com/projects/910 but also an installer for Minecraft servers…

This is the backend for MineGuardian-Frontend (duh), it will be a python program listening and providing api endpoints for the Frontend, which can be found at https://flavortown.hackclub.com/projects/910 but also an installer for Minecraft servers from official sources

This project uses AI

Using AI to understand new concepts, to add comments throughout the project and for debugging when necessary.

Repository

Loading README...

SilentSword

Omg, I might have forgot about flavortown, I’m so sorryyyy! I worked, as you can see, 6 hours, in which I have mainly build API endpoints for the frontend, such as one to install and uninstall servers, constant pooling of ram and CPU usage, automatically giving the max ram that can be used. I also made a temporary frontpage so that it has something to show. I don’t think it’s going to stay like that, but at least it’s something.
Fixed bugs again and again, and that’s it. Thanks for reading!

0
SilentSword

Woah, I worked in all of my free time today, and seeing almost 4h up there made me feel dizzy for a moment, I need to take more breaks❤️. I’m curious how much I have worked on the frontend… Anyway, even though there are only 2 or 3 new features, I have refractured a big part of the code, because it was hard to work with it. And also, those 2 or 3 features are this:
Getting individual Minecraft server’s resources like RAM, CPU, etc…
Implemented a class which connects via rcon (apparently it comes from remote connection) to a specified server’s Ip and port and authenticates with a password (witch I think it’s necessary). After this, it waits to get the response back (all of it), because apparently it fragments it, I don’t even remember.
And these are all of the features added today. Thanks for reading! Have a great day!

0
SilentSword

It’s been a while science I’ve worked on this project. I have reopened it today, and I was trying to remember what was going on, where I left off, and what I needed to do. I remembered that the last thing I wanted to implement is the WebSocket connection; a live feed from the server to the user/browser, and after apparently 1 hour and 43 minutes, I did it! The connection works seamlessly. Of course there are still some bugs, but it’s much, much better than the last time.

0
SilentSword

So, I just did the api endpoints to stop and start a server. I uploaded the same video as for the frontend, because, again, that’s how you can see them in action!

0
SilentSword

Ok, so I tried to make the server use the WebSocket connection to send, in realtime, the output of the minecraft servers, but apparently, on windows, java sends the output slower when it detects that it is being run in a subprocess, and I tried to make it instant, but I couldn’t figure it out, so im gonna work on other features next such as basic turning on and off the server, etc… and ill focus on the console later.

0
SilentSword

Ok, so in those 2h, I have just made the api work with the frontend. I implemented WebSocket support, and that’s kinda it. I know, I know, even I think it’s too little for 2h of work, but you have to believe me, I am glad it didn’t take me 3h. Even though I wrote a little bit of code, the amount of debugging I had to do is ISNSANE. That doesn’t mean I don’t love programming anymore, it’s my favorite hobby, I was just telling you how things went. Also, you do want to read the devlog from the frontend, I have basically worked on both at the same time. But for now, it’s good night for me❤️
P.S: I uploaded the same video as for the fronted because that’s where you can see the api’s functionality.

0
SilentSword

Ok, im login only 44m, but I have actually worked a little bit more (close to 1h or 1.2h). The program now actually runs the servers in the background, and you can attach whenever to whatever server you want (in the video I only did it with one server because I’m lazy to download 2 minecraft servers). The best part (for me, and for you), it runs on any os!!! So excited to make an mvp and see your reaction on it. Now I think I want to see if there are any bugs or typos, and then I’ll make the API server work, or redesign it and make a simpler api, idk how or what I’ll see. Hope you are as excited as I am for this!!!

0
SilentSword

It has been some time. The running server part was very easy, but I wanted to make the server run in a subprocess and then be able to tap into the subprocess of any server whenever you would like. Finaly, after 30min or more, I gave up and let the features I already implemented stay. The features I implemented now are:

  1. Automatic acceptance of EULA (user must confirm tho)
  2. Automatic launch script creation (works on any os; windows, linux, macOS,… tested only on windows tho:( )
  3. Added a config file where the user can modify the startup script if they know what they are doing.

That’s all for today, I’ll see you tomorrow!

0
SilentSword

Added the feature to automatically download the Minecraft server. Took a while, but it can download any version of vanilla Minecraft servers (basically official, from Mojang, Minecraft’s owners). It will do it in a special directory for servers for easier management. Text thing I have to make the program actually install the server.

0
SilentSword

Created the project with python and made some basic cli interface using questionary. The program is able to start a flask API server and respond to Api calls, providing some test data

0