RSSAmplifier

Blog

Francisco Sousa's blog

My thoughts on making computers do stuff.

jfranciscosousa.comRSS feed ↗14 posts

Latest posts

Leveling up your web apps with Zod and ChatGPT

It's been pretty much a year since ChatGPT became available to the general public. Time goes pretty fast. Today, OpenAI's products are better and faster than ever, and the competition is pretty healthy with alternatives like Anthropic and Bard. A lot of tech companies across the industry are either pivoting to AI or extending their products with AI features. This leaves us, the engineers of said…

Validating environment variables with zod

This is a quick blog post to showcase something I've seen in some frontend starter repositories, namely create-t3-app . Environment variables and .env files are the de-facto way of configuring JavaScript web applications. Most meta-frameworks, such as Next.js, Svelte Kit, and others, support them out of the box, allowing you to have one or multiple .env files for your projects. Some frameworks…

Using zustand with Svelte

zustand is an excellent library primarily used in the React community. It's my go-to choice for any shared state management in React due to its ease of use, and for being a solution to most shared state issues like zombie childs , react concurrency , and context loss between mixed renderers. For these same reasons, I also started using it in some Svelte projects. I like how short and simple most…

Typing remix loaders with confidence

Well, hello there, it's time for a lightning-quick Remix tip. Let's see how we can genuinely write typesafe Remix routes by sharing types between loaders and components for full-stack typing! Remix, what? For the readers unfamiliar with Remix, it's a React framework created by the react-router team. It uses react-router to make a server-rendering full-stack framework with React support. It's the…

Locale detection with Remix

Lately, I've been fooling around with remix.run and server rendering apps instead of client-side only stuff. However, whenever I use things like toLocaleString from the Date API, we get shifting date formats on the frontend, and Text content did not match errors from React. This warning often happens in either Remix or Next.js, or any SSR (server-side rendering) React-based solution. Let's see why…

Authenticating things with cookies on Next.js

Originally posted on Finiam's website . Please click here to skip all of the backstory behind this blog post and jump straight into the code ! A while back I made a blog post on how to manage user authentication on React apps. It's a task I've made time and time again and decided to share this with you folks. That blog post is aimed at single-page apps obviously, but nowadays we are seeing more…

Predictable React authentication with the Context API

Originally posted on Finiam's website . Despite there being many React and authentication tutorials out there, I feel like I showcased this to too many people I mentored over the past few months, so, this is a good time to share it with a greater audience. Authentication is an app-wide concern, and therefore a global state issue. For many, keeping global state in React is a tricky task, however,…

Next.js and Airtable: a tale of empowering no-code tools

Originally posted on Finiam's blog . Back in June, we received a request to help build a website for an academic non-profit organization (our friends at AAUM ), in Braga, Portugal. They needed a website to help spread awareness of the MinhoCovid19 movement, a group of people trying to supply organizations in need (nursery homes, hospitals, etc) with protective materials built by volunteers. Their…

Reactive Rails applications with StimulusReflex

Originally posted on Finiam's website . A while ago I made a blog post about the modern web with just Rails (and a few other things). Today I'm going to explore another way of doing awesome things with Rails, in the spirit of the modern, reactive, and real-time, web. Let's explore StimulusReflex, an extension to the amazing library made by Basecamp, to make server-side reactive applications. So…

Spicing up your Rails frontend experience

Originally posted on Finiam's website . Rails is great. You can still check DHH's 15-minute blog demo and just appreciate the combination of features and ease of use of the framework. Even though there are even easier ways to make a blog nowadays (cough cough Gatsby), Rails is still a rock-solid choice for crafting digital products. Rails and the modern web Despite being a Rails advocate, I mainly…

Building and hosting a Discord bot

Discord is one of the premier instant communication platforms on the web right now. Free, easy to use, and just cool, Discord is one of the main hangout apps for gamers, developers, and just overall tech people. One of the coolest things about it is the ability to install bots on your servers that make some cool stuff. Bots that play music, text-based RPGs, dice rollers for RPGs (I made one), meme…

Let’s slim down on Javascript

Originally posted on Finiam's website . The ancient narrative of "Javascript bloat" is ever-present in the tech world. Web developers love Javascript, backend developers hate it and end-users usually don't give a damn about it as long as websites open fast, work as they should, and do not spy on them. Still, web pages have way too much Javascript, especially SPAs, that could be avoided with just a…

Dealing with webfont loading

The time has come to implement a beautiful website design. It has a great Webfont. So you go to Google Fonts or Adobe's Typekit or you just buy one and self host it. But once you start writing code and previewing its results, you notice one little pickle: the whole website shifts, flashes, and janks all over the place when refreshed or opened from a cold cache. It ain't pretty. Let's see how we…

A primer on the JAMstack

Originally posted here on my previous, but very nice, company Aurora Digital . Our own website is a product of the JAMstack. Perhaps you have heard of it if you are a web developer, and if you are not, then this will probably remind you of that jam that your aunt gave you and you never even tasted it and how it's probably full of mold right now. Nevertheless, the JAMstack is not another boring…