Reflection Post HW2

Node

  1. While building the front end, I made a few changes to my backend from HW1. The main change was adding an “/api” prefix to all routes so that the Vite dev server could proxy requests cleanly to the backend. I also adjusted some error messages to be more descriptive, since those messages are now shown directly to users in the UI. Other than that, the core backend logic stayed the same, which was a good sign that the HW1 design was flexible enough to support a frontend.
  2. Looking back, if I were to redo HW1, I would think earlier about how the API responses and error messages would be consumed by a frontend. Designing with that in mind from the start would have saved some refactoring later. Also, I could not push my code correctly since I was on a time crunch and the git commands were giving an error while pushing my code, so I would surely try to keep enough time for that.
  3. For validation, I relied mostly on server-side validation using Zod, but I also added minimal client-side validation (for example, requiring an author to be selected before submitting a book). Server-side validation ensures correctness and security, while client-side validation improves the user experience by preventing obvious mistakes before a request is sent. Using both together felt like the right balance.

React

  1. Overall, my experience with React was mixed but positive. I had also used it previously so that helped my experience. I believe I struggled the most with layout and managing states at first, and I also struggled a bit in filtering the books according to the minimum year. What I enjoyed most was how declarative React is — once the states were set up correctly, the UI updated automatically without manual DOM manipulation.
  2. The experience of writing React code was much better than the plain JavaScript DOM manipulation code in CS 375. I felt that it was more scalable and readable. In CS 375, updating the UI required manually finding elements and changing them, and after every change the server had to be restarted. With React, the UI is a direct reflection of state, which I found easier to reason about once I got used to it. I would prefer React for larger projects, even though it has a steeper learning curve.
  3. Using TypeScript on the front end was mostly helpful. It helped catch mistakes like using the wrong field names from API responses and passing incorrect values to components. I struggled a bit with typing event handlers and Axios errors, and it could get a bit tedious, but overall types did help keep the development safer and also easier to understand.

LLMs

  1. Yes, I used LLMs to solve bugs and also to refactor some of my App.tsx file. I also used it to figure out some next steps when I was stuck.
  2. Using the LLM made the process less frustrating and it also taught me some of the syntaxes that I wasn’t aware of. It helped me brainstorm the assignment and also saved time.

Back to Home