Company
Date Published
Author
Olususi Oluyemi
Word count
2681
Language
English
Hacker News points
None

Summary

A Node.js application with Express, Pug, and MySQL was built to create a contacts web app that utilizes Server Side Rendering (SSR) for faster load times. PlanetScale provides the database service, allowing users to enjoy all its benefits via a highly scalable and reliable service provider. Prisma is used as an Object Relational Mapping (ORM) tool to handle interactions with the PlanetScale database. The application features validation using express-validator, which ensures that user input is not incorrect or dangerous. Four functions were implemented: index, create, store, and destroy, which render client-related pages such as the list of all clients, the form for adding a new client, the submitted form to be validated, and the deletion of a client from the database, respectively. The application was updated with routes for these controller functions and middleware to parse the body of the request.