News for hackers. Stuff that matters.
Re:Ask HN: Who wants to collaborate? by mg on Saturday January 01, 2022 @10:37AM (#29759306)
Hey, I want to put together an open source project that gives an overview of how to set up a minimal viable web application from scratch via all the different frameworks.

The idea is to format the tutorial for each framework as a shell script. So there is no ambiguity of how to reproduce the results. And it is even possible to just copy&paste the steps into a docker container and see the framework in action.

Here is a demo of how this could look like for Django:

https://www.gibney.org/from_debian_to_web_app

It would be cool to have one column for each framework and then align them visually by feature. So if you want to compare how do you use a template, you can look at the "Let's use templates" row and have a quick overview of how it is done in Django, Laravel, Flask, Symfony, NextJS...

Each framework section could link to the developer(s) who wrote it.

If you want to contribute to the section for your favorite framework, send me a message!

Re:Ask HN: Who wants to collaborate? by alexharrisnyc on Saturday January 01, 2022 @04:04PM (#29762767)
Seems like a great idea, what exactly is the MVP? I've thought about doing the same from time to time, doing as shell script seems like a nifty idea but possibly a little more work for the author. Curious if there are multiple steps adding to the same file how you would approach that.
Re:Ask HN: Who wants to collaborate? by mg on Sunday January 02, 2022 @03:15AM (#29766847)
My idea is that the script contains the basic steps which building an MVP usually contains: setup, routes, templates and user accounts.

From there on, it is up to the developer to add their own design and functionality. After you understand the code for setup, routes, templates and user accounts this should be easy.

As for mutliple steps adding to the same file, I think overwriting the whole file every time is doable. For example when we introduce the concept of a template, the template can be created like this:

    cat << 'EOF' > templates/index.html
    <h1>Hello World</h1>
    EOF
Now say later we want to use a base template which contains a content block. Now we modify the template to extend the base template:

    cat << 'EOF' > templates/index.html
    {% extends "base.html" %}
    {% block content %}<h1>Hello World</h1>{% endblock %}
    EOF
Re:Ask HN: Who wants to collaborate? by cercatrova on Saturday January 01, 2022 @05:49PM (#29763701)
Looks like you're basically looking for TodoMVC and Real World. TodoMVC is a simple todo list implemented in various frameworks while Real World is a more complex real world app, a blog style social media site.

https://todomvc.com/

https://github.com/gothinkster/realworld

Re:Ask HN: Who wants to collaborate? by mg on Sunday January 02, 2022 @03:24AM (#29766888)
That is a bit of a misunderstanding. I do not want to build a collection of repos or projects which the user can read through or try out.

My whole project is just one page!

The page displays multiple scripts side by side.

One script per framwork.

Each script can turn a fresh Linux installation into a working web application with routes, templates and user accounts.

Re:Ask HN: Who wants to collaborate? by cercatrova on Sunday January 02, 2022 @03:29AM (#29766921)
Ah that makes more sense now. So you're basically writing docs for all these different tools such that someone can copy paste and get a working installation.

What are your thoughts on docker which seems to do something similar? Also, how would you stay updated on every single framework if they ever change their installation scripts or other such parts?

Re:Ask HN: Who wants to collaborate? by mg on Sunday January 02, 2022 @03:42AM (#29766981)
I wouldn't say that Docker is doing something similar. What I want to do is give a one-page overview of the web framework landscape.

Since I envision the scripts to be very small, I expect that updating them will not take long. The history of the updates will indeed be very interesting. In 10 years we can look at it and see how often each framework had breaking changes.

Re:Ask HN: Who wants to collaborate? by cercatrova on Sunday January 02, 2022 @03:45AM (#29766994)
Makes sense. I mean docker as in dockerfiles which are essentially scripts that create the docker image as a full environment.
Re:Ask HN: Who wants to collaborate? by mg on Sunday January 02, 2022 @03:57AM (#29767054)
Yes, Dockerfiles usually set up an environment suitable for certain tasks.

So instead of using debian:11-slim as I propose, one could use a Dockerfile made for Django. But that would help very little. Django even abandoned their official Dockerfile because it brings so little to the table.

In my opinion, using a higher level Dockerfile than the bare OS is a net negative. The developer won't know how much magic it hides. Even though it just hides a few lines of code. And being higher up in the stack also means stuff will break more often and the scripts need to be updated more often.

Re:Ask HN: Who wants to collaborate? by josefrichter on Tuesday January 04, 2022 @01:46PM (#29798391)
Re:Ask HN: Who wants to collaborate? by slotrans on Saturday January 01, 2022 @04:52PM (#29763224)
Are you familiar with https://github.com/TechEmpower/FrameworkBenchmarks ?

It's not tutorial-style, but it does contain hundreds of sample web apps (that all do the same thing, but still)

Re:Ask HN: Who wants to collaborate? by mg on Sunday January 02, 2022 @03:27AM (#29766905)
Looking at those, it seems the sample apps are way more complex than what I envision. The Django one starts with these dependencies:

    Django==3.1.12
    greenlet==0.4.17
    gunicorn==20.0.4
    meinheld==1.0.2
    mysqlclient==1.4.6
    psycopg2==2.8.6
    pytz==2020.4
    ujson==4.0.1
The approach I want to show is: What are the minimal steps to get a working web application with routes, templates and user accounts. I know that at least for Django, this is possible with no additional dependencies.
Re:Ask HN: Who wants to collaborate? by gukov on Saturday January 01, 2022 @05:46PM (#29763670)
Have you seen https://todomvc.com/?
Re:Ask HN: Who wants to collaborate? by collabtwy532 on Saturday January 01, 2022 @03:02PM (#29762071)
Neat idea. Interested in this as a user - will reach out :)