Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Nettu Scheduler – A self-hosted calendar and scheduler server (github.com/fmeringdal)
129 points by fmeringdal on March 29, 2021 | hide | past | favorite | 26 comments



From my experience it is a common mistake to do overlap comparisons of intervals this way.

https://github.com/fmeringdal/nettu-scheduler/blob/df737e128...

IMO start time should be treated as inclusive, and end time as exclusive.

E.g. an event from 1pm-2pm does not overlap with an event starting at 2pm because it's end-time is defined as exclusive.

Therefore you need to replace one of you greater/lower-than's with a normal greater/lower comparison operator.


Thanks for your feedback! I will look into it :)


No problem. Took me 2 min to find it. I actually searched for the term "overlap" to see if you're doing it correctly ;)

At least you're using one if statement. Many do interval overlap comparisons with two if statements.


Haha! I must admit that I also did two if statements the first time I implemented overlaps ;)


Very cool, and nice to see more options here (especially open source ones). I remember looking five years ago, and being very surprised that there was no Stripe-equivalent for adding scheduling to an application.

Between this, https://www.timekit.io/, and https://www.spurwing.io/ (which is my project), hopefully people will stop re-inventing the scheduling wheel with each project.


Your project looks awesome, thanks for sharing! And yeah, hopefully new booking apps will have a lot of better options now than implementing the scheduling stuff themselves.


I would love to be able to use off the shelf software, sadly I have to integrate with an internal prosumer software. It's ugly to say the least to get the data, there's no proper sync flow, it's heavily rate limited... And I have no control over it. I would love to move the scheduling outside this software, but sadly it handle other part of the logistic flow needed (book some items, get ready the work order...)

So yeah. Booking is dead simple. If you don't have a complete logistic flow added on top of it.


Does this support CalDav? I'd be more interested in a self-hosted calendar with CalDav integration. Then for appointments/scheduling, utilizing a separate calendar designated to a single or multiple other calendars that looks for free/busy information.


It does not support CalDav right now. The reason being that I didnt need CalDav when i developed the project. That being said, a lot of people have asked for CalDav support after I launched so it is going to be a prioritized feature moving forward.


This is nice. It gave an insight about something similar that could be developed as an extension to WMSes (warehouse management systems) in use by Logistics Operators.

The product would work as a openly accessible integration layer to the WMS -- which is usually hard to integrate to any system. Customers or partners to this warehouse could use the SDK to develop integrations on their side to favor inter company workflows or even brand new products that would rely on that warehouse somehow. Business model could be similar to Bitnami's plus customer support plans.


That sounds like a great idea!


OMG too funny just today posted on show a new my graphql calendar api. hated what I found when we needed to schedule in-app appointments. so I ended up creating my own http://www.ezcaldev.com

looking forward to learn more about this one


Apparently your show hn was killed - not sure why?

https://news.ycombinator.com/item?id=26627450


Thats awesome! Is it open-source? Would love to see how it works internally and see how it differs from my implementation.


I implemented a similar thing myself at my current job. How did you deal with events that happen once a week and someone creating an event in 2020 and one for 2024 every monday let's say. Do you project the recurring events into the future and see if they overlap?


Cool! I would be happy to explain the internals of the projects. Do you mind reformulating your question? I am not sure I understood it correctly...


This is great. It almost handles a use case I’ve been looking for which is a slimmed down version of Calendly. Basically merge multiple personal/work calendars into a single free/busy calendar I can share with my wife/family.


Hi, there is a get user freebusy endpoint in the api that allows querying free busy information on a given set of calendars owned by that user. Is that what your are looking for? If not, would you like to create an issue in the repo which describes your needs? :)


Yeah. I want to combine multiple cals into a single cal with only free/busy that i can then publicly share/ give out to my friends/family


I am trying to build a SAAS service for booking services. One of the engineering issues I ask myself is if the following will become an issue in the future: do I save all the options of slots available I show each customer in the database or do I just calculate the slots virtually and save only the confirmed bookings?


May I ask you why you would want to store booking slots? I think the right approach is to recalculate available booking slots everytime (via the nettu-scheduler api) a customer asks for it. And then also store the confirmed booking timespan as a calendar event in nettu-scheduler so that the instructor will not be bookable again during that time. You can have a look at this example: https://github.com/fmeringdal/nettu-scheduler/blob/master/ex...


Well, I was thinking of saving the booking slots presented to the customers for data purposes. Also, I was thinking that it might help to store the presented slots in case someone else books it before the person decides to reserve. This way eliminating the option in realtime might be easier and without having to recalculate all the remaining available slots again? But maybe there is a better solution to this....


Do you know of a service that would handle user payments of selling booking/tickets?


You might try out calendly, I think they can handle payments


This looks great - can I ask what the motivation was for creating and open sourcing it?


Thanks! Essentially I had two separate booking projects that I was working, and instead of duplicating the scheduling and calendar logic in both of them, I decided to create a central server which would be able to do all the hard and repetetive tasks and also not make any assumptions about their data models / query patterns.

Also it seems like booking applications have increased in numbers during covid and I think this server would be really useful for creating a booking app without having to either implement all scheduling algorithms yourself or using something like Calendly which sticks its logo everywhere in your app and makes assumptions about your data model.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: