Integrating LLMs Into Web Applications: Patterns and Pitfalls