written by Matthias EndlerEvery once in a while my buddies and I meet for dinner. I value these evenings, but the worst part is scheduling these events!
- We send out a message to the group.
- We wait for a response.
- We decide on a date.
- Someone sends out a calendar invite.
- Things finally happen.
- I don’t want to have to create an account for your calendar/scheduling/whatever app.
- I don’t want to have to add my friends.
- I don’t want to have to add my friends’ friends.
- I don’t want to have to add my friends’ friends’ friends.
- You get the idea: I just want to send out an invite and get no response from you.
The nerdy, introvert engineer’s solution
💡 What we definitely need is yet another calendar app which allows us to create events and send out an invite with a link to that event! You probably didn’t see that coming now, did you? Oh, and I don’t want to use Google Calendar to create the event because I don’t trust them. Like any reasonable person, I wanted a way to create calendar entries from my terminal. That’s how I pitched the idea to my buddies last time. The answer was: “I don’t know, sounds like a solution in search of a problem.” But you know what they say: Never ask a starfish for directions.Show, don’t tell
That night I went home and built a website that would create a calendar entry fromGET
parameters.
It allows you to create a calendar event from the convenience of your command
line:
How I built it
You probably noticed that the URL contains “shuttle.app”. That’s because I’m using shuttle.dev to host the website. Shuttle is a hosting service for Rust projects and I wanted to try it out for a long time. To initialize the project using the awesome axum web framework, I’ve usedWriting the app
To create the calendar event, I used the icalendar crate (shout out to hoodie for creating this nice library!). iCalendar is a standard for creating calendar events that is supported by most calendar apps.How to return a file!?
Now that we have a calendar event, we need to return it to the user. But how do we return it as a file? There’s an example of how to return a file dynamically in axum here.- Every calendar file is a collection of events so we wrap the event in a
Calendar
object, which represents the collection. impl IntoResponse
is a trait that allows us to return any type that implements it.CalendarResponse
is a newtype wrapper around Calendar that implements IntoResponse.
CalendarResponse
implementation:
Response
object and set the Content-Type
header to the
correct MIME type for iCalendar files: text/calendar
. Then we return the
response.
Add date parsing
This part is a bit hacky, so feel free to glance over it. We need to parse the date and duration from the query string. I used dateparser, because it supports sooo many different date formats.
Add a form

Deploying
https://zerocal.shuttle.app
.
Now I can finally send my friends a link to a calendar event for our next pub
crawl. They’ll surely appreciate it.yeahyeah
From zero to calendar in 100 lines of Rust
Boy it feels great to be writing plain HTML again. Building little apps never gets old. Check out the source code on GitHub and help me make it better! 🙏 Here are some ideas:- Add support for more human-readable date formats (e.g.
now
,tomorrow
). - Add support for recurring events. Add support for timezones.
- Add location support (e.g.
location=Berlin
orlocation=https://zoom.us/test
). Add Google calendar short-links (https://calendar.google.com/calendar/render?action=TEMPLATE&dates=20221003T224500Z%2F20221003T224500Z&details=&location=&text=
). - Add example bash command to create a calendar event from the command line.
- Shorten the URL (e.g.
zerocal.shuttle.app/2022-11-04T20:00/3h/Birthday/Party
)?