This is a full stack PERN (PostgreSQL, Express.js, React.js, and Node.js) web app, inspired by this Techtonica project. Users can build a contact list by entering names, email addresses, phone numbers, and notes into a form that saves this valuable information in a database. The contacts are listed in the app, and users can click the name of each contact entry get a detailed view. No longer want a contact in your list? Users have the option to delete each entry. The frontend of this app was built and styled with Material-UI.
-
Clone the project.
-
Install dependencies by running
npm installin the bothclientandserverfolders. -
Create a Postgres database named
contacts, then create a tablecontactswith the following schema:CREATE TABLE contacts ( contact_id SERIAL PRIMARY KEY, name VARCHAR(100), email VARCHAR(100), phone VARCHAR(20), notes TEXT ); -
Configure your backend project environment variables by creating a
.envfile in the server folder and adding the following, replacing each <> with your own information:LOCALHOST_DATABASE_URL=<Postgres database URL including the Postgres username, password, domain, port, and database name in the localhost environment.> DATABASE_USERNAME=<Database username> DATABASE_PASSWORD=<Your database password, if applicable. If none, leave blank.> DATABASE=<The name of your database, "contacts" or whatever you chose to name it.> DATABASE_PORT=<Port specific to the database.> PORT=<Port the server should listen on.> LOCALHOST_URL=<URL where the frontend is hosted for the CORS configuration, such as http://localhost:5173/> -
To run the project,
cdto bothclientandserverfolders and runnpm run devin both to start the server and launch the frontend in your browser.