Runik - Just Run It
- 31 Devlogs
- 36 Total hours
(Will be) One click deployment for databases, game servers and docker applications. Deploy on my server, your server or cloud servers. Automatic tunnelling from your own server.
(Will be) One click deployment for databases, game servers and docker applications. Deploy on my server, your server or cloud servers. Automatic tunnelling from your own server.
Virtual servers can now list actions for the user.
This is fully programmatic, so when the virtual server sends statistics and links, it also responds with a list of actions like:
{
"label": "Stop",
"code": "stop_container",
"type": ui.ButtonTypeDanger,
"confirm": {
"title": "Are you sure you want to stop this container?",
"description": "Application data may be lost.",
"button_label": "Confirm"
}
}
Each action has an optional and configurable confirmation dialog. Doing it like this allows the virtual server to have different actions based on the status of the container for example, like start if its stopped and stop/restart if its running.
I also added a loading indicator to all buttons, which shows whenever a HTMX request is being made.
Shows the status and utilisation of the container, and also the links.
The links are found by parsing the containers labels and extracting the traefik rules.
Fixed a few issues with the docker manager:
Also added loading indicator and status dot components.
Next I’ll implement manual start/stop of containers (general action buttons), then service deletion and then volumes
I added support for configuring ports, then implemented the Traefik reverse proxy giving each port a unique (non random - based on service id and port) subdomain. The service is given automatic TLS (error due to self signed cert - when I deploy I will have a domain and use letsencrypt)
Next I need to add a better display, so the link shows in app
I need to:
I added an input to my ui library that lets you add infinite entries. Supports text/number types. Also fixed an issue where modals could overflow the screen.
Built this so I can have better configuration for my docker service, i.e to set ports and volumes.
Haven’t implemented the backend storage for these but the components work
I added an endpoint to the platform API (GET /api/services) that returns all of the clients services.
On start, the virtual server will request services to run, and start them one concurrently using golangs channel features (containers to run are added to a queue where up to five containers are handled at a time)
I implemented the backend for ordering a service.
Diagram explaining flow
Text scored with red has not been implemented yet
It works by
This setup is pretty complicated but it allows for virtual servers to run virtually anything and have configuration options for all of it.
I have yet to implement:
You can now add services through an API, using a generated client id and secret.
A server would call the API, passing a list of products to sync. You pass a name, description, unique code, a price and a pricing schedule (per hour, day, or month). You can also add addons with options, currently only text or numbers (e.g for additional RAM).
I also added a page to view all available services.
Next I’ll implement “getting” the service
Added an env variable (MAIL_ENABLE) that will disable any email sending and functions like verification. With this enabled, signing up will automatically mark the account as verified and sign them in, skipping the verify step.
Did this so I can develop entirely locally and without internet, I’m on holiday in the Outer Hebrides where internet isn’t great. Writing this on a 7 hour ferry
Also changed the flags field from bigint -> integer to save space, I won’t need 64 bits)
I added a page to view, manage and create API clients. This is what the past couple of devlogs have been leading up to, there was a lot of interactivity required for this.
These will be used to programmatically set up “virtual servers”, which will be able to register “products” to the platform, and receive services to deploy, and they manage where to deploy them, for example on the current server, or provision a VPS, or to GKE, or a docker swarm. I’m designing it to be as flexible as possible.
I also added a copy button component
Need to implement actions next, probably just delete
I added tables and modals to my UI library. I needed these for my next platform update.
Tables were more annoying to implement than you’d expect, the browser makes them pretty hard to style.
Modals on the other hand were pretty quick to implement, I just used my existing card component.
My UI library is coming together pretty quickly, I’ve now implemented most of the components you’d need for a interactive website!
I added a sign in page, implemented session tokens, and fixed a few bugs
I also made it so you are automatically signed in after verifying your account. This is secure because a verification session is only made after signing in or creating an account.
Honestly I thought this would take longer to implement, but I have done this a million times before.
Next I’ll implement the account page.
When you create an account, an email with the verification code gets sent.
You are redirected to a verification page, where you can enter the code, submit and your account gets marked as verified.
The page after verification is not implemented.
To do this, I:
Next, I’ll implement signing in (with sessions)
I built a verification page (server side stuff not implemented yet) and to do this I build a custom code input.
It automatically focusses the next input when typing, or the previous when backspacing.
I also added support for pasting codes. In the video demo, after pasting the focus doesn’t go to the last input but I have since fixed this.
Next up, I’ll set up SMTP with AWS SES and get verification working on the server side.
There a fair bit of set up involved with this.
I had to:
So now you can create an account. You can’t do anything yet, and I need to implement the next step of the flow, which is to verify your email.
Currently the minimise sidebar button doesn’t work.
I also need to add a section for bottom links.
Forgot to mention in my previous devlog, some time wasn’t tracked because I was experimenting with the helix editor.
Also, this project is only using CSS, not tailwindcss. Although tailwindcss is nice, I miss CSS selectors and I find it a bit silly to have a build step for CSS.
I started working on a UI library. For my other projects I wrote the UI from scratch, where I was repeating a lot of code, or used Daisyui, which I never really liked the look of.
So instead, I’m writing my own UI library for templ (a templating language for golang) so I can get it right this time.
So far I’ve added buttons, button rows and cards, and a “kitchen sink” demo.
There are three types of buttons, primary, secondary and accent, with nice animations.
Button rows can also be aligned left, right, or center.