Author: Sergio Lema

  • Forms in React, with or without React Forms

    Forms in React, with or without React Forms

    Forms in web development are essential for user interaction, yet often frustrating. This content compares traditional HTML forms with React Form Components, discussing their pros and cons. Basic forms are simplistic but limited in validation, while React libraries enhance user experience with advanced features. Choose based on form complexity and validation needs.

  • Stop & Start GCP SQL Instances at Nights

    Stop & Start GCP SQL Instances at Nights

    One of the great things about Google Cloud SQL instances is that they let me shut them down at night. The data sticks around (hopefully), but I can’t access it, which is exactly what I want. Since my backend servers are already tucked in for the night (explained in another article), keeping the database running…

  • SQLAlchemy and JSON values

    SQLAlchemy and JSON values

    Storing JSON in a relational database? Sounds like a contradiction, but sometimes, it’s the best solution. SQLAlchemy makes it easy to use a JSON column in Postgres—until you try to update a single value inside it. Turns out, SQLAlchemy doesn’t track those changes by default, leading to silent failures. The fix? Marking the column as…

  • GCP Cloud Functions with SQL Access

    GCP Cloud Functions with SQL Access

    I’ve created a Google Cloud Function for a weekly task to streamline backend dependencies but faced complications with database connectivity. GCP requires a proxy, which undermines the initial goal of simplicity. Ultimately, I’ve moving all back into an existing backend to save extra fees from having a proxy up and running.

  • Deploying a Spring Boot Application to AWS ECS Fargate

    Deploying a Spring Boot Application to AWS ECS Fargate

    Why AWS ECS is Your New Best Friend for Microservices So, you’ve built a shiny new Spring Boot application, and now you’re wondering how to deploy it without losing your sanity. Enter AWS ECS (Elastic Container Service), the managed container orchestration service that lets you run Docker containers without having to babysit a Kubernetes cluster.…

  • Handle The Errors with Flask Correctly

    Handle The Errors with Flask Correctly

    Effective error management in Flask applications is crucial for security, usability, and debugging. Implement custom exceptions to centralize handling and use blueprints for clean error responses. Additionally, log useful details while avoiding exposing sensitive information. This strategy ensures a better user experience and maintains application integrity.

  • How to Center Content into a DIV with CSS

    How to Center Content into a DIV with CSS

    It’s always hard to centering content in a div using CSS, particularly for backend developers. I advocate for the use of Flexbox, explaining properties like display, justify-content, and align-items to achieve perfect central alignment. Understanding these concepts eases the frustration of frontend tasks.

  • How to Handle AttributeError: ‘NoneType’ Object Has No Attribute X’ Like a Pro

    How to Handle AttributeError: ‘NoneType’ Object Has No Attribute X’ Like a Pro

    The AttributeError: ‘NoneType’ object error in Python indicates an attempt to access a non-existent attribute. Instead of applying quick fixes, it’s essential to address the root cause, ensuring data integrity. Enforcing data rules prevents errors, while clear communication about optional attributes assists in handling them appropriately across the application.

  • Forgot Password Feature with Python and Flask

    Forgot Password Feature with Python and Flask

    The article discusses user authentication options, highlighting the “Forgot Password” feature implementation using JWT in Python and Flask. It outlines a secure workflow for resetting passwords via email, emphasizing the importance of short-lived JWTs for security. Proper authentication procedures enhance user trust and experience in applications.

  • Shut Down GCP Instance Groups at Nights

    Shut Down GCP Instance Groups at Nights

    The article discusses strategies to reduce infrastructure costs in Google Cloud Platform (GCP) during non-working hours by automating the management of Instance Groups. It outlines a workflow that involves using a Cron Job to trigger a Cloud Function, which identifies and starts or stops Instance Groups based on specific labels in Instance Templates.