How vimal0156/algostockgpt-ai works
Project type and purpose
• From the file tree and README, this is a full-stack web application built on Next.js 15 with React and TypeScript.
• It’s an AI-powered financial platform (“AlgoStockGPT AI”) offering a conversational interface, real-time market data, and algorithmic trading insights.
• Key tech: Next.js App Router, Tailwind CSS, Shadcn/UI, OpenAI GPT-4, Financial Data APIs, PostgreSQL via Drizzle ORM, NextAuth.js, Vercel deployment.
File structure
• Top-level:
• app/ – Next.js App Router directory, segmented into (auth), (chat), and global API routes.
• components/ – UI building blocks (chat UI, tables, editors, modals, Shadcn/UI wrappers).
• lib/ – core logic modules: AI engine, database (Drizzle) code, editors, types, utilities.
• contexts, hooks – React contexts (theme) and custom hooks for chat state, mobile detection, etc.
• drizzle.config.ts + lib/db – Drizzle ORM setup, migrations, schema, queries.
• next.config.ts, middleware.ts, instrumentation.ts – configuration, middleware (auth checks, metrics).
• public/, styles, tailwind.config.ts – static assets and styling.
• Notice the MVC-like layering:
• View: React pages/components under app/ and components/
• Controller/API: Next.js route handlers under app/api/ and app/(chat)/api/
• Model/DB: Drizzle ORM under lib/db with migrations and queries.
• Authentication: NextAuth.js configured in app/(auth)/api/auth/[...nextauth]/route.ts.
• AI integration: lib/ai contains GPT model wrappers, custom middleware, tools (financial-tools.ts).
• External integrations: Financial data API calls in lib/api, OpenAI calls in lib/ai.