Live data from Hacker News

Zerocal – A Serverless Calendar App in Rust

endler.dev

31–40 of 64 posts

Re: Zerocal – A Serverless Calendar App in Rust

#31
post #22

Earlier quoted context omitted.

Do you even need a service for this? Couldn't this be a simple static HTML + minimal JS that opens a base64 URL with content-type "text/x-vcalendar"?

Not sure I understand because that's what it is basically. The Rust part is just for the routing; it decides whether to serve the form or the generated calendar file.

What they mean is that instead of using "serverless" hosting running a rust program to generate ics files you could literally just have a statically hosted html file that uses a couple lines of javascript to generate the ics files within the browser, so there would be no rust or server component at all.

You could just host it with github pages.

Actually I'm confused why you're saying:

> The Rust part is just for the routing

Because it appears that you're generating the ics files in rust?

Re: Zerocal – A Serverless Calendar App in Rust

#32
post #25

Earlier quoted context omitted.

Good question. It depends on your definition of serverless. Strictly speaking there is no serverless, there's always some infrastructure somewhere. However the calendar file gets created out of thin air from the GET parameters alone. There is no state or storage involved. Other calendar apps have a backend with a DB; this one doesn't. Now whether that counts as truly serverless is up to you I guess. It's as close as…

serverless is when you save the state but don't keep a machine sitting around when there are no requests, so you'd keep your calendar state in a hosted db and when someone asks for the calendar, a thread spins up and creates the calendar from the state and then disappears until there is another request. This is basically the exact opposite of serverless

> serverless is when you [...] don't keep a machine sitting around when there are no requests

FTFY

The key part of serverless is that you don't have a server idling around. Whether or not you use a hosted db is not relevant.

Re: Zerocal – A Serverless Calendar App in Rust

#33
post #22

Earlier quoted context omitted.

Not sure I understand because that's what it is basically. The Rust part is just for the routing; it decides whether to serve the form or the generated calendar file.

What they mean is that instead of using "serverless" hosting running a rust program to generate ics files you could literally just have a statically hosted html file that uses a couple lines of javascript to generate the ics files within the browser, so there would be no rust or server component at all. You could just host it with github pages. Actually I'm confused why you're saying: > The Rust part is just for the…

Got it. The generator logic is in Rust yes. I could have written it in JavaScript as well but it was just easier for me to do that part in Rust. Should have mentioned that. Of course you could host a static HTML with JS on Github pages, but Github pages also runs on a server. So to answer the original question, yes you do need some server for it unless you make it a command line app.

Re: Zerocal – A Serverless Calendar App in Rust

#34
post #33

Earlier quoted context omitted.

What they mean is that instead of using "serverless" hosting running a rust program to generate ics files you could literally just have a statically hosted html file that uses a couple lines of javascript to generate the ics files within the browser, so there would be no rust or server component at all. You could just host it with github pages. Actually I'm confused why you're saying: > The Rust part is just for the…

Got it. The generator logic is in Rust yes. I could have written it in JavaScript as well but it was just easier for me to do that part in Rust. Should have mentioned that. Of course you could host a static HTML with JS on Github pages, but Github pages also runs on a server. So to answer the original question, yes you do need some server for it unless you make it a command line app.

You can serve a static HTML page from anywhere. GitHub pages, S3, maybe even Dropbox. Running a Rust binary is an order of magnitude more complex than that.

Re: Zerocal – A Serverless Calendar App in Rust

#35

Earlier quoted context omitted.

serverless is when you save the state but don't keep a machine sitting around when there are no requests, so you'd keep your calendar state in a hosted db and when someone asks for the calendar, a thread spins up and creates the calendar from the state and then disappears until there is another request. This is basically the exact opposite of serverless

This can easily run on Cloudflare workers, you don't even need a server

... what do you think those are

Re: Zerocal – A Serverless Calendar App in Rust

#36

Earlier quoted context omitted.

serverless is when you save the state but don't keep a machine sitting around when there are no requests, so you'd keep your calendar state in a hosted db and when someone asks for the calendar, a thread spins up and creates the calendar from the state and then disappears until there is another request. This is basically the exact opposite of serverless

> serverless is when you [...] don't keep a machine sitting around when there are no requests FTFY The key part of serverless is that you don't have a server idling around. Whether or not you use a hosted db is not relevant.

And you may even use some 'serverless' DB services. Or not. The app is still serverless.

Re: Zerocal – A Serverless Calendar App in Rust

#37
post #33

Earlier quoted context omitted.

What they mean is that instead of using "serverless" hosting running a rust program to generate ics files you could literally just have a statically hosted html file that uses a couple lines of javascript to generate the ics files within the browser, so there would be no rust or server component at all. You could just host it with github pages. Actually I'm confused why you're saying: > The Rust part is just for the…

Got it. The generator logic is in Rust yes. I could have written it in JavaScript as well but it was just easier for me to do that part in Rust. Should have mentioned that. Of course you could host a static HTML with JS on Github pages, but Github pages also runs on a server. So to answer the original question, yes you do need some server for it unless you make it a command line app.

You need a browser and a file. In your example you need a server to make the file and and a browser.

Re: Zerocal – A Serverless Calendar App in Rust

#39
post #4
post #3

Earlier quoted context omitted.

Can it be self-hosted without relying on shuttle.rs? If yes, could you please update the readme with instructions?

It's just Rust, so it can be. Will add a `main.rs` and some instructions, but PRs are welcome if someone beats me to it. ;) https://github.com/mre/zerocal/issues/9

Update: self-hosting works now. Added instructions to the docs. Have fun.

Re: Zerocal – A Serverless Calendar App in Rust

#40
post #37
post #33

Earlier quoted context omitted.

Got it. The generator logic is in Rust yes. I could have written it in JavaScript as well but it was just easier for me to do that part in Rust. Should have mentioned that. Of course you could host a static HTML with JS on Github pages, but Github pages also runs on a server. So to answer the original question, yes you do need some server for it unless you make it a command line app.

You need a browser and a file. In your example you need a server to make the file and and a browser.

True, but for others to resolve the calendar entries you'd need to serve that file somewhere.
Post reply on HN