I have put together an open source repo for demonstrating how to make an LLM web app with NextJS for the frontend, which maintains chat history, API Gateway + Lambda for the logic layer, using the OpenAI API for the LLM.
This is very much a work in progress and most certainly not production ready, but they code will give you a kick start in the right direction. I hope you find it helpful. I intend to keep working it it for my own learning purposes.
Show HN: A Repo for Making LLM Web Apps with NextJS, OpenAI, and AWS Lambda | Heykuki News