It has been 27 days since I wrote my first article about My Goal Creator.
I completed my first half marathon yesterday, finishing with a time of 2:16:26!
The commits have been steady!
My Goal Creator is a web application designed to help users set, track, and refine their goals. The app is built with React, TypeScript, Node.js, SQLite, Cloudflare Workers, and uses OpenAI to dynamically stream responses to users' inputs.
The app acts like a task manager and research tool where the user can ask how to achieve a goal or task and recieve a detailed plan. Once a plan has been generated the user has the ability to easily select a line from the text and dive deeper into that subject. This recursive style of research allows for users to find sub topics of interest and quickly generate information about them. I have been referring to this as 'diving'.
Frontend
Backend
Initially, I took a straightforward approach by awaiting the full response from OpenAI, which resulted in the user waiting with a loading spinner. To improve user experience, I implemented OpenAIโs chat completion streaming, allowing instant feedback. I used Readable Streams to handle OpenAI's chunked data and continually sent each chunk back to the client via a Server-Sent Events (SSE) connection."
Surprisingly a hallenging part about working with the openai completion stream was making sure that the markdown syntax was parsed correctly during the stream as incomplete markdown lines can cause formatting inconsistencies. After refactoring my initial implementation I found the issue was with the combination of the actual newline characters in the response and the newline character at the end of the string signaling the end of a "message" in a server-sent events stream.
After playing with the database schema, I decided on a design where clicking on a line of text within a goal creates a new goal referencing the previous via its parent_goal_id. This allows for a tree like structure of goals to be created and queried. Combining this style of data creation with responsive UI animations allow for me to create a fairly engaging user experience. The design supports a simple routing and component implementation. I can continually navigate to each new piece of content with a new goal id reusing the same component. There are definitely improvements to be made but I am happy with the progress so far.
Prompting the AI to consistently produce reliable, structured markdown was another challenge. I aimed for a specific markdown pattern that I could use to split goal plans into timelines and subtasks. After some experimentation, I refined my prompts to achieve a predictable format, which I now parse and store in a SQL database for easy querying. This was critical for the kanban board feature I am developing as inconsistencies in responses would break the markdown parsing logic.
My plan is to keep refining My Goal Creator until I find a use case that truly resonates with users. The platformโs flexibility should allow it to serve as a foundation for future, rebranded products if necessary.
I want to implement regression testing for the AI model to ensure responses satisfy quality standards as the prompting continues to evolve.
I thought this article by Gitlab was interesting and offered insight into how they approach testing AI models.
If you have any feedback or ideas, feel free to reach out at williamjonescodes@gmail.com.
Cheers!