Empowering investors with AI-driven insights and comprehensive stock analysis
Caterpillar is a comprehensive, AI-powered stock analysis platform that democratizes financial insights for everyone. Whether you're a seasoned investor or just starting your financial journey, our platform provides professional-grade analysis tools with an intuitive, user-friendly interface.
Transform raw market data into actionable insights with our multi-layered analysis approach:
Choose your preferred AI provider with seamless integration:
Get Caterpillar up and running in minutes with our streamlined setup process.
Before you begin, ensure you have the following installed:
git clone https://github.com/semarainc/caterpillar-stock-analysis.git
cd caterpillar-stock-analysis
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
pip install -r requirements.txt
Create a .env file in the root directory for system-wide AI provider keys:
# OpenAI Configuration (Optional - users can set their own)
OPENAI_API_KEY=your-openai-api-key-here
OPENAI_BASE_URL=https://api.openai.com/v1/
# Google Gemini Configuration (Optional - users can set their own)
GEMINI_API_KEY=your-gemini-api-key-here
# MarketAux API Configuration (Optional - for news sentiment analysis)
MARKETAUX_API_KEY=your-marketaux-api-key-here
# Or use multiple keys for better rate limits:
MARKETAUX_API_KEY_1=your-first-marketaux-key
MARKETAUX_API_KEY_2=your-second-marketaux-key
MARKETAUX_API_KEY_3=your-third-marketaux-key
๐ก Pro Tip: Environment variables are optional! Users can configure their own AI provider keys through the settings page.
Choose your preferred mode:
Development Mode (with auto-reload):
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Production Mode (optimized performance):
uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4
๐ That's it! Open your browser and navigate to http://localhost:8000
When you first run Caterpillar, we automatically create an admin account for you:
| Field | Value |
|---|---|
| Username | admin |
| Password | admin123 |
[email protected] | |
| Role | Administrator |
โ ๏ธ Security Notice: Please change the default password immediately after your first login for security purposes.
No registration required - jump right in and explore:
/) - Main stock analysis interface with real-time data/static/login.html) - Secure user authentication/static/register.html) - Quick and easy account creationUnlock advanced capabilities with a free account:
/static/settings.html) - Customize your AI provider preferences and account details/static/admin.html) - Comprehensive user management (Administrator access only)POST /api/auth/login - Login userPOST /api/auth/register - Register user baruPOST /api/auth/logout - Logout userGET /api/auth/me - Get current user infoPOST /api/auth/change-password - Change passwordGET /api/settings - Get user settingsPUT /api/settings - Update user settings (LLM provider & API keys)GET /api/admin/users - List all usersPOST /api/admin/users - Create new userPUT /api/admin/users/{user_id} - Update userDELETE /api/admin/users/{user_id} - Delete userPOST /api/admin/users/{user_id}/reset-password - Reset user passwordGET /api/analyze-progress?stock={symbol} - Analyze stock (SSE stream)WebSocket /api/chat?stock={symbol}&token={token} - Chat with AI expertGET /api/top-stocks - Get top profitable stocksGET /api/sectors-tickers - Get S&P 500 sectors & tickersGET /api/health - Health check- id (INTEGER PRIMARY KEY)
- username (TEXT UNIQUE)
- email (TEXT UNIQUE)
- password_hash (TEXT)
- role (TEXT: 'admin' | 'user')
- is_active (INTEGER: 0 | 1)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)
- id (INTEGER PRIMARY KEY)
- user_id (INTEGER FOREIGN KEY)
- llm_provider (TEXT: 'openai' | 'gemini')
- openai_api_key (TEXT)
- gemini_api_key (TEXT)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)
- id (INTEGER PRIMARY KEY)
- user_id (INTEGER FOREIGN KEY)
- token (TEXT UNIQUE)
- expires_at (TIMESTAMP)
- created_at (TIMESTAMP)
- id (INTEGER PRIMARY KEY)
- stock (TEXT)
- analysis_date (TEXT)
- result_json (TEXT)
- created_at (TIMESTAMP)
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY | OpenAI API key for GPT-4 | Optional* |
OPENAI_BASE_URL | OpenAI API base URL | Optional |
GEMINI_API_KEY | Google Gemini API key | Optional* |
MARKETAUX_API_KEY | MarketAux API key for news data | Optional |
MARKETAUX_API_KEY_1 | First MarketAux API key (for multiple keys) | Optional |
MARKETAUX_API_KEY_2 | Second MarketAux API key (for multiple keys) | Optional |
MARKETAUX_API_KEY_3 | Third MarketAux API key (for multiple keys) | Optional |
PORT | Server port (default: 8000) | Optional |
*Users can set their own AI provider API keys through the settings interface
/static/register.htmlcaterpillar_2/
โโโ backend/
โ โโโ Fundamental.py # Fundamental analysis
โ โโโ sentiment.py # Sentiment analysis
โ โโโ investment_analysis.py # Investment recommendations
โ โโโ database.py # Database operations & user management
โ โโโ auth.py # Authentication dependencies
โ โโโ api_routes.py # API endpoints
โ โโโ llm_provider.py # LLM provider abstraction
โ โโโ analysis_cache.py # Analysis caching
โ โโโ googlenews.py # News fetching
โ โโโ top_stocks_search.py # Top stocks finder
โ โโโ models.py # Pydantic models
โโโ frontend/
โ โโโ index.html # Main page
โ โโโ login.html # Login page
โ โโโ register.html # Register page
โ โโโ admin.html # Admin panel
โ โโโ settings.html # User settings
โ โโโ app.js # Main JavaScript
โ โโโ style.css # Styles
โโโ main.py # FastAPI application
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Docker configuration
โโโ docker-compose.yml # Docker compose
โโโ README.md # This file
app_database.sqlite3 dan restart aplikasiadmin123We believe in the power of community! Caterpillar is open source and we welcome contributions from developers of all skill levels.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Found a bug? We'd love to hear about it! Please open an issue with:
Have an idea for a new feature? Open an issue and tell us:
Security is paramount in financial applications. If you discover a security vulnerability, please:
We appreciate responsible disclosure and will acknowledge your contribution.
Caterpillar Stock Analysis Platform is licensed under the GNU General Public License v2.0.
For the complete license text, see the LICENSE file.
Empowering investors with AI-driven insights and comprehensive stock analysis
Caterpillar is a comprehensive, AI-powered stock analysis platform that democratizes financial insights for everyone. Whether you're a seasoned investor or just starting your financial journey, our platform provides professional-grade analysis tools with an intuitive, user-friendly interface.
Transform raw market data into actionable insights with our multi-layered analysis approach:
Choose your preferred AI provider with seamless integration:
Get Caterpillar up and running in minutes with our streamlined setup process.
Before you begin, ensure you have the following installed:
git clone https://github.com/semarainc/caterpillar-stock-analysis.git
cd caterpillar-stock-analysis
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
pip install -r requirements.txt
Create a .env file in the root directory for system-wide AI provider keys:
# OpenAI Configuration (Optional - users can set their own)
OPENAI_API_KEY=your-openai-api-key-here
OPENAI_BASE_URL=https://api.openai.com/v1/
# Google Gemini Configuration (Optional - users can set their own)
GEMINI_API_KEY=your-gemini-api-key-here
# MarketAux API Configuration (Optional - for news sentiment analysis)
MARKETAUX_API_KEY=your-marketaux-api-key-here
# Or use multiple keys for better rate limits:
MARKETAUX_API_KEY_1=your-first-marketaux-key
MARKETAUX_API_KEY_2=your-second-marketaux-key
MARKETAUX_API_KEY_3=your-third-marketaux-key
๐ก Pro Tip: Environment variables are optional! Users can configure their own AI provider keys through the settings page.
Choose your preferred mode:
Development Mode (with auto-reload):
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Production Mode (optimized performance):
uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4
๐ That's it! Open your browser and navigate to http://localhost:8000
When you first run Caterpillar, we automatically create an admin account for you:
| Field | Value |
|---|---|
| Username | admin |
| Password | admin123 |
[email protected] | |
| Role | Administrator |
โ ๏ธ Security Notice: Please change the default password immediately after your first login for security purposes.
No registration required - jump right in and explore:
/) - Main stock analysis interface with real-time data/static/login.html) - Secure user authentication/static/register.html) - Quick and easy account creationUnlock advanced capabilities with a free account:
/static/settings.html) - Customize your AI provider preferences and account details/static/admin.html) - Comprehensive user management (Administrator access only)POST /api/auth/login - Login userPOST /api/auth/register - Register user baruPOST /api/auth/logout - Logout userGET /api/auth/me - Get current user infoPOST /api/auth/change-password - Change passwordGET /api/settings - Get user settingsPUT /api/settings - Update user settings (LLM provider & API keys)GET /api/admin/users - List all usersPOST /api/admin/users - Create new userPUT /api/admin/users/{user_id} - Update userDELETE /api/admin/users/{user_id} - Delete userPOST /api/admin/users/{user_id}/reset-password - Reset user passwordGET /api/analyze-progress?stock={symbol} - Analyze stock (SSE stream)WebSocket /api/chat?stock={symbol}&token={token} - Chat with AI expertGET /api/top-stocks - Get top profitable stocksGET /api/sectors-tickers - Get S&P 500 sectors & tickersGET /api/health - Health check- id (INTEGER PRIMARY KEY)
- username (TEXT UNIQUE)
- email (TEXT UNIQUE)
- password_hash (TEXT)
- role (TEXT: 'admin' | 'user')
- is_active (INTEGER: 0 | 1)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)
- id (INTEGER PRIMARY KEY)
- user_id (INTEGER FOREIGN KEY)
- llm_provider (TEXT: 'openai' | 'gemini')
- openai_api_key (TEXT)
- gemini_api_key (TEXT)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)
- id (INTEGER PRIMARY KEY)
- user_id (INTEGER FOREIGN KEY)
- token (TEXT UNIQUE)
- expires_at (TIMESTAMP)
- created_at (TIMESTAMP)
- id (INTEGER PRIMARY KEY)
- stock (TEXT)
- analysis_date (TEXT)
- result_json (TEXT)
- created_at (TIMESTAMP)
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY | OpenAI API key for GPT-4 | Optional* |
OPENAI_BASE_URL | OpenAI API base URL | Optional |
GEMINI_API_KEY | Google Gemini API key | Optional* |
MARKETAUX_API_KEY | MarketAux API key for news data | Optional |
MARKETAUX_API_KEY_1 | First MarketAux API key (for multiple keys) | Optional |
MARKETAUX_API_KEY_2 | Second MarketAux API key (for multiple keys) | Optional |
MARKETAUX_API_KEY_3 | Third MarketAux API key (for multiple keys) | Optional |
PORT | Server port (default: 8000) | Optional |
*Users can set their own AI provider API keys through the settings interface
/static/register.htmlcaterpillar_2/
โโโ backend/
โ โโโ Fundamental.py # Fundamental analysis
โ โโโ sentiment.py # Sentiment analysis
โ โโโ investment_analysis.py # Investment recommendations
โ โโโ database.py # Database operations & user management
โ โโโ auth.py # Authentication dependencies
โ โโโ api_routes.py # API endpoints
โ โโโ llm_provider.py # LLM provider abstraction
โ โโโ analysis_cache.py # Analysis caching
โ โโโ googlenews.py # News fetching
โ โโโ top_stocks_search.py # Top stocks finder
โ โโโ models.py # Pydantic models
โโโ frontend/
โ โโโ index.html # Main page
โ โโโ login.html # Login page
โ โโโ register.html # Register page
โ โโโ admin.html # Admin panel
โ โโโ settings.html # User settings
โ โโโ app.js # Main JavaScript
โ โโโ style.css # Styles
โโโ main.py # FastAPI application
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Docker configuration
โโโ docker-compose.yml # Docker compose
โโโ README.md # This file
app_database.sqlite3 dan restart aplikasiadmin123We believe in the power of community! Caterpillar is open source and we welcome contributions from developers of all skill levels.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Found a bug? We'd love to hear about it! Please open an issue with:
Have an idea for a new feature? Open an issue and tell us:
Security is paramount in financial applications. If you discover a security vulnerability, please:
We appreciate responsible disclosure and will acknowledge your contribution.
Caterpillar Stock Analysis Platform is licensed under the GNU General Public License v2.0.
For the complete license text, see the LICENSE file.