Writing on modern web engineering, AWS Amplify, and building with AI.

Notes from real problems I’ve solved — Next.js and React, AWS Amplify Gen 2, auth and data modeling, web performance, and the practice of building software with AI — collected in chronological order.

AWS Cognito User Pool Attributes Cannot Be Changed: A Deep Dive.

User pool attributes cannot be changed after a user pool has been created because Cognito User Pool attributes are immutable after creation. Merging branches with different auth configs breaks deployments. Quick Fix: Delete the CloudFormation stack (aws cloudformation delete-stack --stack-name YOUR-STACK) and redeploy. Warning: this deletes all users. Prevent It: Define all user attributes and groups before your first production deploy. Use separate Amplify apps per environment instead of branch-based deployments.

Can't resolve amplify_outputs.json

To fix the can't resolve amplify_outputs.json build error add npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID1 to the build settings and attach the AdministratorAccess-Amplify policy

Free self-hosted web analytics with Umami, PlanetScale, Prisma and Vercel.

Having my own self-hosted web analytics with Umami, PlanetScale, Prisma and Vercel, is helping me compose a whole picture of my website's web analytics, without platform bias, with a simple and privacy focused solution, and free of charge. Additionally, because I am interested in the technical side, it has been a good opportunity to interact with SQL database alternatives like PlanetScale, Node.js ORM like Prisma, and deployments to Vercel. This guide covers how I adapted the Umami’s installation process to work with PlanetScale.

7 free resources to learn blockchain fundamentals.

This selection of 7 resources covers a broad spectrum of topics about blockchain, that explain it related to the real world, using academic and bootcamp formats. It includes materials from MIT, Berkeley, a16z, and Web3 Foundation. It is intended for people interested in the fundamentals of blockchain and decentralized finance.

6 free resources to learn Rust for beginners.

A list of resources that I am using to learn Rust. It includes videos, the official docs and blog posts. These resources complement each other, covering different learning styles and approaches to the language. I consider them to be beginners friendly and able to facilitate the learning in small chunks at the time. There is more than one way to learn the process of chewing glass with Rust, and we all have preferences. This list is not exhaustive, maybe it is biased. I will be updating it to include new findings and your recommendations.

Should I learn Rust or Solidity to develop smart contracts?

Web3 and blockchain technology are going to the moon. At the heart of this technological revolution is the smart contract. Programming smart contracts is not done in the same way and with the same technologies that we code traditional apps and websites. The two main blockchains that are competing for smart contracts developers are Solana and Ethereum. As a programming language for developing smart contracts (programs) in Solana you have Rust and for developing smart contracts in Ethereum you have Solidity. You can compare each programming language according to its transferable skills, madurity, learning curve, target blockchain size, tooling and prospect salaries.

The gig crypto-economy is coming to the console, phone, tablet or PC. Earn while you learn, play, create and socialize.

The labor-to-earn models has evolved to include many options like learn-to-earn where you accumulate crypto based on lessons and tests specific to a blockchain brand; participate-to-earn where you get rewards for your posts, likes and shares in social media like with Minds; create-to-earn where your creations are sold as some kind of collectible or NFT, like on OpenSea, or your playlist on Audius. Also you have a way to influence a cause of your concern, like climate change, in the Play-for-Purpose (PFP) modality with a game like Zeedz.

The State Initializer Pattern, explained by Kent C. Dodds

Kent C. Dodds' pattern for letting the users of a component or hook set its initial state and reset back to it later — the one downshift and ReachUI use. Here is the link to his original, plus the detail that makes it work.

React's key prop, explained by Kent C. Dodds

Kent C. Dodds wrote the clearest explanation of React's key prop I know, so rather than restate it here is the link — plus the one idea from it I reach for most: using key as a reset button for an element's state.

Asynchronous update of related items with AWS DataStore in a Next.js web app.

When working with AWS DataStore you have to deal with async/await operations. Updating a list of items when the order of async operations execution is not mandatory is viable to do with Promise.all() and map. Updating related items, where the promise result from the previous item is needed as input for the next item, can be achieved with the for await...of statement.

GDPR privacy, consent mode ‘denied’ status, Google Analytics 4 and Next.js.

Keep your user's privacy at the center of your practices as established by GDPR and California law. Set ad_storage='denied', analytics_storage='denied', gtag('set', 'ads_data_redaction', true) and 'anonymize_ip': true for less intrusion while enjoy the great features of the new Google Analytics 4 in your Next.js web app.

How to use a custom domain registered with AWS Route 53 in a Next.js web app deployed to Vercel.

Update the AWS Route 53 domain’s nameservers or, A and CNAME record types with the values provided by Vercel under ProjectName / Settings / Domains after you added a domain to the project. It will show the info needed to configure greatdomain.com and redirect to www.greatdomain.com or vice versa. After you tried to add the domain to your project unsuccessfully that information will also be sent to your email explaining what to do. Vercel allows you to configure A (recommended) and CNAME records.