While implementing the front-end, I had to adjust my back-end to provide more flexible filtering options for books and authors. For example, I added support for query parameters like title
, genre
, and pub_year
to enhance the filtering capabilities. This was necessary to match the dynamic functionality of the React front-end. In the future, I would structure my back-end with these kinds of requirements in mind from the start, ensuring scalability and flexibility.
I implemented both client-side and server-side validation. Client-side validation helps improve the user experience by providing instant feedback, but server-side validation ensures data integrity and protects against malicious input. The combination of both provided a robust solution, but duplicating the validation logic between the client and server increased development time slightly.
Manipulating state with React components, especially using the useEffect
hook, was straightforward in some scenarios but challenging in others. I struggled with understanding the dependency array initially and ensuring that state updates triggered re-renders only when necessary. For example, fetching data in useEffect
required careful handling to avoid infinite loops.
Using TypeScript with the front-end was a mixed experience. It caught several bugs early, such as incorrect types for API responses, which saved debugging time. However, I had to make many manual type annotations, especially for API responses and complex component props. Occasionally, I resorted to using any
when type definitions became too cumbersome to manage quickly, though I tried to minimize this practice to preserve type safety.
Compared to writing a multi-page application (MPA) like we did in CS375, developing a single-page application (SPA) with React felt more intuitive for dynamic and interactive user interfaces. The SPA approach was harder initially due to the learning curve of managing state and using React-specific patterns, but once I became familiar with the tools, I found it more enjoyable. Overall, I appreciated the streamlined workflow and the ability to create a more seamless user experience.