import React from 'react'; import Image from 'next/image'; import Link from 'next/link'; import { Server, Cpu, ShieldCheck, Clock, Database, Mail, BarChart2, Zap, ArrowRight, CheckCircle2, AlertTriangle } from 'lucide-react'; export const metadata = { title: 'API & Architecture | OpenStock', description: 'Technical documentation for OpenStock architecture, AI integrations, and background jobs.', }; export default function ApiDocsPage() { return (
{/* Hero Section */}
openstock
+
Siray

OpenStock Architecture

A transparent look at the event-driven, multi-provider system powering your market insights.

v1.0.0 Active Gemini + Siray AI Open Source AGPL-3.0
{/* AI Architecture Section */}

Intelligent UI

We prioritize uptime for generative features (Welcome Emails, News Summaries) using a robust multi-provider strategy. Our system automatically routes around outages.

Primary: Google Gemini Flash Lite 2.5

Handles high-volume inference for news summarization and personalization.

Fallback: Siray.ai Ultra 1.0

Instant failover protection. If Gemini wavers, Siray takes over to ensure zero dropped requests.

{/* Diagram / Visual */}
{/* Visual Flowchart */}
User Action / Cron Job
Inngest Function
Attempt Gemini
Fallback to Siray
Content Delivered
{/* Background Jobs */}

Serverless Infrastructure

} title="Sign Up Email" trigger="Event" desc="Generates personalized welcome/onboarding email via AI." color="purple" /> } title="Weekly News" trigger="Cron: Mon 9am" desc="Summarizes market news and broadcasts via ConvertKit." color="teal" /> } title="Stock Alerts" trigger="Cron: 5m" desc="Checks user price targets against real-time data." color="yellow" /> } title="Re-engagement" trigger="Cron: Daily" desc="Identifies dormant users and sends nudges." color="red" />
{/* Integration Stack */}

Tech Stack & Data

); } // Helper Components function Badge({ children, color }: { children: React.ReactNode, color: 'green' | 'purple' | 'blue' }) { const colors = { green: 'bg-green-500/10 text-green-400 border-green-500/20', purple: 'bg-purple-500/10 text-purple-400 border-purple-500/20', blue: 'bg-blue-500/10 text-blue-400 border-blue-500/20', }; return ( {children} ); } function JobCard({ icon, title, trigger, desc, color }: any) { const colorClasses: any = { purple: 'text-purple-400 bg-purple-500/10 border-purple-500/20 hover:border-purple-500/40', teal: 'text-teal-400 bg-teal-500/10 border-teal-500/20 hover:border-teal-500/40', yellow: 'text-yellow-400 bg-yellow-500/10 border-yellow-500/20 hover:border-yellow-500/40', red: 'text-red-400 bg-red-500/10 border-red-500/20 hover:border-red-500/40', }; return (
{icon}

{title}

{trigger}

{desc}

); } function StackItem({ title, desc, url }: any) { return (

{title}

{desc}

); }