DEV Community

Cover image for Building a Multilingual AI Stock Platform with Astro & Groq
ozamanlar
ozamanlar

Posted on

Building a Multilingual AI Stock Platform with Astro & Groq

Every day, investors compare stocks and crypto before making decisions. I wanted to automate this with AIβ€”so I built Peaxer, a free platform that generates AI-powered side-by-side comparisons.

Here is a deep dive into how the system works under the hood.

πŸ›  The Stack

  • Frontend: Astro (SSG for speed & SEO)
  • Hosting: Cloudflare Pages
  • AI Engine: Groq API (Llama 3.1)
  • API Proxy: Cloudflare Workers
  • Database: Cloudflare KV (for user voting)
  • Automation: GitHub Actions
  • Data Sources: CoinGecko API & TradingView Widgets

πŸ€– Automated Content Pipeline

The entire pipeline runs without any manual intervention. Every day at 06:00 UTC, a GitHub Actions workflow kicks off:

  1. Selection: A Python script picks random pairs from a pool of 130+ assets.
  2. Generation: Groq API generates a detailed Turkish comparison.
  3. Localization: The same API translates the content into English.
  4. Deployment: Astro builds 700+ static pages, and Cloudflare Pages deploys them automatically.

βš”οΈ The "AI Stock Battle" Feature

One of the most engaging features is the AI Stock Battle.
Users can pick any two assets, and the AI analyzes them in real-time through a Cloudflare Worker proxy. It returns a winner based on growth potential, risk level, and innovation score.

🌍 Bilingual SEO Strategy

To maximize reach, every comparison exists in both Turkish and English:

  • Hreflang Tags: Proper implementation for search engines.
  • Separate Sitemaps: Organized by language.
  • Structured Data: Uses Article + FAQ schema to win rich snippets.

πŸ’‘ Key Learnings

  • Static > Dynamic: Astro SSG + Cloudflare Pages delivers near-perfect Core Web Vitals with zero server costs.
  • Free AI APIs work: Groq’s free tier is incredibly fast and reliable for production.
  • Workers are Swiss Army Knives: Used for API key masking and KV storage.

πŸš€ Try It Out

Check out the live project or dive into the code:

Top comments (0)