My Second Sprint at Piksta: Simplifying Forms and Strengthening Security
Poetry Of Code

Poetry Of Code @poetryofcode

About: Crafting captivating interfaces one line of code at a time

Location:
Coney Island
Joined:
Jul 16, 2023

My Second Sprint at Piksta: Simplifying Forms and Strengthening Security

Publish Date: Jul 7
1 0

During my second sprint at Piksta, I focused on two important improvements that made our app both easier to use and more secure.

Simplifying Form Logic with React Hook Form + Zod

Image description

Forms are a big part of most web apps, and getting them right can be tricky. At Piksta, I refactored our form logic by integrating React Hook Form with Zod, a TypeScript-first schema validation library.

This change made our forms:

  • Cleaner – Less repetitive code
  • More reliable – Type-safe validation using Zod schemas
  • Easier to maintain – All form rules live in one place

Here’s a quick example of the new pattern:

import { useForm } from "react-hook-form";
import { z } from "zod";
import { zodResolver } from "@hookform/resolvers/zod";

const schema = z.object({
  email: z.string().email(),
  password: z.string().min(6),
});

const { register, handleSubmit, formState: { errors } } = useForm({
  resolver: zodResolver(schema),
});

Enter fullscreen mode Exit fullscreen mode

Securing Auth Flow with Google reCAPTCHA

Image description

Another big win this sprint was improving our authentication flow by adding Google reCAPTCHA. This helps prevent bots from signing up or abusing the platform.

Now, before any login or signup request goes through, users must pass a reCAPTCHA check. This adds a layer of protection while keeping the user experience simple and quick.

This sprint was all about polish and protection. I’m proud of the improvements made and excited to keep pushing for cleaner code and better user safety at Piksta.

Comments 0 total

    Add comment