Time to cook the Web!
Writings about things that will help you to develop for web. The website aims to be straight to the point instead of poems.
There is a man behind it: Contact the man, X, Portfolio
Cloud
I am interested in building own cloud, that could be hosted on own hardware. Aka everyone-loved automated deploys, ideally with 0 downtime. As well as optimize and squeeze performance from their own hardware.
For example, the current setup of my homelab uses NixOS with systemd services instead of Docker containers or virtual machines. Because isolation is mostly a requirement of the cloud, as they need to serve many people, but if you own your hardware or VPS, then there is no one except you anyway.
List of services' links that run on my home cloud. They are only available when I am awake and turn that old laptop on. Because I currently can't run homelab fulltime, but plan to soon with electricity shutdowns prevention (run electricity through batteries).
- cloud.cookingweb.dev - Place where cloud UI must come later
- feedhub.cookingweb.dev - Feedback app that uses GitHub issues as store
- pocketbase.cookingweb.dev - Pocketbase instance
Articles
Old laptop to server
I got an old laptop for free and using it as a home lab. So as a web developer the first thing I want to figure out is how to use own hardware to host servers. I created a `deploy-tool` repository where I keep files for tests of deploying websites. I decided to try with Nix Shell instead of Docker, so I get to squeeze more resources out of computer. But here is overall steps to do it (at the current limit of my knowledge): - build web application - install dependencies on server (done with Nix Shell in my case, can be done with Docker or just apt) - run application on local network, not only single machine (aka 0.0.0.0 or explicitly local ip, like 192.168.31.10) - now you can access your website inside of local network - go to your router and forward router's port 80 for TCP to the ip of your server and port that app is running on - your probably want to forward port 443 for HTTPS - now you should access your website with public IP address, [check whatismyip.com](https://www.whatismyip.com/) to find out. That's what I currently was able to achieve. Next steps will be setting up a reverse proxy, so I can host more than 1 public website on single IP. As well reverse proxy like [Caddy](https://caddyserver.com) can handle SSL certificates for my. Potentially you can buy several static IPs and point each one for each application instead of using reverse proxy. It's not a bad idea, especially if your internet provider gives you quite cheap IPs (mine is 1$ for IP in Ukraine). After I will be able to use existing tools I plan to create own tool to make it all more simpler/automated than it's currently is. Maybe even competitor to [Coolify](https://coolify.io) and [Kamal](https://kamal-deploy.org). We will see.
Progressive enhancement
Progressive enhancement is mostly when users without JavaScript can get a good experience, and with JavaScript, even better one. It can also be applied to some modern CSS features.
It allows for reaching more people, because JavaScript can be unavailable. Here is a good article about it: A handful of reasons JavaScript won't be available by Piccalilli.
To develop Progressive enhancement websites, you want to start by implementing the main functionality without JavaScript. The website should be working fine without it. After this gets done, you can use JavaScript to add additional helpers and so on. HTMX style (when you return partial HTML from the server) can come in very handy as you will be able to remove additional logic from your JavaScript.
Progressive enhancement will not only make your website accessible to more people, but it will also make it simpler. You will not blow up your client with a ton of JavaScript because you will value your time spent developing it. Reducing complexity can be called a side effect of Progressive enhancement. As well, it will force your designer to not create some stupid, unrealistic and pixel-perfect design.
SEO checklist
How to SSH
Eventually you will need to SSH at least a little bit. So here is simple guides for 2 most popular situations.
For Git:
- Generate SSH keys for your local machine (with some cli based on OS)
- Add public key to your git service (GitHub, GitLab, BitBucket, etc.)
- Clone project with SSH url or change url of existing local repo to SSH one
For connecting to remote server:
- Install OpenSSH or alternative on the server (probably preinstalled)
- Obtain IP address of the server
- Run ssh {username}@{id} from your machine
That's it, steps are easily searchable on the internet to get commands.