Emircan Erdemci

Parley

Streaming AI chat with weather, calculation and time cards.

  • TypeAI chat app
  • Year2026
  • My roleDesign and full stack development

Read replies as they arrive and see tool results as cards. Chat history stays in your browser; a usage screen shows the remaining quota.

The challenge

Protect a shared AI quota and present useful tool results, with arithmetic handled by a dedicated parser.

My role

I built the interface, API, tools, usage meter and access controls, then deployed on Workers.

Architecture

Where each part runs. Red follows the example flow.

  1. L1 Interface Runs on: Browser

    Renders streaming replies and tool cards. Stores chat history locally.

    • Nuxt 4
    • Nuxt UI 4
    • AI SDK useChat
    • Comark
  2. L2 Server Runs on: Cloudflare Workers

    Serves the app and API. Session checks and rate limits protect usage; a Durable Object meters it.

    • Cloudflare Workers
    • Nitro
    • Turnstile
    • Rate Limiting
    • Durable Object
  3. L3 AI Runs on: Workers AI

    Streams replies and tool calls. A smaller model suggests follow-up messages.

    • AI SDK streamText
    • Workers AI
    • GLM-4.7 Flash
  4. L4 External services Runs on: Open-Meteo

    Provides four-day weather forecasts.

    • Open-Meteo

Step by step: Asking about the weather

  1. L1 · Interface Turnstile verification creates a 30-minute signed session.
  2. L2 · Server The API checks origin, session, rate limits and input.
  3. L3 · AI The model receives 16 messages and three tools.
  4. L4 · External services getWeather fetches the forecast from Open-Meteo.
  5. L1 · Interface The tool result appears as a forecast card.

Key decisions

  1. 01

    Tool cards

    Structured weather, calculation and time results render as dedicated cards.

  2. 02

    Calculation parser

    A parser evaluates supported expressions without eval. The model selects the calculation.

  3. 03

    Shared quota

    Turnstile, signed sessions and origin checks guard access. Limits allow five messages per minute per IP and session.

  4. 04

    Follow-up suggestions

    A smaller model suggests the next message. Press Tab to accept it.

  5. 05

    Usage limits

    Recorded average: about 23 neurons per reply, roughly 400 daily. Capacity varies by model and message length; the meter shows remaining quota.

Next project · 03 Formadaş Find footballers who played for both clubs.
Contact

Let's talk.

Email me about your next web project.

Email me emircan.erdemci@hotmail.com