Live data from Hacker News

Ask HN: What novel tools are you using to write web sites/apps?

news.ycombinator.com

161–170 of 333 posts

Re: Ask HN: What novel tools are you using to write web sites/apps?

#161
I wanted something novel for my "website" so I used a few websocket tunnels, xterm.js and User Mode Linux to make a rather quick booting Curses Dialog menu as my main website [1].

It was a fun challenge to secure it and make sure it doesn't get overloaded, as its on a cheap 30$/yr VPS. since UML doesn't need any CPU extensions, it just about works anywhere.

You can read a little but more about how I built it under the "UML" menu [1].

[1] https://jrwr.io

Re: Ask HN: What novel tools are you using to write web sites/apps?

#162
I have been building react frontend and golang backend (go-gin to be specific) recently. However, post compilation of react app, I use go-bindata to convert it into a golang embeddable asset and service it via specific route in go-gin, For instance (/#/ or /) is there frontend is located and (/api) is there the api endpoints are located. In this way, you can actually distribute the app with just one binary. Downside is that it is a complicated workflow and takes quite sometime to compile.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#163

Just finished working on the first iteration of a website for my mom. I didn’t want to deal with a full classical CMS and maintain Databases and such, especially as my experience with wordpress, PHP and typo3 has faded a little bit. My mom’s website is basically a directory of old mansions in former eastern Prussia. Site is in German: https://gutshaeuser-ostpreussen.de Anyhow Stack chosen: Backend/CMS as a Service: h…

Regarding Prismic lockin: Have you checked whether the exported .zip contains the entire media library?

Regarding SEO: If you (i) host the Cormorant Garamond font locally and inline its CSS, and (ii) use srcset to serve a smaller hero picture on mobile, you will probably achieve a 100/100 score in lighthouse.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#164
post #148

This partially might be more of a what's old is new again, but here's what I use: - 100% server side rendered - Progressively enhanced (fully works without JS, but having JS enabled makes it nicer) - In select places where I need SPA-like snappiness I use a ~100 line long DOM diffing algorithm (I request full HTML through AJAX and diff it into the current page; if the user has no JS enabled then the page just refresh…

How do you deploy changes? git hooks or something like ftp?

Basically it's more-or-less this:

1. Compile the binary.

2. SCP it to the server.

3. Restart the running process.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#165

Earlier quoted context omitted.

Currently 4.29 EUR/month VPS on Hetzner. (Although I have some fun features planned and might need some more processing power so I might upgrade in the future.) They have great AMD-based VMs, 2x perf/$ over Intel. (I've benchmarked.)

what benchmarks do you use? I'm curious how my VPSes compare.

It was quite some time ago so I don't remember exactly, but I've basically used one of the usual benchmarks that everyone uses to measure the number of requests per second that a server can sustain.

(I've rented another VPS in the same data center and ran the benchmark from there.)

Re: Ask HN: What novel tools are you using to write web sites/apps?

#166

I worked as a full-stack developer up until 7 years ago. Evaluating different options for my new website, I ended up just using what I'm familiar with: raw, vanilla PHP, HTML, CSS, and JS. Eliminates the need for any faff like server management on my part; PHP-enabled hosting is cheap and easy. No frameworks, just PHP. Not that novel, I know. There's a stark difference in research and production in terms of output, f…

We’ve got a similar setup. To add to what you said, PHP scales horizontally remarkably well because there’s naturally no cross-request state, so when you hit a certain point you can just throw another identical server into the mix.

We run autoscaled ec2 instances behind an AWS load balancer and Aurora but manage to keep a pretty simple PHP app serving millions of students a day.

For some of the more CPU intensive work we have a couple Go micro-services in the mix. Go is well worth anyone’s time to learn imho, it’s a very nice mix of powerful and easy to learn.

TypeScript in strict mode also keeps your JavaScript honest which I appreciate.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#167
Kotlin & Fritz2. I had to make some difficult decisions with the startup I'm a CTO of last year. I had a pretty junior team that knew Android, Kotlin, and a bit of server side Kotlin. Then for various reasons we decided to do web, Android, and IOS. So, web based development was a foregone conclusion as we did not have the bandwidth to ramp up separate teams. I did not have the resources to grow the team. And I did not want people to get side tracked learning a lot of new things.

Normally, I would have gone down the typescript + react route. I'm a backend developer but I've done some frontend projects with it before. But I was the only one on the team with relevant skills here.

So, instead I salvaged what I had which was lot of Kotlin know how in the team, a Kotlin multiplatform library that we built for Android already (api and model classes), and a Kotlin backend. So, I took a calculated risk of picking Kotlin-js as the main way to do our frontend.

I stumbled across a new framework called Fritz2 last year, which is written in Kotlin. I liked what I saw. We did a few spikes end of last year to check if it could do the job and worked as advertised (yes). Then we built a new web app with it in a very short time. I would normally not recommend people take that much risk but in our case it was defensible and it worked out great. In retrospect, we've been very fortunate as this is simply a very well designed framework. At this point we are very productive with it and have a feature complete app that we are putting in the hands of customers. Two months is not a lot of time to pull that off and I'm lucky with both the team and the technology we picked.

What do I like about this:

- It's just another Kotlin project. That means great tools, great language, and it happens to compile to javascript and run in a browser. We refactor at will, use nice Kotlin DSLs, have autocomplete for just about anything.

- Fritz2 is written by a small group of developers that know a lot about frontend development. So you get decent component technology (loosely inspired by react), everything is reactive by default (because Kotlin has great support for that), and they also integrated solutions for things like styled components, using and creating web components. So in short, it's a very modern feeling framework that should feel right if you are expecting clean code, components, and sane architecture.

- The Kotlin tooling for javascript is pretty great. It comes with lots of ways to integrate with the javascript world. E.g. we integrated leaflet and that was pretty straightforward: add the npm, adapt a few of the typescript mappings. Dukat which is the kotlin type mapping generator that does this automatically nearly worked but ended up generating a few problematic areas. So, I expect this to get better. But manually writing some mappings is not that hard.

- Kotlin StateFlows are a great way to represent state. Basically, components subscribe to state flows and respond to any changes you put there. This is a core concept that Fritz2 pushes hard with a concept of stores that store data classes and sub stores that you can derive from that for individual fields. It basically makes you do the right things with your state and you get very type safe and easy separation of rendering code and state management. If you come from Android, that's pretty much how things work there as well these days. Also, it's similar in newer frameworks like Swift UI and Jetpack Compose.

- Fritz2 uses kapt, which a compile time annotation processor, to generate code from model classes to make it easy to subscribe to changes in web components. That gets rid of a lot of boiler plate.

- It uses webpack underneath, which gives us a lot of flexibility for how we build our software. We also use cordova to produce native wrappers. With some plugins even.

- We use koin for dependency injection. And it's just as important of a design pattern in frontend as it is in backend code. Koin is what we used on Android and it's a great fit for Fritz2 as well. Nice testable code and we don't have a lot of Baron from Muenchhausen style self initializing code (like every messy js project I've ever seen).

Things I don't like that are long term fixable:

- The kotlin-js tooling still has some rough edges. It got a lot better with Kotlin 1.4. though. But undeniably, you will have to do some problem solving when dealing with this. Despite this, we pretty much hit the ground running with this and have not lost a lot of time over this.

- Source maps particularly seem flaky. So, debugging in a browser is a bit meh in a browser. If that matters to you, it's a problem for now. I expect this to get fixed as they improve the new IR compiler for kotlin-js.

- Performance of the build tooling and compiler is not great. In fairness, it's not a whole lot worse than the typical webstacks out there. It actually uses webpack underneath. But it's definitely not very fast. They do have incremental compilation and usually changes load in the browser after a few seconds. So, that keeps productivity high.

- There are not a lot of people doing this yet. So, you need to get creative solving issues. That includes reaching out to developers on the Kotlin slack, digging through OSS code to see how stuff works, etc. The community is very supportive. But if you hit a problem, Stackoverflow does not have all the answers just yet.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#168
This is the first thread in a long while that's given me a lot of FOMO anxiety. I've made a lot of one-off server-side rendered apps in Flask, and right now I'm doing some backend work ASP.NET Core for my job, but I have this overwhelming feeling there's so much I don't know and I'm not sure where to start. I only bring this up in case I'm not the only person sharing these feelings.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#169
post #150

Earlier quoted context omitted.

It's really nothing special. I wrote the whole thing in, like, a single afternoon. If you're interested, here it is: https://pastebin.com/V7UiWj1e It's not really a general purpose diffing algorithm. It probably doesn't handle every corner case as it only does what I need it to do in the few places I actually need it.

Would you even need diffing if, for example, the relevant nodes had an ID functionally derived from their contents?

Sorry, I'm not sure I understand your question?

Basically, I use diffing because it's simple. I don't want to mess around with manually updating whatever content I want to update, and I don't want to be forced to generate a specially crafted piece of HTML so that it's updatable. This way I only have to have only one function that updates the current page in-place by diffing, and I can use it everywhere I need to.

Re: Ask HN: What novel tools are you using to write web sites/apps?

#170
I switched to Elixir/Phoenix + LiveView for my stack.

- Content all markdown

- Tailwindcss for styling

- Phoenix provides a extremely fast framework

- No database at the moment

- CI/CD with github actions

- Automated deployments with Gigalixir

I switched to gatsby and I notice that I was spending more time fighting the system than writing.

You can check it out here: https://allanmacgregor.com/posts and the code is available here: https://github.com/amacgregor/amgr_phx

Post reply on HN