Skip to content

A comprehensive full-stack financial analysis platform that integrates artificial intelligence, visualization analysis, and educational resources

License

Notifications You must be signed in to change notification settings

LQ458/StatsifyFinance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›๏ธ StatsifyFinance

Next.js TypeScript MongoDB AI Powered License

๐Ÿš€ StatsifyFinance is a comprehensive full-stack financial analysis platform that integrates artificial intelligence, visualization analysis, and educational resources. It provides comprehensive financial tools and learning resources for beginners and professional investors.

โœจ Core Features

๐Ÿค– Intelligent AI Assistant

  • Multimodal Analysis: Supports intelligent analysis of text and image screenshots
  • Real-time Conversation: Streaming responses based on DeepSeek API
  • Professional Domain: Focused on financial analysis and investment consulting
  • Multilingual Support: Intelligent switching between Chinese and English
  • Chat History: User conversation record saving and management

๐Ÿ“Š Analysis Tools Center

  • Quantitative Analysis: Profitability, liquidity, solvency, operational efficiency, growth capability, valuation level
  • Qualitative Analysis: Assessment of non-financial factors such as management quality, brand value, and market competitiveness
  • Screenshot Analysis: Intelligent recognition of financial charts and data with professional interpretation
  • Text Analysis: OCR text recognition + AI semantic analysis

๐Ÿ“ˆ Strategy Research Center

  • Trading Strategies: Detailed quantitative trading methodologies and practical cases
  • Investor Profiles: Investment philosophies and strategy analysis of famous investors
  • Risk Management: Systematic risk control methods and industry risk assessment
  • Industry Classification: In-depth analysis of 14 major industries

๐Ÿ“š Knowledge Resource Library

  • Financial Encyclopedia: Quantitative investment knowledge system with mathematical formula rendering support
  • Terminology Dictionary: Detailed explanations and case studies of financial professional terms
  • Market News: Real-time updates of industry dynamics and trend analysis
  • Site-wide Search: Intelligent retrieval system for quick content location

๐Ÿ› ๏ธ Technical Architecture

Frontend Technology Stack

# Core Framework
Next.js 14.2.16          # React full-stack framework
TypeScript 5.0           # Type system
Tailwind CSS 3.4.1      # Atomic CSS framework

# UI Component Library
Ant Design 5.22.1       # Enterprise-grade UI components
@ant-design/icons        # Icon library
react-icons 5.2.1        # Supplementary icons

# Data Visualization
ECharts 5.5.1           # Chart library
Swiper 11.1.9           # Carousel component

# Content Rendering
@wangeditor/editor       # Rich text editor
react-markdown 9.0.1     # Markdown rendering
rehype-katex 7.0.1       # Mathematical formula rendering
react-syntax-highlighter # Code highlighting

# Feature Enhancement
html2canvas 1.4.1        # Screenshot functionality
next-intl 3.26.2         # Internationalization
next-auth 4.24.7         # Authentication
zustand 5.0.3            # State management

Backend Technology Stack

# Database
MongoDB 6.15.0           # Document database
Mongoose 8.5.2           # ODM object modeling

# AI Services
DeepSeek API             # Large language model
Baidu AIP SDK 4.16.16    # Baidu AI platform (OCR)
LangChain 0.3.11         # AI application framework

# Other Services
@sentry/nextjs           # Error monitoring
@vercel/analytics        # Data analytics

Project Structure

โ”œโ”€โ”€ app/                     # Next.js App Router
โ”‚   โ”œโ”€โ”€ [locale]/           # Internationalization routes
โ”‚   โ”‚   โ”œโ”€โ”€ analysis/       # Analysis tool pages
โ”‚   โ”‚   โ”œโ”€โ”€ strategy/       # Strategy center pages
โ”‚   โ”‚   โ”œโ”€โ”€ wiki/          # Financial encyclopedia pages
โ”‚   โ”‚   โ”œโ”€โ”€ articles/      # News article pages
โ”‚   โ”‚   โ””โ”€โ”€ admin/         # Admin backend pages
โ”‚   โ”œโ”€โ”€ api/               # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ chat/          # AI conversation interface
โ”‚   โ”‚   โ”œโ”€โ”€ analyze-image/ # Image analysis interface
โ”‚   โ”‚   โ”œโ”€โ”€ analyze-text/  # Text analysis interface
โ”‚   โ”‚   โ””โ”€โ”€ admin/         # Management interface
โ”‚   โ””โ”€โ”€ globals.css        # Global styles
โ”œโ”€โ”€ components/            # Common components
โ”‚   โ”œโ”€โ”€ aiChat.tsx        # AI chat component
โ”‚   โ”œโ”€โ”€ ScreenCapture.tsx # Screenshot functionality component
โ”‚   โ”œโ”€โ”€ topbar.tsx        # Top navigation
โ”‚   โ””โ”€โ”€ footer.tsx        # Footer component
โ”œโ”€โ”€ models/               # Data models
โ”‚   โ”œโ”€โ”€ user.ts          # User model
โ”‚   โ”œโ”€โ”€ chat.ts          # Chat record model
โ”‚   โ”œโ”€โ”€ articles.ts      # Article model
โ”‚   โ””โ”€โ”€ wiki-articles.ts # Encyclopedia article model
โ”œโ”€โ”€ libs/                # Utility libraries
โ”‚   โ””โ”€โ”€ mongodb.ts       # Database connection
โ”œโ”€โ”€ i18n/                # Internationalization configuration
โ”‚   โ”œโ”€โ”€ locales.ts       # Language configuration
โ”‚   โ””โ”€โ”€ navigation.ts    # Route configuration
โ”œโ”€โ”€ messages/            # Multilingual files
โ”‚   โ”œโ”€โ”€ zh.json         # Chinese
โ”‚   โ””โ”€โ”€ en.json         # English
โ””โ”€โ”€ middleware.ts        # Middleware configuration

๐Ÿš€ Quick Start

Environment Requirements

  • Node.js >= 18.0.0
  • pnpm >= 8.0.0 (recommended)
  • MongoDB >= 6.0

Install Dependencies

# Clone the project
git clone https://github.com/LQ458/StatsifyFinance.git
cd StatsifyFinance

# Install dependencies (recommended using pnpm)
pnpm install

# Or use npm
npm install

# Or use yarn
yarn install

Environment Configuration

# Copy environment variables file
cp .env.example .env.local

# Configure environment variables
MONGODB_URI=mongodb://localhost:27017/statsify
NEXTAUTH_SECRET=your-nextauth-secret
NEXTAUTH_URL=http://localhost:8810

# AI service configuration
DEEPSEEK_API_KEY=your-deepseek-api-key
DEEPSEEK_ALT_BASE_URL=https://api.deepseek.com/v1/chat/completions
DEEPSEEK_ALT_API_KEY=your-deepseek-alt-api-key
DEEPSEEK_ALT_MODEL=deepseek-ai/DeepSeek-V3

# Baidu AI configuration (OCR functionality)
BAIDU_APP_ID=your-baidu-app-id
BAIDU_API_KEY=your-baidu-api-key
BAIDU_SECRET_KEY=your-baidu-secret-key

Start the Project

# Development mode
pnpm dev          # Start at http://localhost:8810
npm run dev
yarn dev

# Production build
pnpm build        # Build production version
npm run build
yarn build

# Production start
pnpm start        # Start production server
npm start
yarn start

Development Tools

# Code formatting
pnpm format       # Format code using Prettier
npm run format

# Code linting
pnpm lint         # ESLint code checking
npm run lint

# Initialize vector data
pnpm init-vectors # Initialize AI vector data
npm run init-vectors

๐Ÿ“‹ Feature Details

๐Ÿค– AI Intelligent Assistant

  • Intelligent Conversation: Supports professional Q&A in the financial domain
  • Screenshot Analysis: Real-time screenshot and AI interpretation of chart data
  • Text Analysis: OCR recognition + intelligent semantic analysis
  • Multilingual: Automatic detection and adaptation of Chinese/English responses
  • Streaming Response: Real-time typewriter effect display
  • History Records: Conversation history saving for logged-in users

๐Ÿ“Š Data Analysis Tools

  • Quantitative Indicators: In-depth analysis of 6 major categories of financial indicators
  • Qualitative Assessment: Comprehensive evaluation of enterprise soft power
  • Visualization Charts: Dynamic chart display with ECharts
  • Data Export: Support for analysis result export

๐Ÿ“ˆ Investment Strategy Research

  • Strategy Library: Detailed explanations of classic investment strategies
  • Case Analysis: In-depth interpretation of practical cases
  • Risk Assessment: Multi-dimensional risk control models
  • Investor Profiles: Strategy research of renowned investors

๐Ÿ“š Knowledge Management System

  • Classification System: Structured knowledge classification management
  • Search Engine: Full-text search + semantic search
  • Formula Rendering: LaTeX mathematical formula support
  • Version Control: Content version management and update tracking

๐ŸŒ Internationalization Support

The project supports bilingual Chinese and English:

  • Route hierarchy: /zh/... and /en/...
  • Interface language: Automatic detection of user preferences
  • Content localization: Bilingual versions of articles and terms
  • AI responses: Intelligent language adaptation

๐Ÿ” User System

Authentication Methods

  • NextAuth.js integration
  • Email and password login support
  • Guest mode with limited conversation count
  • Administrator permission system

Permission Management

  • Guest Users: Limited AI conversation count (3 times)
  • Registered Users: Unlimited conversations + history records
  • Administrators: Content management + data statistics

๐ŸŽฏ Featured Functions

๐Ÿ“ธ Intelligent Screenshot Analysis

// Screenshot functionality implementation
import ScreenCapture from "@/components/ScreenCapture";

<ScreenCapture
  onCapture={handleImageAnalysis}
  isSelecting={isScreenshotting}
  onQuestionSelected={() => setIsOpen(true)}
/>;

๐Ÿงฎ Mathematical Formula Rendering

Supports LaTeX syntax:
$$\text{ROE} = \frac{\text{Net Income}}{\text{Shareholders' Equity}} \times 100\%$$

๐Ÿ” Full-text Search

// Search functionality
const searchResults = await fetch("/api/search", {
  method: "POST",
  body: JSON.stringify({ query: searchTerm }),
});

๐Ÿ“ฆ Deployment Guide

Vercel Deployment

# Connect to Vercel
npx vercel

# Configure environment variables
vercel env add MONGODB_URI
vercel env add DEEPSEEK_API_KEY
# ... other environment variables

Docker Deployment

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]

๐Ÿค Contributing Guide

We welcome all forms of contributions!

Development Workflow

# 1. Fork the project
# 2. Create feature branch
git checkout -b feature/amazing-feature

# 3. Commit changes
git commit -m 'Add amazing feature'

# 4. Push branch
git push origin feature/amazing-feature

# 5. Create Pull Request

Contribution Types

  • ๐Ÿ› Bug fixes
  • โœจ New feature development
  • ๐Ÿ“ Documentation improvements
  • ๐ŸŽจ UI/UX optimization
  • ๐Ÿ”ง Performance optimization
  • ๐ŸŒ Multilingual translation

๐Ÿ“„ Open Source License

This project is licensed under the Apache-2.0 open source license.

๐Ÿ™ Acknowledgments

Thanks to the following open source projects for their support:

๐Ÿ“ž Contact Information

๐Ÿ“– ไธญๆ–‡ๆ–‡ๆกฃ | ๐ŸŒ Website


๐ŸŒŸ If this project helps you, please give us a Star! ๐ŸŒŸ

Star History Chart

About

A comprehensive full-stack financial analysis platform that integrates artificial intelligence, visualization analysis, and educational resources

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •