Frederik Handberg's avatar
Frederik Handberg
npub1nj0c...2gqz
23 🇩🇰 Studying for a degree in Software Engineering while building fun projects and working freelance as a News Photographer 📷 I share my software projects, photos and videos from my work as a news photographer, and progress updates as I learn to sew garments. Basically, I just write about my hobbies. frederikhandberg.com
I think I have screwed up with my state management in my Swift notes app. I can’t get a view to update immediately. Every time a change happens, the user must go back and forth between views before the change is reflected in the UI. Done some research, and it seems like my problem is a classic Swift problem known as “the nested Observable Objects issue”. #swift #dev
Found this hole today while walking the dog. Wonder what’s living down there 🤔
I completed an assignment today for my WEB2 course. The assignment involved developing a web application that displays all Pokémon. Users could then click on a Pokémon to view detailed information about it. #dev
I improved the tab bar to switch views in the sidebar. Additionally, the search functionality now works quite well. I implemented it so that the letters matching the search query will be highlighted. I need to implement a new separate window for settings. I think it’d be a really cool UX if the user could simply swipe between the different tab views in the sidebar. #dev #swift
Police operation near Sejet between Horsens and Juelsminde. Multiple arrests. #press
I finally have the empty tabs mostly functional for my notes app. (I’m building a notes app to learn Swift and how to develop apps for MacOS) I still need to figure out how I can implement the necessary functionality to allow the user to drag the tabs so they can be rearranged – similar to how it works in Chrome and other browsers. Still have a LONG way to go before the app is fully functional, but I’m making a bit of progress each day. #dev #swift
Bicyclist hit by semitruck. The bicyclist is reportedly in critical condition. Intersection of Ringvejen and Thorsvej in 8700 Horsens. #press
Frederik Handberg's avatar
frederikhandberg 10 months ago
Today, I’ve been making some fake profiles for my social media portfolio project and generating some content for their profiles (posts, comments, etc.) Tomorrow, I will be taking screenshots of the platform and writing about the platform for my personal website. Basically, I want to write about the features of the platform, struggles I had developing the platform along the way, future improvements that could be made, and so on. It should be a personal website I include a link to in my CV. #portfolio #internship
Frederik Handberg's avatar
frederikhandberg 10 months ago
Can't wait until summer... Been cloudy and gray all day, but finally the sky is clearing a bit. image
Frederik Handberg's avatar
frederikhandberg 10 months ago
This afternoon I’ve been working on implementing the notification system in my portfolio project. I settled on using Socket.IO running in an Express server. I had to do some restructuring as I did not want to implement a custom server running Socket.IO directly inside of NextJS. Because then I lose Turbopack (I think if I understood the docs correctly). So I made two directories in the project: - `client/` for the NextJS project - `server/` for the Express and Socket.IO It’s up and running. One of the notifications is when a user publishes a new post. That’s the only one working currently, but the plan is to implement more notification types. It takes a little while before the notification is received. Not sure why. I did a project in last semester of my SE degree where we used SignalR connected to Blazor, and the notifications were received instantly. I want this NextJS and Socket.IO project to be the same. I’ll have to tinker with it tomorrow. Also need to make the notification UI nicer. #dev #NextJS #SocketIO #NodeJS #portfolio
Frederik Handberg's avatar
frederikhandberg 10 months ago
Today I found out about mini cop cars! They are so adorable. Basically, they are miniature model cars that are identical to the real-world police vehicles. I just bought myself two Ford Explorer Police Interceptor Units in white and black respectively. Haven’t purchased lights for it yet, still need to do some research on that. Pretty cool that there is a whole community of people building these. Think it’d be a fun project and hobby to learn building these diecast models. #hobby
Frederik Handberg's avatar
frederikhandberg 10 months ago
Primal and Damus should allow sending delete requests to relays. It’s annoying having to go to some other client to delete notes.
Frederik Handberg's avatar
frederikhandberg 10 months ago
Yesterday, I made some progress on my portfolio project. Now, the change password option in settings is working. I made a dialog where the user will type their current password, the new password they want (must meet some requirements), and confirm the new password. I implemented two new API routes: - `/api/account/verify-password` - `/api/account/update-password` I also implemented two React Query hooks: 1. `useVerifyPassword.ts` 2. `useUpdatePassword.ts` I still need to implement a way to reset the password when logging in. I will of course just reuse the API routes and hooks that I just made, but they will need to be adapted a bit, since the user must identify themselves by username or email. In the real world, the user would need to type their email to reset their password. Then they would receive a one-time password, with a four digit code or a magic link. But since this is just a portfolio project, it seems like too much to set all that up. So, I’m just going to require the user to type their username or email, and if that user exists in the database, they will be allowed to enter a new password. #dev #portfolio #NextJS
Frederik Handberg's avatar
frederikhandberg 10 months ago
Using Next Auth for my portfolio project was a mistake. My authentication system uses email/username and password. The problem is that Next Auth strongly discourages developers from using credentials and instead pushes them to use OAuth. I should have used Better Auth instead… #dev #BetterAuth #NextAuth #NextJS
Frederik Handberg's avatar
frederikhandberg 10 months ago
# Quoting a Post For my social media network portfolio project, I am taking a different approach to quoting posts. Originally, I had a `/quote-post` page separate from the `/create-post` page. However, this didn’t make much sense because quoting a post is essentially creating a post. So, I have removed the `/quote-post` page and integrated all quoting functionality into the `/create-post` page. One feature I want to add is allowing users to quote multiple posts within the same post they are creating. Quoting a post is simple, just paste the link to the post, exactly like on Twitter/X. However, if a user pastes a link to the same post multiple times, it should only count as a single quote.