Token-based authentication is when a user is authenticated by presenting a digitally signed token instead of entering a password. It's a common alternative to session-based authentication. JSON Web Tokens (JWTs) are a popular implementation of token-based authentication as they have a self-contained structure that includes user data and a signature for integrity verification. This article provides code implementations for both generic token-based authentication and JWTs.
React Query and React Context can be used together to manage data dependencies and make component logic simpler. Combining both makes implicit dependencies (like knowing a query has been executed elsewhere) clear and visible in your code.
Developers often feel the urge to rewrite code they perceive as messy, even if it's their own relatively recent work. This is because reading code is inherently harder than writing it. However, code that works and has been in production for a long time is often more stable and robust than developers realize.
Flaky tests are when tests sometimes pass and sometimes don't. Most of the time, they occur due to tests being poorly written and not hermetic. Sometimes, they can be due to resource constraints or data conflicts in the test environment. To prevent flaky tests, developers should catch them early by running tests often and reduce dependencies on external factors as much as possible.
While AI applications offer new capabilities to users, the pricing is mostly the same as traditional software applications. Most AI apps use subscription models, often based on the number of users. Free versions or trials are common to drive initial adoption. A new pricing model that AI could help facilitate is success-based pricing, where the user gets charged only when the product delivers a successful outcome.
JSONPath is a language for querying and extracting data from JSON documents. It can be used for tasks like updating OpenAPI descriptions or writing validation rules. Its syntax is inspired by XPath, making it easy to navigate JSON structure and find specific data.
Telling your users something is easy while they're struggling to understand it can be frustrating and counterproductive for learning and adoption of your product.