AI Assisted Simple Application Build

 AI Assisted Simple Application Build

Human Description

This will be a single user diary application with reporting. The infrastructure will consist of XAMPP with external libraries for CSS. Each entry will consist of a “group”, “timestamp” and “thought”. On the entry form, “group” will present the unique entries in the database for selection and allow for a new “group” to be added. The “timestamp” should be a database function and only presented to the user in reporting. The “thought” should be cleaned for inclusion as an HTML paragraph (<p></p>).


First Try To Define the Application to Gemini (AI)

Overview

I need a single-file object oriented PHP application for a personal diary running on XAMPP.

Database

Use a MySQL table named “diary” with columns “id”, “group”, “created_at” and “thought”. “Id” is an index. “Group” is a column that is varchar(16) and presented as a list to the user to select from the unique entries in the column and allows a new value to be entered. “Created_at” is the timestamp the row was inserted. “Thought” is a column that is varchar(256).

Functionality

Create a simple form to POST a new thought. Below the form, create a reporting section. Use Google public fonts and Google public CSS libraries. An HTML <select> will be used to present the unique values for the column “group” and allow for a new value to be entered.

Reporting Logic

Reporting should include

  1. Rolling Week: Filter where “created_at” is between "Now" and “Now” minus 14 days

  2. Rolling Month: Filter where “created_at” is between "Now" and “Now” minus 28 days

  3. By Month: Filter where month = “month selected”


Security

Use PDO for database connections and prepared statements to prevent SQL injection. Format the timestamp to be human-readable (e.g., Oct 24, 2023 - 10:30 AM).


SUCCESS!!! EUREKA!!!


No changes needed...well...I should have changed the user and password. I hurried through the implementation because I was excited to see what Jimmy(Gemini) provided. It worked right out of the box.

 

Comments

Popular posts from this blog

Things I Learned

Regrets

It's All About You