some changes

This commit is contained in:
eduard committed 2025-12-12 14:47:36 +01:00
commit 3568453103
45 files changed
+4557

No files matched your search

+189
View File
@@ -0,0 +1,189 @@
# Stock Analyzer - Full Stack Application
A modern stock analysis application built with **Spring Boot (Java)** backend and **Vue.js** frontend.
## Features
- 📊 Real-time stock data analysis using Yahoo Finance
- 🤖 AI-powered predictions using OpenAI GPT and Anthropic Claude
- 📰 News sentiment analysis via NewsAPI
- 🌐 Web sentiment analysis via DuckDuckGo
- 📈 Technical indicators (RSI, SMA)
- 📉 Fundamental analysis (P/E ratio, Market Cap, etc.)
- 📜 Historical analysis tracking with accuracy metrics
- 🎯 Watchlist management
## Tech Stack
### Backend
- **Spring Boot 3.2.1** with Java
- **MongoDB** for data persistence
- **OkHttp** for HTTP requests
- **Jsoup** for web scraping
- **Gradle** for build management
### Frontend
- **Vue 3** with Composition API
- **TypeScript** for type safety
- **Vite** for fast development
- **Pinia** for state management
- **Axios** for API calls
- **Premium CSS** with dark theme and glassmorphism
## Prerequisites
- **Java 17+**
- **Node.js 18+** (for frontend)
- **MongoDB** (local or Docker)
- **API Keys**:
- OpenAI API Key
- Anthropic API Key
- NewsAPI Key
## Quick Start
### 1. Start MongoDB
```bash
docker run -d -p 27017:27017 --name mongodb mongo:latest
```
### 2. Configure Environment Variables
Create a `.env` file or set environment variables:
```bash
export MONGO_URI=mongodb://localhost:27017/stock_analyzer
export OPENAI_API_KEY=your_openai_key
export OPENAI_MODEL=gpt-4o
export ANTHROPIC_API_KEY=your_anthropic_key
export ANTHROPIC_MODEL=claude-sonnet-4-5
export NEWS_API_KEY=your_newsapi_key
```
### 3. Start Backend
```bash
cd backend
./gradlew bootRun
```
The backend will start on `http://localhost:8080`
### 4. Start Frontend
```bash
cd frontend
npm install
npm run dev
```
The frontend will start on `http://localhost:5173`
## API Endpoints
### Watchlist
- `GET /api/watchlist` - Get all watchlist stocks
- `POST /api/watchlist` - Add stock to watchlist
- `DELETE /api/watchlist/{isin}` - Remove stock from watchlist
### Analysis
- `POST /api/analysis/run` - Analyze all watchlist stocks
- `GET /api/analysis/history` - Get historical results
- `GET /api/analysis/history/{isin}` - Get results for specific ISIN
- `DELETE /api/analysis/history` - Delete results by date range
- `GET /api/analysis/market-context` - Get S&P 500 market context
- `GET /api/analysis/historical-price/{symbol}/{date}` - Get historical price
## Docker Deployment
### Build and Run with Docker Compose
```bash
docker-compose up --build
```
This will start:
- MongoDB on port 27017
- Backend on port 8080
- Frontend on port 80
## Development
### Backend Development
```bash
cd backend
./gradlew build
./gradlew test
```
### Frontend Development
```bash
cd frontend
npm run dev # Development server
npm run build # Production build
npm run preview # Preview production build
```
## Project Structure
```
stock-analyzer/
├── backend/ # Spring Boot backend
│ ├── src/
│ │ └── main/
│ │ ├── kotlin/
│ │ │ └── com/stockanalyzer/
│ │ │ ├── controller/
│ │ │ ├── service/
│ │ │ ├── model/
│ │ │ ├── repository/
│ │ │ └── config/
│ │ └── resources/
│ │ └── application.yml
│ └── build.gradle.kts
├── frontend/ # Vue.js frontend
│ ├── src/
│ │ ├── components/
│ │ ├── views/
│ │ ├── store/
│ │ ├── router/
│ │ ├── App.vue
│ │ └── main.ts
│ ├── package.json
│ └── vite.config.ts
└── README-FULLSTACK.md
```
## Features in Detail
### Stock Analysis
- Fetches real-time stock data from Yahoo Finance
- Calculates technical indicators (RSI, SMA)
- Retrieves fundamental data (P/E ratio, Market Cap, etc.)
- Gets analyst ratings and target prices
### AI Predictions
- Uses both OpenAI GPT and Anthropic Claude for predictions
- Predicts stock movement for the next 24 hours
- Provides probability scores and reasoning
### News & Sentiment
- Fetches recent news headlines via NewsAPI
- Scrapes web sentiment from Reddit and Yahoo Finance
- Analyzes overall market context (S&P 500)
### Historical Tracking
- Stores all analysis results in MongoDB
- Tracks prediction accuracy over time
- Allows deletion of historical data by date range
## License
MIT
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.