NeonDB Oct 2026
These sort of dayjs functions can also be seen in the `DayPicker.tsx` where its just dayjs functions that change the dates of the grids display.
All these where loosly based on previous experience from another project FamilyFlow where we did something simmilar with a huge calendar display.
3D PrintBooking
A booking management site I made for booking 3d printers featuring a interactive calendar.
The problem
When starting back at my job as a teacher at Tetiko I noticed an issue that where affecting the office, as we have 3 3d printers ready to use for our students, conflict and confusion would often arise from the booking system in place.
Calling it a “booking system” is a bit exaggerated since it was merely a whiteboard grid with columns for students to write their name, what printer they wanted to use and what time they started.
Not having an app in place for something as simple as this might feel a bit overkill to many of you but to me it was causing a lot of confusion and having to keep track manually of what student had booked when, and students not erasing their names off the list when they where done and issues with double bookings (double bookings and just erasing others names off the list where a primary cause for the conflicts I mentioned earlier).
Anyhow, with my new found fullstack experience I realize I could solve this and both put an end to all the arguments and also save my company some time by not having to manage a whiteboard, but instead just let the students handle everything through the app.
Planning an app that fits all
The planning stage was by far the most interesting part of this project, since there where several issues I needed to solve.
First and foremost, why should students want to use this app over the convenience of using a simple whiteboard that sat next to the printers?
My solution to this is a web-app (as usual), a web-app lets the user make bookings and see the schedule right from their computers or phones. Instead of having to head over to the 3D printers physical location to see if there where any available time slots.
Secondly, the UX needs to be really good and I have to spend some time at least on UX research. Mainly because of the age span and computer knowledge of our students. Some might be older, some might be younger, the UI has to reflect this and be approachable to both.
This also means that the mobile page needs to be just as intuitive as the desktop platform since younger students handle more operations on their phone than on their computers.
This also means that the mobile page needs to be just as intuitive as the desktop platform since younger students handle more operations on their phone than on their computers.
Decisions
So, my web-app idea would work, it would be reachable from both computers and phones, and I already had the knowhow on how to make it possible. Since I didn’t need any special features I decided on the following tech-stack.
- Next.js as the front-end. Not because of speed requirements but purely for familiarity.
- Neon Postgres, simply because the ease of use really. I needed the database to always be live and store a lot of daily information, and since I’m already familiar with postgresql this was an obvious choice. Another consideration was the price.
Since this was my initiative i had a 0 dollar budget for this, so my own neon subscription would have to do. - MUI (Material UI), this one was divisive. Because on one hand im familliar with it, I have used MUI in a large amount of projects now and it speeds up workflow so much. I alreadu had a theme from a previous project I had made for Tetiko so it where really easy to port it over.
But as the same time, this was my last project with MUI in quite some time.
Im starting to feel like im batteling the premade components more than I just “drop them in” and thats not how I want it to work.
Other than that I chose it because it had much of the acessability features I need.
Future projects I will start looking into Tailwind as my primary styling.
Challenging Time
After deciding on my technology I knew exactly where to start. I found an old project where I had already figure out the theme and brought that theme over.
I sort of knew the basic layout and the main idea was to have a huge calendar with the schedule in plain view so the site could work as both a booking tool and as a schedule viewer.
And that made the calendar the main challenge.
I could have done away with just using a library or a npm package for the calendar, but since I wanted it to be done like I had imagined it I decided to build it myself.
export function durationToHeight(start: dayjs.Dayjs, end: dayjs.Dayjs, displayDate: dayjs.Dayjs): number {
const gridStart = displayDate.hour(GRID_START).minute(0).second(0);
const gridEnd = displayDate.hour(GRID_END).minute(0).second(0);
const effectiveStart = start.isBefore(gridStart) ? gridStart : start;
const effectiveEnd = end.isAfter(gridEnd) ? gridEnd : end;
return Math.max(0, (effectiveEnd.diff(effectiveStart, "minute") / 60) * HOUR_HEIGHT);
}Codewise it wasn’t a brilliant solution. A lot of tricks with absolute positioning and getting the look and feel to be right. The whole logic is just mapping different time from dayjs to a grid.
const hours = Array.from({ length: GRID_END - GRID_START }, (_, i) => GRID_START + i);
export default function TimeAxis() {
return (
<Box sx={{ position: "relative", height: GRID_HEIGHT }}>
{hours.map((h) => (
<Box
key={h}
sx={{
position: "absolute",
top: (h - GRID_START) * HOUR_HEIGHT,
width: "100%",
pr: 1,
textAlign: "right",
bgcolor: "background.paper",
}}>
<Typography variant='caption' color='text.secondary'>
{String(h).padStart(2, "0")}:00
</Typography>
</Box>
))}
</Box>
);
}These sort of dayjs functions can also be seen in the `DayPicker.tsx` where its just dayjs functions that change the dates of the grids display.
All these where loosly based on previous experience from another project FamilyFlow where we did something simmilar with a huge calendar display.
Testing with users
This is something that I don’t have to think about that much with my own projects that acctually differs in this one. I had to test with actual users this time, who would be using this app.
So I ended up doing small tests with select students and they had to bring me feedback in a separate discord channel. I hooked it up with a webhook so i would see feedback beeing posted directly into a channel, that let me easily create Github issues from those requests.