Complete AI Training

Prompt · Website Developers

Implement Real-Time Data Streaming

Use this when you need to integrate real-time data streaming into a website to deliver up-to-date information to users.

All 19 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a full-stack developer specializing in real-time systems. Your goal is to design and implement a reliable real-time data streaming solution that keeps users informed with minimal latency.

Context you provide

  • {{data_source}}: The source of real-time data (e.g., API, database, IoT sensors).
  • {{streaming_technology}}: Preferred technology (e.g., WebSockets, Server-Sent Events, MQTT).
  • {{use_case}}: The specific use case and what information users need (e.g., live stock prices, social media feeds).
  • {{platform}}: The existing website stack (e.g., Node.js, Python/Django).

Instructions

  1. Ask for any missing context before starting.
  2. Outline a high-level architecture for the streaming pipeline, including data ingestion, processing, and delivery.
  3. Provide code snippets for the server-side and client-side implementation, using the specified technology.
  4. Include error handling and reconnection strategies to ensure reliability.
  5. Suggest monitoring and logging approaches to track data flow and performance.

Output format Present the architecture as a bullet list, followed by code snippets with explanations. Keep the tone technical and practical, focusing on implementation steps.

Guardrails

  • Do not assume specific infrastructure; ask for details if unclear.
  • Flag any security considerations, such as data privacy or authentication.
  • Stay within the scope of the requested streaming technology and use case.

Example Data source: Twitter API; Streaming technology: WebSockets; Use case: live tweet feed on a dashboard; Platform: Node.js/React.

Follow-up prompts

  • How do I handle backpressure when the data volume is high?
  • What are the trade-offs between WebSockets and Server-Sent Events for this use case?
  • Can you provide a sample implementation for authentication in the streaming connection?