Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

docs update

tilakpatel22d68faf38873b
diff --git a/LICENSE b/LICENSE
index 86d1199c9..270b922af 100644
--- a/LICENSE
+++ b/LICENSE
@@ -23,18 +23,29 @@ DUAL LICENSING NOTICE
Fincept Terminal is available under two licensing options:
1. AGPL-3.0 License (Open Source)
- - Free for personal, educational, and non-commercial use
+ - Free for personal and educational use
+ - Free to use with your own data sources
- Requires sharing modifications if you distribute or provide as a network service
- Full source code must remain available under AGPL-3.0
- See full license text at: https://www.gnu.org/licenses/agpl-3.0.html
-2. Commercial License (Proprietary)
- - Required if you want to use Fincept Terminal in commercial products/services
- without open-sourcing your modifications
- - Allows integration into proprietary software
+2. Commercial License
+ - Required for any business/commercial use
+ - Required to access Fincept Data Sources and APIs for commercial purposes
- No obligation to share source code
- - Priority support and custom features available
- - Contact: [email protected] for pricing and terms
+ - Priority support available
+ - See docs/COMMERCIAL_LICENSE.md for pricing and terms
+
+================================================================================
+FINCEPT DATA & API
+================================================================================
+
+The Fincept Terminal software is free under AGPL-3.0.
+
+Fincept Data Sources and APIs are separate services that require:
+- Commercial License for business use ($10,200/year)
+- University License for academic institutions ($799/month)
+- Free for personal/educational individual use
================================================================================
TRADEMARK NOTICE
@@ -49,8 +60,6 @@ except as necessary to comply with the AGPL-3.0 attribution requirements.
Use of the trademarks to promote derivative works or competing products
is strictly prohibited without a trademark license agreement.
-For trademark licensing inquiries, contact: [email protected]
-
================================================================================
ADDITIONAL RESTRICTIONS
================================================================================
@@ -73,12 +82,8 @@ While the AGPL-3.0 grants broad freedoms, the following restrictions apply:
- Must clearly differentiate derivative works from the official version
- Cannot imply endorsement by Fincept Corporation
-4. PATENT GRANT
- Contributors grant a patent license for their contributions, but this
- does not extend to combinations with other software.
-
================================================================================
-CONTRIBUTOR LICENSE AGREEMENT (CLA)
+CONTRIBUTOR LICENSE AGREEMENT
================================================================================
By contributing to Fincept Terminal, you agree that:
@@ -92,40 +97,38 @@ By contributing to Fincept Terminal, you agree that:
3. Your contributions are provided "as-is" without warranties.
-4. You agree to the terms in CONTRIBUTING.md and CLA.md (if present).
-
-See CLA.md for the complete Contributor License Agreement.
+4. Contributing does not grant you commercial rights to use Fincept
+ Data Sources and APIs.
================================================================================
-COMMERCIAL USE EXAMPLES
+COMMERCIAL USE
================================================================================
You NEED a commercial license if you:
-- Embed Fincept Terminal in a proprietary financial platform
-- Offer Fincept Terminal as a managed SaaS without open-sourcing modifications
-- White-label Fincept Terminal for enterprise clients
-- Integrate Fincept Terminal into commercial trading systems
+- Use Fincept Terminal for any business purpose
+- Use Fincept Data Sources or APIs commercially
+- Are a startup (even with $0 revenue)
+- Use internally at a company
+- Offer as SaaS or cloud platform
+- White-label or resell
You DON'T need a commercial license if you:
-- Use Fincept Terminal internally without distribution
-- Contribute improvements back to the open-source project
-- Fork and modify while keeping source code public under AGPL-3.0
-- Run it as a network service while providing source code to all users
+- Use for personal learning
+- Are an individual student
+- Use with your own data sources (non-commercial)
+- Contribute to the open-source project
================================================================================
CONTACT INFORMATION
================================================================================
-General Inquiries: [email protected]
-Commercial Licensing: [email protected]
-Trademark Licensing: [email protected]
-Security Issues: [email protected]
-
+Phone: +91-9773034108
Website: https://fincept.in
Repository: https://github.com/Fincept-Corporation/FinceptTerminal
Documentation: https://github.com/Fincept-Corporation/FinceptTerminal/tree/main/docs
================================================================================
-Last Updated: January 5, 2026
-Version: 3.0.15
+Last Updated: February 2026
+Version: 3.3.1
diff --git a/docs/ADD_NEW_DATA_SOURCE.md b/docs/ADD_NEW_DATA_SOURCE.md
deleted file mode 100644
index 344031fec..000000000
--- a/docs/ADD_NEW_DATA_SOURCE.md
+++ /dev/null
@@ -1,163 +0,0 @@
-# Adding a New Data Source
-
-Quick guide to add a new data source from Python to Frontend.
-
-## Step 1: Create Python Script
-
-Location: `src-tauri/resources/scripts/your_source_data.py`
-
-```python
-import sys
-
-def main():
- if len(sys.argv) < 2:
- print("Error: No command provided")
- return
-
- command = sys.argv[1]
-
- if command == "get_data":
- # Your data fetching logic
- result = fetch_some_data()
- print(result) # Output to stdout
-
- elif command == "search":
- query = sys.argv[2] if len(sys.argv) > 2 else ""
- # Your search logic
- print(search_results)
-
-if __name__ == "__main__":
- main()
-```
-
-**Key Points:**
-- Accept commands via `sys.argv`
-- Print results to stdout (JSON recommended)
-- Handle errors gracefully
-
-## Step 2: Create Rust Bridge
-
-Location: `src-tauri/src/commands/your_source.rs`
-
-```rust
-use std::process::Command;
-use crate::utils::python::{get_python_path, get_script_path};
-
-/// Execute your data source Python script
-#[tauri::command]
-pub async fn execute_your_source_command(
- app: tauri::AppHandle,
- command: String,
- args: Vec<String>,
-) -> Result<String, String> {
- let python_path = get_python_path(&app)?;
- let script_path = get_script_path(&app, "your_source_data.py")?;
-
- if !script_path.exists() {
- return Err(format!("Script not found at: {}", script_path.display()));
- }
-
- let mut cmd_args = vec![script_path.to_string_lossy().to_string(), command];
- cmd_args.extend(args);
-
- let output = Command::new(&python_path)
- .args(&cmd_args)
- .output()
- .map_err(|e| format!("Failed to execute command: {}", e))?;
-
- if output.status.success() {
- Ok(String::from_utf8_lossy(&output.stdout).to_string())
- } else {
- Err(String::from_utf8_lossy(&output.stderr).to_string())
- }
-}
-
-/// Get specific data (wrapper for convenience)
-#[tauri::command]
-pub async fn get_your_source_data(
- app: tauri::AppHandle,
- param: String,
-) -> Result<String, String> {
- execute_your_source_command(app, "get_data".to_string(), vec![param]).await
-}
-```
-
-## Step 3: Register Module
-
-**File: `src-tauri/src/commands/mod.rs`**
-
-```rust
-pub mod your_source;
-```
-
-## Step 4: Register Commands
-
-**File: `src-tauri/src/lib.rs`**
-
-Add to the `invoke_handler!` macro:
-
-```rust
-.invoke_handler(tauri::generate_handler![
- // ... other commands
- commands::your_source::execute_your_source_command,
- commands::your_source::get_your_source_data,
-])
-```
-
-## Step 5: Call from Frontend
-
-**React/TypeScript:**
-
-```typescript
-import { invoke } from '@tauri-apps/api/core';
-
-// Generic command
-const result = await invoke('execute_your_source_command', {
- command: 'get_data',
- args: ['param1', 'param2']
-});
-
-// Specific wrapper function
-const data = await invoke('get_your_source_data', {
- param: 'some_value'
-});
-
-console.log(JSON.parse(result));
-```
-
-## Flow Diagram
-
-```
-Frontend (React)
- ↓ invoke('command_name', {args})
-Rust Bridge (Tauri Command)
- ↓ Execute Python with args
-Python Script (Data Source)
- ↓ Fetch data from API/DB
-Python Script
- ↓ Print to stdout
-Rust Bridge
- ↓ Capture output
-Frontend
- ↓ Receive JSON result
-```
-
-## Tips
-
-- **Return JSON** from Python for easy parsing
-- **Error handling**: Python errors go to stderr, Rust catches them
-- **Testing**: Test Python script standalone first
-- **Compile**: Run `cargo check` after adding Rust files
-- **Hot reload**: Frontend changes hot-reload, backend needs restart
-
-## Example Full Flow
-
-1. Python script fetches stock data from API
-2. Rust command calls Python with symbol parameter
-3. Python returns JSON: `{"price": 150.25, "volume": 1000000}`
-4. Rust receives stdout and returns to frontend
-5. React component displays the data
-
----
-
-**All 42 data sources follow this exact pattern!**
diff --git a/docs/BROKER_INTEGRATION_GUIDE.md b/docs/BROKER_INTEGRATION_GUIDE.md
deleted file mode 100644
index 08fe7a6b2..000000000
--- a/docs/BROKER_INTEGRATION_GUIDE.md
+++ /dev/null
@@ -1,379 +0,0 @@
-# Broker Integration Guide
-
-Complete checklist for integrating Indian stock brokers from OpenAlgo into Fincept Terminal.
-
-## Pre-Integration Checklist
-
-### 1. Study OpenAlgo Source (Local Reference Project)
-
-**Local Path:** `C:\projects\featureimplement\openalgo\broker\{broker_name}\`
-
-```
-C:\projects\featureimplement\openalgo\broker\{broker_name}\
-├── api\
-│ ├── auth_api.py # OAuth/TOTP flow, token exchange
-│ ├── order_api.py # Place/modify/cancel orders
-│ ├── data.py # Quotes, historical, depth
-│ └── funds.py # Margins, balances
-├── database\
-│ └── master_contract_db.py # Symbol database, CSV parsing
-├── mapping\
-│ ├── order_data.py # Order field mapping
-│ └── transform_data.py # Response transformation
-└── streaming\ # WebSocket implementation
-```
-
-**Extract from OpenAlgo:**
-- [ ] API endpoints and headers format
-- [ ] Auth flow (OAuth redirect URI, token exchange)
-- [ ] Order/position/holding field mappings
-- [ ] Master contract CSV URLs and parsing logic
-- [ ] WebSocket connection and message format
-
-## Implementation Checklist
-
-### Phase 1: Rust Backend (`src-tauri/src/commands/brokers/`)
-
-Create `{broker}.rs` with these commands:
-
-| Command | Purpose | Priority |
-|---------|---------|----------|
-| `{broker}_exchange_token` | Exchange auth code for access token | P0 |
-| `{broker}_validate_token` | Validate existing token | P0 |
-| `{broker}_place_order` | Place new order | P0 |
-| `{broker}_modify_order` | Modify existing order | P0 |
-| `{broker}_cancel_order` | Cancel order | P0 |
-| `{broker}_get_orders` | Fetch all orders | P0 |
-| `{broker}_get_positions` | Fetch positions | P0 |
-| `{broker}_get_holdings` | Fetch holdings | P0 |
-| `{broker}_get_funds` | Fetch margins/balance | P0 |
-| `{broker}_get_quotes` | Get LTP/quotes | P0 |
-| `{broker}_get_history` | Historical OHLCV | P0 |
-| `{broker}_get_depth` | Market depth L5 | P1 |
-| `{broker}_get_trade_book` | Executed trades | P1 |
-| `{broker}_download_master_contract` | Download symbol CSV | P0 |
-| `{broker}_search_symbol` | Search in master contract | P0 |
-| `{broker}_get_token_for_symbol` | Symbol → Token lookup | P0 |
-| `{broker}_get_symbol_by_token` | Token → Symbol lookup | P1 |
-| `{broker}_get_master_contract_metadata` | Last updated timestamp | P0 |
-
-**Register in `lib.rs`:**
-```rust
-commands::brokers::{broker}_exchange_token,
-commands::brokers::{broker}_place_order,
-// ... all commands
-```
-
-### Phase 2: TypeScript Adapter (`src/brokers/stocks/india/{broker}/`)
-
-**File Structure:**
-```
-{broker}/
-├── {Broker}Adapter.ts # Main adapter class
-├── constants.ts # API URLs, exchange maps, metadata
-├── mapper.ts # Response transformers
-└── index.ts # Export barrel
-```
-
-**Required Methods in Adapter:**
-
-| Method | Invokes Rust Command | Notes |
-|--------|---------------------|-------|
-| `setCredentials()` | - | Store API key/secret in memory |
-| `getAuthUrl()` | - | Return OAuth URL |
-| `authenticate()` | `{broker}_exchange_token` | Handle OAuth callback |
-| `initFromStorage()` | `get_indian_broker_credentials` | Restore session |
-| `placeOrderInternal()` | `{broker}_place_order` | |
-| `modifyOrderInternal()` | `{broker}_modify_order` | |
-| `cancelOrderInternal()` | `{broker}_cancel_order` | |
-| `getOrdersInternal()` | `{broker}_get_orders` | |
-| `getTradeBookInternal()` | `{broker}_get_trade_book` | |
-| `getPositionsInternal()` | `{broker}_get_positions` | |
-| `getHoldingsInternal()` | `{broker}_get_holdings` | |
-| `getFundsInternal()` | `{broker}_get_funds` | |
-| `getQuoteInternal()` | `{broker}_get_quotes` | |
-| `getOHLCVInternal()` | `{broker}_get_history` | |
-| `getMarketDepthInternal()` | `{broker}_get_depth` | |
-| `searchSymbols()` | `{broker}_search_symbol` | **Don't forget!** |
-| `getInstrument()` | `{broker}_get_token_for_symbol` | **Don't forget!** |
-| `downloadMasterContract()` | `{broker}_download_master_contract` | **Don't forget!** |
-| `getMasterContractLastUpdated()` | `{broker}_get_master_contract_metadata` | **Don't forget!** |
-
-### Phase 3: Registration
-
-**`src/brokers/stocks/registry.ts`:**
-```typescript
-{broker}: {
- id: '{broker}',
- name: '{broker}',
- displayName: '{Broker Name}',
- region: 'india',
- country: 'IN',
- currency: 'INR',
- exchanges: ['NSE', 'BSE', 'NFO', 'MCX'],
- authType: 'oauth', // or 'totp'
- features: { webSocket: true, amo: true, gtt: false, ... },
- tradingFeatures: { marketOrders: true, limitOrders: true, ... },
- productTypes: ['CNC', 'INTRADAY', 'MARGIN'],
-}
-```
-
-**`src/brokers/stocks/init.ts`:**
-```typescript
-import { {Broker}Adapter } from './india/{broker}/{Broker}Adapter';
-registerBrokerAdapter('{broker}', {Broker}Adapter);
-```
-
-### Phase 4: UI Integration
-
-**Files to update:**
-- `BrokerConfigPanel.tsx` - Add broker to dropdown
-- `BrokerAuthPanel.tsx` - Handle auth flow UI
-- `BrokerSwitcher.tsx` - Add broker option
-
-**No code changes needed if:**
-- Adapter follows `IStockBrokerAdapter` interface
-- Broker registered in `registry.ts` and `init.ts`
-
-## Common Mistakes to Avoid
-
-### ❌ Mistake 1: Missing Master Contract Methods
-**Problem:** Fyers was missing `searchSymbols()`, `getInstrument()`, `downloadMasterContract()`, `getMasterContractLastUpdated()` while Rust backend had the commands.
-
-**Fix:** Always implement ALL 4 master contract methods in TypeScript adapter.
-
-### ❌ Mistake 2: Inconsistent Rust Command Naming
-**Problem:** Mixed naming like `download_fyers_master_contract` vs `fyers_download_master_contract`.
-
-**Fix:** Use consistent prefix: `{broker}_{action}` (e.g., `fyers_place_order`).
-
-### ❌ Mistake 3: Not Registering Commands in lib.rs
-**Problem:** Rust command exists but not callable from TypeScript.
-
-**Fix:** Add every command to `tauri::generate_handler![]` in `lib.rs`.
-
-### ❌ Mistake 4: Missing Error Handling in Adapter
-**Problem:** API errors not properly caught and returned.
-
-**Fix:** Always wrap invoke calls in try-catch, return fallback data on error.
-
-### ❌ Mistake 5: Forgetting to Import `Instrument` Type
-**Problem:** TypeScript error when adding `searchSymbols()`.
-
-**Fix:** Add `Instrument` to imports from `../../types`.
-
-### ❌ Mistake 6: Master Contract Not Persisted (Zerodha)
-**Problem:** `downloadMasterContract` returns data but doesn't store to SQLite.
-
-**Fix:** Persist to database like Fyers implementation.
-
-### ❌ Mistake 7: Wrong ProductType Values in Metadata
-**Problem:** Using broker-specific product types ('CNC', 'MIS', 'NRML') in `productTypes` array instead of unified types.
-
-**Fix:** Always use unified ProductType values: `['CASH', 'INTRADAY', 'MARGIN']`. Map broker-specific codes in `mapper.ts`.
-
-### ❌ Mistake 8: Wrong ProductType Return in Mapper
-**Problem:** `fromBrokerProduct()` function returns broker-specific strings ('CNC', 'MIS') instead of unified ProductType.
-
-**Fix:** Mapper must convert broker codes to unified types:
-```typescript
-// Broker 'D' (Delivery) → 'CASH' for equity, 'MARGIN' for F&O
-// Broker 'I' (Intraday) → 'INTRADAY'
-export function fromBrokerProduct(product: string, exchange: string): ProductType {
- if (product === 'D') {
- return ['NFO', 'BFO', 'MCX', 'CDS'].includes(exchange) ? 'MARGIN' : 'CASH';
- }
- return 'INTRADAY';
-}
-```
-
-### ❌ Mistake 9: Wrong OrderStatus Values
-**Problem:** Using 'COMPLETED' instead of 'FILLED' in status mapping.
-
-**Fix:** Check `OrderStatus` type definition and use exact values:
-```typescript
-// Valid: 'PENDING' | 'OPEN' | 'PARTIALLY_FILLED' | 'FILLED' | 'CANCELLED' | 'REJECTED' | 'EXPIRED' | 'TRIGGER_PENDING'
-// Wrong: 'COMPLETED' (doesn't exist)
-```
-
-### ❌ Mistake 10: Wrong Order Property Name
-**Problem:** Using `message` instead of `statusMessage` in Order object.
-
-**Fix:** Check the `Order` interface - it uses `statusMessage?: string`, not `message`.
-
-## Verification Checklist
-
-### Rust Backend
-- [ ] All commands compile (`cargo check`)
-- [ ] Commands registered in `lib.rs`
-- [ ] Proper error handling with `ApiResponse<T>`
-- [ ] Master contract stored in SQLite
-
-### TypeScript Adapter
-- [ ] Extends `BaseStockBrokerAdapter`
-- [ ] All required internal methods implemented
-- [ ] All 4 master contract methods implemented
-- [ ] `Instrument` and `ProductType` types imported
-- [ ] Mapper returns unified `ProductType` values (not broker-specific)
-- [ ] Order status uses valid `OrderStatus` values (FILLED not COMPLETED)
-- [ ] Order object uses `statusMessage` (not `message`)
-- [ ] No TypeScript errors (`bun run build`)
-
-### Registration
-- [ ] Metadata in `registry.ts`
-- [ ] Adapter registered in `init.ts`
-- [ ] Singleton exported from adapter file
-
-### UI
-- [ ] Broker appears in BrokerSwitcher
-- [ ] OAuth flow works (redirect → callback → token)
-- [ ] Credentials persist across app restart
-- [ ] Trading panel shows broker data
-
-### End-to-End Testing
-- [ ] Login flow completes
-- [ ] Funds/margins display correctly
-- [ ] Orders can be placed
-- [ ] Positions/holdings load
-- [ ] Historical charts work
-- [ ] Symbol search works
-- [ ] Master contract downloads
-
-## Post-Implementation Cross-Check
-
-**IMPORTANT:** After implementing a broker, perform this cross-check against the OpenAlgo source to verify correctness.
-
-### Cross-Check Checklist
-
-#### 1. API Endpoints Verification
-- [ ] **Base URL** matches OpenAlgo `baseurl.py` or constants
-- [ ] **Auth URL** (if separate) matches OpenAlgo `auth_api.py`
-- [ ] **Order endpoints** (`/orders`, `/orders/{id}`) match OpenAlgo `order_api.py`
-- [ ] **Portfolio endpoints** (`/positions`, `/holdings`, `/funds`) match OpenAlgo
-- [ ] **Market data endpoints** (`/quotes`, `/history`, `/depth`) match OpenAlgo `data.py`
-
-#### 2. Headers Verification
-- [ ] **Auth header** name correct (e.g., `access-token`, `Authorization`, `X-Auth-Token`)
-- [ ] **API key header** name correct (e.g., `api-key`, `client-id`, `appkey`)
-- [ ] **Content-Type** matches OpenAlgo (usually `application/json`)
-- [ ] Any **additional required headers** included
-
-#### 3. Exchange Mappings Verification
-Compare `constants.ts` EXCHANGE_MAP with OpenAlgo `transform_data.py`:
-- [ ] NSE → (broker format)
-- [ ] BSE → (broker format)
-- [ ] NFO → (broker format)
-- [ ] BFO → (broker format)
-- [ ] MCX → (broker format)
-- [ ] CDS → (broker format)
-- [ ] BCD → (broker format) if applicable
-- [ ] Index exchanges (NSE_INDEX, BSE_INDEX) if applicable
-
-#### 4. Product Type Mappings Verification
-Compare `constants.ts` PRODUCT_MAP with OpenAlgo `transform_data.py`:
-- [ ] CASH/CNC → (broker format)
-- [ ] INTRADAY/MIS → (broker format)
-- [ ] MARGIN/NRML → (broker format)
-
-#### 5. Order Type Mappings Verification
-Compare `constants.ts` ORDER_TYPE_MAP with OpenAlgo `transform_data.py`:
-- [ ] MARKET → (broker format)
-- [ ] LIMIT → (broker format)
-- [ ] STOP → (broker format, e.g., SL, STOP_LOSS)
-- [ ] STOP_LIMIT → (broker format, e.g., SL-M, STOP_LOSS_MARKET)
-
-#### 6. Response Field Mappings Verification
-Compare `mapper.ts` with OpenAlgo `order_data.py` / `transform_data.py`:
-
-**Order Response:**
-- [ ] `orderId` field name correct
-- [ ] `tradingSymbol` / `symbol` field name correct
-- [ ] `exchangeSegment` / `exchange` field name correct
-- [ ] `transactionType` / `side` field name correct
-- [ ] `quantity`, `filledQty`, `remainingQuantity` field names correct
-- [ ] `price`, `tradedPrice`, `averagePrice` field names correct
-- [ ] `orderStatus` field name and values correct (PENDING, TRADED, REJECTED, etc.)
-- [ ] `omsErrorDescription` / error message field name correct
-
-**Position Response:**
-- [ ] `netQty` field name correct
-- [ ] `dayBuyQty`, `daySellQty` field names correct
-- [ ] `costPrice`, `lastPrice` field names correct
-- [ ] `realizedProfit`, `unrealizedProfit` field names correct
-
-**Funds Response:**
-- [ ] `availableBalance` field name correct (watch for typos like `availabelBalance`)
-- [ ] `utilizedAmount` / `usedMargin` field name correct
-- [ ] `collateralAmount` field name correct
-
-**Quote Response:**
-- [ ] `last_price` / `lastPrice` field name (check both cases)
-- [ ] `ohlc.open/high/low/close` structure correct
-- [ ] `depth.buy/sell` array structure correct
-- [ ] `volume`, `oi` field names correct
-
-#### 7. Auth Flow Verification
-Compare with OpenAlgo `auth_api.py`:
-- [ ] OAuth flow steps match (consent → login → token exchange)
-- [ ] Token exchange endpoint and parameters correct
-- [ ] Token validation method correct
-- [ ] Response fields (`accessToken`, `userId`, etc.) correctly parsed
-
-#### 8. Master Contract Verification
-Compare with OpenAlgo `master_contract_db.py`:
-- [ ] CSV/JSON download URL correct
-- [ ] Column/field parsing matches OpenAlgo logic
-- [ ] Symbol, securityId, exchange mapping correct
-- [ ] Instrument type detection logic matches
-
-### Cross-Check Command
-
-After implementation, run:
-```bash
-# TypeScript compilation check
-bunx tsc --noEmit
-
-# Rust compilation check
-cargo check --manifest-path src-tauri/Cargo.toml
-```
-
-### Common Cross-Check Findings
-
-| Issue | Where to Check | Fix |
-|-------|----------------|-----|
-| Wrong header name | OpenAlgo `order_api.py` headers dict | Update Rust `dhan_request()` |
-| Wrong endpoint path | OpenAlgo `get_url()` calls | Update Rust endpoint strings |
-| Wrong field name | OpenAlgo response parsing | Update TS `mapper.ts` |
-| Missing exchange | OpenAlgo `map_exchange_type()` | Add to `constants.ts` |
-| Wrong order type | OpenAlgo `map_order_type()` | Update `ORDER_TYPE_MAP` |
-| Typo in API field | OpenAlgo source (e.g., `availabelBalance`) | Handle both spellings |
-
-## Quick Reference: File Locations
-
-| Component | Location |
-|-----------|----------|
-| Rust commands | `src-tauri/src/commands/brokers/{broker}.rs` |
-| Rust mod.rs | `src-tauri/src/commands/brokers/mod.rs` |
-| Rust lib.rs | `src-tauri/src/lib.rs` |
-| TS Adapter | `src/brokers/stocks/india/{broker}/{Broker}Adapter.ts` |
-| TS constants | `src/brokers/stocks/india/{broker}/constants.ts` |
-| TS mapper | `src/brokers/stocks/india/{broker}/mapper.ts` |
-| Registry | `src/brokers/stocks/registry.ts` |
-| Init | `src/brokers/stocks/init.ts` |
-| UI Setup | `src/components/tabs/equity-trading/components/BrokerSetupPanel.tsx` |
-| UI Auth | `src/components/tabs/equity-trading/components/BrokerAuthPanel.tsx` |
-
-## OpenAlgo → Fincept Mapping
-
-| OpenAlgo File | Fincept Equivalent |
-|---------------|-------------------|
-| `api/auth_api.py` | Rust: `{broker}_exchange_token`, TS: `authenticate()` |
-| `api/order_api.py` | Rust: `{broker}_place/modify/cancel_order` |
-| `api/data.py` | Rust: `{broker}_get_quotes/history/depth` |
-| `api/funds.py` | Rust: `{broker}_get_funds` |
-| `database/master_contract_db.py` | Rust: `{broker}_download_master_contract`, symbol search commands |
-| `mapping/order_data.py` | TS: `mapper.ts` |
-| `mapping/transform_data.py` | TS: `mapper.ts` |
-
----
-**Last Updated:** January 2025 | **Supported Brokers:** Angel One, Zerodha, Fyers, Upstox, Dhan
diff --git a/docs/CLA.md b/docs/CLA.md
deleted file mode 100644
index da8413d4d..000000000
--- a/docs/CLA.md
+++ /dev/null
@@ -1,311 +0,0 @@
-# Contributor License Agreement (CLA)
-
-## Fincept Terminal Individual Contributor License Agreement
-
-**Version 1.0 - Effective January 5, 2026**
-
-Thank you for your interest in contributing to Fincept Terminal (the "Project"), maintained by Fincept Corporation ("Fincept", "we", "us", or "our").
-
-This Contributor License Agreement ("Agreement") documents the rights granted by contributors to Fincept. By submitting a contribution to the Project, you accept and agree to the following terms and conditions for your present and future contributions.
-
----
-
-## 1. Definitions
-
-**"You" or "Your"** means the individual copyright owner who is making this Agreement with Fincept.
-
-**"Contribution"** means any original work of authorship, including any modifications or additions to existing work, that you intentionally submit to Fincept for inclusion in, or documentation of, the Project. This includes:
-- Source code
-- Documentation
-- Configuration files
-- Issue reports with code snippets
-- Any other copyrightable material
-
-**"Submit"** means any form of electronic, verbal, or written communication sent to Fincept or its representatives, including but not limited to:
-- Git pull requests
-- Commits to repositories
-- Communications on mailing lists
-- Issue trackers
-- Source code control systems
-
----
-
-## 2. Grant of Copyright License
-
-Subject to the terms and conditions of this Agreement, You hereby grant to Fincept Corporation and to recipients of software distributed by Fincept Corporation a **perpetual**, **worldwide**, **non-exclusive**, **no-charge**, **royalty-free**, **irrevocable** copyright license to:
-
-- **Reproduce** Your Contributions
-- **Prepare derivative works** of Your Contributions
-- **Publicly display** Your Contributions
-- **Publicly perform** Your Contributions
-- **Distribute** Your Contributions and derivative works thereof
-- **Sublicense** the above rights to third parties
-
-This license includes the right for Fincept to distribute Your Contributions under:
-- The GNU Affero General Public License v3.0 (AGPL-3.0)
-- Proprietary commercial licenses
-- Any other license Fincept may choose
-
----
-
-## 3. Grant of Patent License
-
-Subject to the terms and conditions of this Agreement, You hereby grant to Fincept Corporation and to recipients of software distributed by Fincept Corporation a **perpetual**, **worldwide**, **non-exclusive**, **no-charge**, **royalty-free**, **irrevocable** (except as stated in this section) patent license to:
-
-- **Make** the Project
-- **Use** the Project
-- **Offer to sell** the Project
-- **Sell** the Project
-- **Import** the Project
-- **Transfer** the Project
-
-Where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Project to which such Contribution(s) was submitted.
-
-**Defensive Termination**: If You or any of your affiliates directly or indirectly commence a patent action against Fincept or any user of the Project (including cross-claims or counterclaims in a lawsuit) alleging that the Project or a Contribution incorporated within the Project constitutes patent infringement, then any patent licenses granted to You under this Agreement shall terminate as of the date such litigation is filed.
-
----
-
-## 4. Representations and Warranties
-
-You represent and warrant that:
-
-### 4.1 Authority to Grant License
-You are legally entitled to grant the above licenses. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that:
-- You have received permission to make Contributions on behalf of that employer
-- Your employer has waived such rights for your Contributions to Fincept
-- Your employer has executed a separate Corporate CLA with Fincept
-
-### 4.2 Original Work
-Each of Your Contributions is Your original creation. If any part of Your Contribution is not Your original creation, you represent that:
-- You have the right to submit it under the open source license indicated in the file
-- You provide complete details of any third-party license or other restriction in your Contribution submission
-
-### 4.3 No Violations
-Your Contribution does not violate any third-party rights, including:
-- Copyright
-- Trademark
-- Patent
-- Trade secret
-- Privacy rights
-- Publicity rights
-- Other proprietary rights
-
-### 4.4 Compliance with Export Laws
-Your Contribution complies with all applicable export control laws and regulations.
-
----
-
-## 5. Contribution Submission
-
-### 5.1 Notification of Inaccuracy
-You agree to notify Fincept of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. Notification should be sent to: **[email protected]**
-
-### 5.2 No Support Obligation
-You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all.
-
-**However**, unless required by applicable law or agreed to in writing, You provide Your Contributions on an **"AS IS" BASIS**, **WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND**, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
-
----
-
-## 6. Dual Licensing Acknowledgment
-
-You acknowledge and agree that:
-
-### 6.1 Public Distribution
-Fincept may distribute Your Contributions as part of the Project under the AGPL-3.0 license to the general public at no cost.
-
-### 6.2 Commercial Licensing
-Fincept may also distribute Your Contributions as part of the Project under proprietary commercial licenses to customers who purchase commercial licenses from Fincept.
-
-### 6.3 No Royalty Obligation
-You will not be entitled to any royalty or payment from Fincept's commercial licensing of the Project, even though Your Contributions may be included.
-
-### 6.4 Contributor Recognition
-Fincept will make reasonable efforts to acknowledge Your Contributions in project documentation and release notes, but this is not legally binding.
-
----
-
-## 7. Moral Rights
-
-To the fullest extent permitted under applicable law, You waive, and agree not to assert, all of Your "moral rights" in or relating to Your Contributions for the benefit of Fincept and its successors.
-
-If the waiver is not permitted by applicable law, You agree not to enforce such moral rights against Fincept, its licensees, transferees, successors, and assigns.
-
----
-
-## 8. Employer Contributions
-
-If your employer(s) has rights to intellectual property that you create that includes your Contributions:
-
-### 8.1 Employer Agreement Required
-You must have your employer execute a **Corporate Contributor License Agreement** before submitting any Contributions on behalf of your employer.
-
-### 8.2 Personal Contributions
-If you are making a Contribution in your personal capacity (not on behalf of your employer), you represent that:
-- The Contribution was created entirely in your personal time
-- The Contribution is not within the scope of your employment duties
-- Your employer has no claim to the Contribution
-
----
-
-## 9. Government Employees
-
-If You are a U.S. Government employee and Your Contributions are created as part of your employment, You represent that:
-
-- The Contribution is a "work of the United States Government" as defined in 17 U.S.C. § 101
-- As such, the Contribution is not subject to copyright protection in the United States
-- Fincept may distribute the Contribution as part of the Project
-
-If You are a government employee of a country other than the United States, please contact **[email protected]** before submitting Contributions.
-
----
-
-## 10. Third-Party Content
-
-### 10.1 Disclosure Required
-If Your Contribution includes material that You did not author, You must:
-
-1. Clearly identify any third-party content
-2. Provide complete details of its source
-3. Confirm it is available under a license compatible with AGPL-3.0
-4. Include all required attribution and license notices
-
-### 10.2 Acceptable Third-Party Licenses
-Third-party content must be under one of these licenses:
-- MIT
-- BSD (2-clause or 3-clause)
-- Apache 2.0
-- LGPL 2.1 or later
-- AGPL 3.0
-- Public Domain / CC0
-
-Contact **[email protected]** if you wish to include content under a different license.
-
----
-
-## 11. Agreement Scope
-
-### 11.1 Ongoing Agreement
-This Agreement applies to all Contributions you submit to the Project, both now and in the future, until you provide written notice of termination to Fincept.
-
-### 11.2 Termination
-You may terminate this Agreement by providing written notice to **[email protected]**. Termination will:
-- Apply only to future Contributions
-- Not revoke licenses for Contributions already submitted
-- Not affect Fincept's rights to use previously submitted Contributions
-
-### 11.3 Survival
-Sections 2, 3, 6, 7, 9, and 12 survive termination of this Agreement.
-
----
-
-## 12. Miscellaneous
-
-### 12.1 Governing Law
-This Agreement shall be governed by and construed in accordance with the laws of the State of Delaware, United States, without regard to its conflict of law provisions.
-
-### 12.2 Entire Agreement
-This Agreement constitutes the entire agreement between You and Fincept concerning Your Contributions and supersedes all prior agreements or understandings.
-
-### 12.3 Amendments
-Fincept may amend this Agreement by posting a revised version at:
-**https://github.com/Fincept-Corporation/FinceptTerminal/blob/main/docs/CLA.md**
-
-Continued submission of Contributions after changes constitutes acceptance of the amended Agreement.
-
-### 12.4 Assignment
-Fincept may assign this Agreement to any successor or acquirer. You may not assign this Agreement without Fincept's prior written consent.
-
-### 12.5 Severability
-If any provision of this Agreement is found invalid or unenforceable, the remaining provisions will continue in full force and effect.
-
-### 12.6 No Waiver
-Failure by Fincept to enforce any right or provision of this Agreement will not constitute a waiver of such right or provision.
-
-### 12.7 Publicity
-Unless you opt out, Fincept may publicly identify You as a contributor to the Project, including in marketing materials, project documentation, and release notes.
-
-To opt out of public contributor recognition, email **[email protected]** with "CLA Opt-Out" in the subject line.
-
----
-
-## 13. How to Accept This Agreement
-
-By submitting a Contribution to the Project, you indicate your acceptance of this Agreement. You can formalize acceptance by:
-
-### Option 1: Sign the CLA (Recommended)
-1. Print this document
-2. Sign and date it
-3. Scan and email to **[email protected]** with subject "CLA Signature"
-
-### Option 2: Electronic Acceptance
-Reply to **[email protected]** with:
-```
-I, [Your Full Name], accept the Fincept Terminal Contributor License Agreement v1.0.
-
-GitHub Username: [username]
-Email: [your email]
-Date: [YYYY-MM-DD]
-```
-
-### Option 3: First Pull Request
-When submitting your first pull request, add this line to your commit message:
-```
-Signed-off-by: Your Name <[email protected]>
-
-I accept the Fincept Terminal CLA v1.0
-```
-
----
-
-## 14. Corporate CLA
-
-If you are contributing on behalf of your employer, your company must sign a **Corporate Contributor License Agreement**. Contact **[email protected]** to request the Corporate CLA form.
-
----
-
-## 15. Questions?
-
-If you have questions about this Agreement, please contact:
-
-**Email**: [email protected]
-**Subject**: CLA Question
-
-We typically respond within 3-5 business days.
-
----
-
-## Acceptance
-
-**By submitting a Contribution, you certify that you have read, understood, and agree to be bound by this Contributor License Agreement.**
-
----
-
-**Signature** (for formal acceptance):
-
-```
-_________________________________
-Signature
-
-_________________________________
-Printed Name
-
-_________________________________
-Date
-
-_________________________________
-GitHub Username (optional)
-```
-
----
-
-**Fincept Corporation**
-**Effective Date**: January 5, 2026
-**Version**: 1.0
-
-For the latest version of this Agreement, visit:
-**https://github.com/Fincept-Corporation/FinceptTerminal/blob/main/docs/CLA.md**
-
----
-
-**© 2025 Fincept Corporation. All rights reserved.**
diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md
index 3e942d1e6..c505ef8dc 100644
--- a/docs/CODE_OF_CONDUCT.md
+++ b/docs/CODE_OF_CONDUCT.md
@@ -1,347 +1,136 @@
-# 🤝 Code of Conduct
+# Code of Conduct
-<div align="center">
+## Our Pledge
-**Building a welcoming community for financial technology innovation**
+We pledge to make participation in the Fincept Terminal community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity.
-*Inspired by the best. Built for everyone.*
-
-</div>
-
----
-
-## 🌟 Our Pledge
-
-We as members, contributors, and leaders pledge to make participation in the **Fincept Terminal** community a **harassment-free experience for everyone**, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
-
-We pledge to act and interact in ways that contribute to an **open, welcoming, diverse, inclusive, and healthy community**.
+We pledge to act in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
---
-## ✨ Our Standards
-
-### 💚 Positive Behavior
-
-Examples of behavior that **contributes to a positive environment**:
-
-<table>
-<tr>
-<td width="50%">
-
-**🤗 Interpersonal**
-- 💙 Demonstrating empathy and kindness
-- 🤝 Being respectful of differing viewpoints
-- 🎯 Giving constructive feedback gracefully
-- 🙏 Accepting responsibility for mistakes
-- 🌍 Focusing on community over individual
+## Our Standards
-</td>
-<td width="50%">
+### Positive Behavior
-**🚀 Collaborative**
-- 📚 Using welcoming, inclusive language
-- ⏰ Being patient with new contributors
-- 🎉 Recognizing others' contributions
-- 🌐 Collaborating across time zones
-- 💡 Helping others learn and grow
+- Demonstrating empathy and kindness
+- Being respectful of differing viewpoints
+- Giving and accepting constructive feedback
+- Taking responsibility for mistakes
+- Focusing on community over individual interests
+- Helping others learn and grow
-</td>
-</tr>
-</table>
+### Unacceptable Behavior
-### 🚫 Unacceptable Behavior
-
-Examples of behavior that **will not be tolerated**:
-
-- ❌ Sexualized language, imagery, or unwelcome advances
-- ❌ Trolling, insults, derogatory comments, or personal attacks
-- ❌ Public or private harassment
-- ❌ Publishing others' private information without consent
-- ❌ Spam, excessive self-promotion, or off-topic discussions
-- ❌ Deliberately undermining contributions or spreading misinformation
-- ❌ Aggressive or intimidating behavior
-- ❌ Other conduct inappropriate in a professional setting
+- Sexualized language, imagery, or unwelcome advances
+- Trolling, insults, derogatory comments, or personal attacks
+- Public or private harassment
+- Publishing others' private information without consent
+- Spam or excessive self-promotion
+- Other conduct inappropriate in a professional setting
---
-## 💰 Financial Technology Ethics
-
-Given the nature of this **financial technology project**, we hold ourselves to higher standards:
+## Financial Technology Ethics
-### 🔒 Responsible Development
+Given the nature of this financial technology project:
-<table>
-<tr>
-<td width="50%">
-
-**🛡️ Security & Safety**
+**Security & Safety**
- Design with user financial safety in mind
- Never intentionally introduce vulnerabilities
- Maintain accurate financial calculations
- Respect financial privacy regulations
-</td>
-<td width="50%">
-
-**⚖️ Market Integrity**
+**Market Integrity**
- No market manipulation features
- Transparent conflict of interest disclosure
- Adherence to financial regulations
- Responsible market data handling
-</td>
-</tr>
-</table>
-
-### 🐍 Python Script Contributions
-
-Contributors using **embedded Python** must:
-- ✅ Test scripts thoroughly before submission
-- ✅ Document dependencies clearly
-- ✅ Follow financial data handling best practices
-- ✅ Ensure scripts don't compromise system security
-- ✅ Use proper error handling and logging
-- ✅ Respect API rate limits and usage policies
-
---
-## 🎯 Contribution-Specific Standards
-
-### 💻 For Code Contributors
-
-**Python, Rust, TypeScript, React - All Welcome!**
+## Contribution Standards
-<table>
-<tr>
-<td width="33%">
+### Code Contributors
-**🐍 Python Scripts**
- Clean, documented code
-- Proper type hints
+- Proper type hints and error handling
- Unit tests included
-- Resource-efficient
+- Follow existing patterns and conventions
-</td>
-<td width="33%">
-
-**⚛️ React/TypeScript**
-- Type-safe components
-- Responsive designs
-- Accessible UI
-- Performance-optimized
-
-</td>
-<td width="33%">
-
-**🦀 Rust Backend**
-- Safe, secure code
-- Well-tested
-- Documented APIs
-- Error handling
-
-</td>
-</tr>
-</table>
-
-### 📊 For Data Contributors
+### Data Contributors
- Verify data source accuracy
-- Respect data provider ToS
+- Respect data provider terms of service
- Document data formats
- Handle missing data gracefully
-### 📚 For Documentation Contributors
+### Documentation Contributors
- Clear, beginner-friendly language
-- Code examples included
-- Up-to-date information
-- Proper formatting
-
----
-
-## 🛡️ Enforcement Responsibilities
-
-Community leaders are responsible for **clarifying and enforcing** our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior deemed inappropriate, threatening, offensive, or harmful.
-
-Community leaders have the right to **remove, edit, or reject** comments, commits, code, wiki edits, issues, and other contributions not aligned with this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
+- Include code examples
+- Keep information up-to-date
---
-## 📍 Scope
+## Enforcement
-This Code of Conduct applies:
+Community leaders will take appropriate action for violations:
-- ✅ Within all community spaces (GitHub, forums, chat)
-- ✅ When representing the community officially
-- ✅ In public spaces using official channels
-- ✅ At events or meetups related to the project
+1. **Correction** - Private warning for minor issues
+2. **Warning** - Formal warning with consequences defined
+3. **Temporary Ban** - Temporary removal from community
+4. **Permanent Ban** - Permanent removal for severe violations
---
-## 📢 Reporting Guidelines
-
-### 🚨 How to Report
-
-**Witnessed or experienced unacceptable behavior?** Report it to:
-
-📧 **Email:** [email protected]
-
-### 📝 What to Include
+## Reporting
-When reporting, please provide:
+**Report unacceptable behavior to:** [email protected]
-1. 👤 Your contact information
-2. 📛 Names of individuals involved
-3. 📄 Detailed description of the incident
-4. 🗓️ Date, time, and location (if applicable)
-5. 📎 Supporting materials (screenshots, links)
-6. ℹ️ Whether reported elsewhere
+Include:
+- Your contact information
+- Names of individuals involved
+- Description of the incident
+- Date and time
+- Supporting materials (screenshots, links)
-### ⏱️ Response Timeline
-
-- **Acknowledgment:** Within 48 hours
-- **Investigation:** Regular updates provided
-- **Privacy:** Reporter confidentiality maintained
-- **Resolution:** Fair and transparent process
+**Response Timeline:**
+- Acknowledgment within 48 hours
+- Reporter confidentiality maintained
+- Fair and transparent resolution process
---
-## ⚖️ Enforcement
-
-Community leaders follow these **Community Impact Guidelines** for violations:
-
-### 1️⃣ Correction
-
-**📌 Impact:** Inappropriate language or unprofessional behavior
-
-**⚡ Consequence:** Private written warning, explanation of violation, possible public apology request
+## Appeals
-### 2️⃣ Warning
-
-**📌 Impact:** Violation through single incident or series of actions
-
-**⚡ Consequence:** Warning with defined consequences, no interaction with involved parties for specified time, possible temporary ban for violations
-
-### 3️⃣ Temporary Ban
-
-**📌 Impact:** Serious violation including sustained inappropriate behavior
-
-**⚡ Consequence:** Temporary ban from all community interaction for specified period, no contact with involved parties or enforcers, permanent ban for violations
-
-### 4️⃣ Permanent Ban
-
-**📌 Impact:** Pattern of violations, harassment, aggression toward individuals or groups
-
-**⚡ Consequence:** Permanent ban from all public community interaction
-
----
-
-## 🔄 Appeals Process
-
-**Believe you were unfairly sanctioned?** You may appeal by:
-
-1. 📧 Email [email protected] within **14 days**
-2. 📝 Include full name, incident details, and appeal reason
-3. 📎 Provide additional context or evidence
-
-Appeals reviewed by **different community leaders** not involved in original decision.
+Appeal within 14 days by emailing [email protected] with:
+- Full details of the incident
+- Reason for appeal
+- Additional context or evidence
---
-## 💻 Technical Contribution Standards
-
-### 🎨 Code Quality
-
-<table>
-<tr>
-<td width="50%">
-
-**✅ Do's**
-- Follow established architecture patterns
-- Include tests for contributions
-- Document code clearly
-- Respect coding standards
-- Use automated setup scripts
-
-</td>
-<td width="50%">
-
-**❌ Don'ts**
-- Submit untested code
-- Ignore existing conventions
-- Skip documentation
-- Break existing functionality
-- Introduce unnecessary dependencies
-
-</td>
-</tr>
-</table>
+## Scope
-### 🤝 Collaboration
-
-- 💬 Be constructive in code reviews
-- 🎯 Provide helpful feedback
-- 🔄 Be open to feedback on your work
-- 📖 Help new contributors understand codebase
-- 🎓 Share knowledge and best practices
-
-### 🐛 Issue Resolution
-
-- 🔍 Search existing issues before creating new ones
-- 📋 Provide clear, detailed bug reports
-- 🧪 Include reproduction steps
-- ⏳ Be patient during issue resolution
-- 🙋 Offer help when possible
-
----
-
-## 🏆 Recognition
-
-**We celebrate our contributors!** Consistently positive contributors receive:
-
-- 🌟 Contributor highlights in project updates
-- 📰 Special recognition in release notes
-- 👥 Invitation to join core contributor team
-- 🎤 Speaking opportunities at community events
-- 🎁 Exclusive contributor swag and badges
-
----
-
-## 📈 Continuous Improvement
-
-This Code of Conduct is a **living document**. We welcome:
-
-- 💡 Feedback and suggestions
-- 🗣️ Open discussion of proposed changes
-- 🤝 Community input on decisions
-- 🔄 Regular reviews and updates
+This Code of Conduct applies:
+- Within all community spaces (GitHub, forums, chat)
+- When representing the community officially
+- At events related to the project
---
-## 📚 Attribution
+## Attribution
-This Code of Conduct is adapted from:
-- [Contributor Covenant](https://www.contributor-covenant.org), version 2.1
-- [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity)
+Adapted from [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
---
-## 📞 Contact Information
-
-**Need Help?**
+## Contact
-- 📧 Primary: [email protected]
-- 💬 Discussions: [GitHub Discussions](https://github.com/Fincept-Corporation/FinceptTerminal/discussions)
-- 📝 Issues: [GitHub Issues](https://github.com/Fincept-Corporation/FinceptTerminal/issues)
+- **Email:** [email protected]
+- **GitHub Issues:** https://github.com/Fincept-Corporation/FinceptTerminal/issues
+- **GitHub Discussions:** https://github.com/Fincept-Corporation/FinceptTerminal/discussions
---
-<div align="center">
-
-**🎉 Thank you for helping make Fincept Terminal a welcoming, professional community!**
-
-*By participating in this project, you agree to abide by this Code of Conduct.*
-
-**Built by the community, for the community** 💙
-
-</div>
+By participating in this project, you agree to abide by this Code of Conduct.
diff --git a/docs/COMMERCIAL_LICENSE.md b/docs/COMMERCIAL_LICENSE.md
index 61dd5ed12..69fe3e1cc 100644
--- a/docs/COMMERCIAL_LICENSE.md
+++ b/docs/COMMERCIAL_LICENSE.md
@@ -2,239 +2,145 @@
## Overview
-Fincept Terminal is dual-licensed under AGPL-3.0 (open source) and a proprietary commercial license. This document explains when you need a commercial license and how to obtain one.
+Fincept Terminal is dual-licensed:
+- **AGPL-3.0** - Free for personal and educational use
+- **Commercial License** - Required for business/commercial use
-## Do I Need a Commercial License?
-
-### ✅ You DON'T Need a Commercial License If:
-
-- **Personal Use**: Using Fincept Terminal for your own trading/analysis
-- **Open Source Contributions**: Contributing improvements back to the project
-- **Internal Business Use**: Using it internally without distribution or network service
-- **AGPL Compliance**: Distributing modifications under AGPL-3.0 with source code
-- **Network Service with Source**: Running as SaaS while providing source to all users
-
-### ⚠️ You NEED a Commercial License If:
-
-- **Proprietary Integration**: Embedding Fincept Terminal in commercial software without open-sourcing
-- **SaaS/Cloud Platform**: Offering as a managed service without providing source code
-- **White-Label Solutions**: Rebranding for enterprise clients
-- **Closed-Source Modifications**: Making proprietary modifications you don't want to release
-- **OEM Distribution**: Bundling with hardware or other commercial products
-- **Competitive Products**: Using Fincept code in competing financial terminals
-
-## Commercial License Benefits
-
-### What You Get:
-
-1. **Proprietary Use Rights**
- - No obligation to open-source your modifications
- - Freedom to integrate into closed-source products
- - Private customization and white-labeling
-
-2. **Trademark License**
- - Right to use Fincept branding (subject to guidelines)
- - Co-marketing opportunities
- - Official partner status
-
-3. **Priority Support**
- - Dedicated support channel
- - SLA-backed response times
- - Direct access to engineering team
-
-4. **Custom Development**
- - Feature requests prioritization
- - Custom integrations and adapters
- - Tailored analytics modules
-
-5. **Legal Protection**
- - Indemnification coverage
- - IP warranty
- - Compliance assistance
-
-## Pricing Tiers
-
-### Startup License
-**$2,999/year**
+**Commercial licensing is required to access Fincept Data Sources and APIs for business use.**
-- Up to 10 developers
-- Basic priority support (48h response)
-- Proprietary deployment rights
-- Standard trademark usage
-- Quarterly updates
-
-**Best for:** Early-stage companies, MVPs, pilot projects
-
-### Business License
-**$9,999/year**
+---
-- Up to 50 developers
-- Priority support (24h response)
-- All Startup features
-- Custom integrations (2 per year)
-- Monthly updates
-- Partner badge
+## Do I Need a Commercial License?
-**Best for:** Growing companies, established platforms
+### Free (No License Needed)
-### Enterprise License
-**Custom Pricing**
+| Use Case | Cost |
+|----------|------|
+| Personal use & learning | Free |
+| Individual students | Free |
+| Open source contributions | Free |
+| Using your own data sources | Free |
-- Unlimited developers
-- Premium support (4h response)
-- All Business features
-- Unlimited custom integrations
-- Dedicated account manager
-- On-premise deployment assistance
-- Custom SLA terms
-- Source code escrow option
+### Commercial License Required
-**Best for:** Large organizations, financial institutions, white-label providers
+| Use Case | License |
+|----------|---------|
+| Any business use | Commercial |
+| Startups (even $0 revenue) | Commercial |
+| Internal company use | Commercial |
+| Using Fincept Data/APIs commercially | Commercial |
+| SaaS / Cloud platforms | Commercial |
+| White-label / Reselling | Commercial |
-### OEM License
-**Custom Pricing**
+---
-- Hardware bundling rights
-- Embedded device distribution
-- Custom branding package
-- Volume discounts available
-- Technical integration support
+## Pricing
-**Best for:** Hardware manufacturers, device vendors
+### Commercial License
-## Licensing Process
+**$10,200 / year**
-### Step 1: Initial Inquiry
-Contact us at **[email protected]** with:
-- Company name and website
-- Intended use case
-- Estimated number of developers/users
-- Deployment model (SaaS, on-premise, embedded, etc.)
-- Timeline and requirements
+| Included | Details |
+|----------|---------|
+| Fincept Data & API Access | Full access |
+| Monthly Credits | 80,000 credits/month |
+| Credit Reset | Monthly |
+| Additional Credits | Available for purchase |
+| License Type | Annual |
-### Step 2: Consultation
-We'll schedule a call to:
-- Understand your specific needs
-- Recommend appropriate license tier
-- Discuss customization requirements
-- Provide detailed pricing quote
+### Technical Support (Optional)
-### Step 3: Agreement
-- Review and sign Commercial License Agreement
-- Set up payment terms (annual or multi-year)
-- Receive license certificate and credentials
+**$149 / month**
-### Step 4: Onboarding
-- Technical kickoff call
-- Access to private support channels
-- Documentation and integration guides
-- Feature roadmap alignment
+- Priority support
+- Direct technical assistance
+- Faster response times
-## Frequently Asked Questions
+### Custom Enterprise
-### Can I trial the commercial license?
-Yes, we offer 30-day evaluation licenses for qualified businesses. Contact us to apply.
+**Contact for pricing**
-### What if I'm already using AGPL version?
-You can migrate to commercial license at any time. Previous usage under AGPL remains compliant.
+- Tailored to your requirements
+- Custom integrations
+- Higher credit limits
+- Dedicated support
+- Custom SLAs
-### Can I downgrade back to AGPL?
-Yes, but only for new code going forward. Code developed under commercial license cannot retroactively become AGPL.
+---
-### Do you offer academic/nonprofit discounts?
-Yes, we provide discounted commercial licenses for educational institutions and registered nonprofits. Contact us for details.
+## University & Academic
-### What happens if my license expires?
-You can continue using the version licensed during your term, but won't receive updates or support. Renewals available at current pricing.
+**$799 / month**
-### Can I redistribute the commercial version?
-Redistribution rights depend on your license tier. Generally, distribution is allowed only within your organization unless you have an OEM/reseller agreement.
+| Included | Details |
+|----------|---------|
+| Accounts | 20 accounts |
+| Use | Teaching & research |
+| Fincept Data Access | Included |
-### Is training included?
-Enterprise tier includes onboarding training. Additional training sessions available for all tiers at extra cost.
+*For accredited educational institutions only.*
-### Can I customize the UI/features?
-All commercial licenses allow customization. Enterprise tier includes development assistance.
+---
-## Volume Licensing
+## Credits
-For organizations needing multiple deployments or sites:
+Credits are used for Fincept Data Sources and API calls.
-- **10+ seats**: 15% discount
-- **50+ seats**: 25% discount
-- **100+ seats**: 35% discount
-- **500+ seats**: Custom pricing
+| Plan | Monthly Credits |
+|------|-----------------|
+| Commercial | 80,000 |
+| University | Included in plan |
+| Custom | Based on agreement |
-## Support Channels
+**When credits run out:**
+- Purchase additional credits, OR
+- Wait for monthly reset
-### Commercial License Holders Get:
+---
-- **Private Slack/Discord Channel**: Direct communication with team
-- **Email Support**: [email protected]
-- **Emergency Hotline**: +1 (555) 123-4567 (Enterprise only)
-- **Quarterly Business Reviews**: Enterprise tier
-- **GitHub Private Repository**: Access to commercial-only features
+## How to Get Started
-## Terms & Conditions
+### Step 1: Contact Us
+Email **[email protected]** with:
+- Company/Institution name
+- Intended use case
+- Number of users
-### License Grant
-Commercial license grants you the right to use, modify, and distribute Fincept Terminal in proprietary applications without AGPL obligations.
+### Step 2: Agreement
+- Review and sign license agreement
+- Complete payment
-### Term Length
-- Standard: 12 months (annual renewal)
-- Multi-year: 2-3 year terms (10-20% discount)
-- Perpetual: Available for Enterprise tier
+### Step 3: Access
+- Receive license credentials
+- Access Fincept Data & APIs
-### Payment Terms
-- Annual: Paid upfront
-- Quarterly: Available for Enterprise (subject to approval)
-- Multi-year: Upfront or structured payments
+---
-### Refund Policy
-- 30-day money-back guarantee
-- Pro-rated refunds for annual plans (first 90 days)
-- No refunds after 90 days
+## Contact
-### Termination
-- Either party can terminate with 30 days notice
-- Upon termination, revert to AGPL or cease usage
-- No refunds for early termination
+| | |
+|--|--|
+| **Email** | [email protected] |
+| **Phone** | +91-9773034108 |
+| **Website** | https://fincept.in |
-## Contact Information
+---
-**Sales Inquiries**: [email protected]
-**Technical Questions**: [email protected]
-**Legal/Compliance**: [email protected]
+## Terms
-**Phone**: +1 (555) FINCEPT
-**Website**: https://fincept.in/commercial
-**Schedule Demo**: https://fincept.in/demo
+- Licenses are non-transferable
+- Annual licenses renew yearly
+- Refunds within 30 days if any of the credits are unused
+- Fincept Corporation reserves right to modify pricing
---
-## Special Programs
-
-### Startup Accelerator Program
-If you're part of a recognized accelerator (Y Combinator, Techstars, etc.):
-- 50% discount on Startup License (first year)
-- Extended 90-day trial
-- Dedicated startup mentor
-
-### Open Source Contributor Program
-Active contributors to Fincept Terminal (10+ merged PRs):
-- Free Startup License (1 year)
-- Recognition in documentation
-- Early access to new features
+## Trademark
-### Academic Research Program
-Researchers at accredited institutions:
-- Free commercial license for research projects
-- Co-publication opportunities
-- Access to enterprise features for research purposes
+"Fincept", "Fincept Terminal", and the Fincept logo are trademarks of Fincept Corporation. Use requires written permission.
---
-**Last Updated**: January 5, 2026
-**Version**: 1.0
+**Last Updated:** February 2026
-For the latest information, visit: https://fincept.in/licensing
+For full license terms, see [LICENSE](../LICENSE).
diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md
index 7f71c8240..3cdad66e0 100644
--- a/docs/CONTRIBUTING.md
+++ b/docs/CONTRIBUTING.md
@@ -1,728 +1,255 @@
-# 🚀 Contributing to Fincept Terminal
+# Contributing to Fincept Terminal
-<div align="center">
-
-**Help us build the future of open-source financial technology**
-
-[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
-[![First Timers Friendly](https://img.shields.io/badge/first--timers--friendly-blue.svg)](https://www.firsttimersonly.com/)
-
-*Every contribution counts, no matter how small!*
-
-</div>
+Welcome! Fincept Terminal is an open-source financial intelligence platform with 80+ terminal tabs, 99 Rust commands, 119 Python scripts, and 42 UI components.
---
-## 📋 Table of Contents
+## Table of Contents
-- [🎯 Ways to Contribute](#-ways-to-contribute)
-- [🏗️ Tech Stack](#️-tech-stack)
-- [⚡ Quick Start](#-quick-start)
-- [💻 Contribution Areas](#-contribution-areas)
-- [🐍 Python Script Contributions](#-python-script-contributions)
-- [📁 Project Structure](#-project-structure)
-- [🔄 Development Workflow](#-development-workflow)
-- [✅ Pull Request Process](#-pull-request-process)
-- [🧪 Testing Guidelines](#-testing-guidelines)
-- [📝 Code Style](#-code-style)
+- [Ways to Contribute](#ways-to-contribute)
+- [Tech Stack](#tech-stack)
+- [Getting Started](#getting-started)
+- [Project Architecture](#project-architecture)
+- [Development Workflow](#development-workflow)
+- [Pull Request Process](#pull-request-process)
+- [Language-Specific Guides](#language-specific-guides)
+- [Getting Help](#getting-help)
---
-## 🎯 Ways to Contribute
-
-<table>
-<tr>
-<td width="33%">
-
-### 💻 **Code**
-- Fix bugs
-- Add features
-- Write Python scripts
-- Improve performance
-- Refactor code
-
-</td>
-<td width="33%">
-
-### 📚 **Documentation**
-- Improve README
-- Write tutorials
-- API documentation
-- Code examples
-- Translations
-
-</td>
-<td width="33%">
-
-### 🐛 **Testing & QA**
-- Report bugs
-- Test features
-- Write tests
-- Review PRs
-- Improve CI/CD
-
-</td>
-</tr>
-<tr>
-<td width="33%">
-
-### 🎨 **Design**
-- UI/UX improvements
-- Component design
-- Icon creation
-- Screenshots
-- Demo videos
-
-</td>
-<td width="33%">
-
-### 🌐 **Community**
-- Answer questions
-- Write blog posts
-- Share on social media
-- Organize events
-- Mentor newcomers
-
-</td>
-<td width="33%">
-
-### 💡 **Ideas**
-- Suggest features
-- Share use cases
-- Provide feedback
-- Report issues
-- Discuss improvements
-
-</td>
-</tr>
-</table>
+## Ways to Contribute
----
+| Area | Examples |
+|------|----------|
+| **Code** | Bug fixes, new features, new tabs, new analytics |
+| **Documentation** | Improve guides, add examples, translations |
+| **Testing** | Report bugs, write tests, review PRs |
+| **Design** | UI/UX improvements, icons, themes |
+| **Data** | New data sources, API integrations |
-## 🏗️ Tech Stack
+---
-<div align="center">
+## Tech Stack
| Layer | Technologies |
|-------|-------------|
-| **Frontend** | ![React](https://img.shields.io/badge/React-19-61DAFB?logo=react) ![TypeScript](https://img.shields.io/badge/TypeScript-5.6-3178C6?logo=typescript) ![TailwindCSS](https://img.shields.io/badge/TailwindCSS-4.0-38B2AC?logo=tailwind-css) |
-| **Desktop** | ![Tauri](https://img.shields.io/badge/Tauri-2.0-FFC131?logo=tauri) ![Rust](https://img.shields.io/badge/Rust-1.70+-CE422B?logo=rust) |
-| **Data Processing** | ![Python](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python) ![Node.js](https://img.shields.io/badge/Node.js-22-339933?logo=node.js) |
-| **UI Components** | ![Radix UI](https://img.shields.io/badge/Radix_UI-Latest-161618) ![shadcn/ui](https://img.shields.io/badge/shadcn/ui-Latest-000000) |
-
-</div>
+| **Frontend** | React 19, TypeScript 5.8, TailwindCSS v4, Radix UI |
+| **Desktop** | Tauri 2.x, Rust |
+| **Analytics** | Python 3.11+ (embedded runtime) |
+| **Package Manager** | Bun |
+| **Charts** | Lightweight Charts, Recharts, Plotly, D3.js |
+| **AI/LLM** | Langchain, Ollama, OpenAI, Anthropic, Google GenAI |
+| **Database** | SQLite (via Tauri plugin) |
+| **State** | React Context, Redux |
+
+**Language-Specific Guides:**
+- [TypeScript/React Guide](./TYPESCRIPT_CONTRIBUTOR_GUIDE.md) - 80 tabs, 42 UI components, 12 contexts
+- [Rust Guide](./RUST_CONTRIBUTOR_GUIDE.md) - 99 commands, WebSocket, database
+- [Python Guide](./PYTHON_CONTRIBUTOR_GUIDE.md) - 119 scripts, 34 Analytics modules
---
-## ⚡ Quick Start
+## Getting Started
-### 🚀 **Automated Setup (Recommended)**
+### Prerequisites
-**Windows:**
-```bash
-# Clone and setup
-git clone https://github.com/YOUR_USERNAME/FinceptTerminal.git
-cd FinceptTerminal
+- **Bun** 1.0+ - [bun.sh](https://bun.sh)
+- **Rust** 1.70+ - [rust-lang.org](https://www.rust-lang.org/tools/install)
+- **Python** 3.11+ (for analytics development)
+- **Git** - [git-scm.com](https://git-scm.com)
-# Run automated setup (as Administrator)
-setup.bat
-```
+### Setup
-**Linux/macOS:**
-```bash
-# Clone and setup
-git clone https://github.com/YOUR_USERNAME/FinceptTerminal.git
-cd FinceptTerminal
-
-# Run automated setup
-chmod +x setup.sh
-./setup.sh
-```
-
-The automated script installs:
-- ✅ Node.js LTS (v22.14.0)
-- ✅ Rust (latest stable)
-- ✅ All npm dependencies
-- ✅ Everything you need to start!
-
-### ⚙️ **Manual Setup**
-
-<details>
-<summary><b>Click to expand manual setup instructions</b></summary>
-
-**Prerequisites:**
-- Node.js 18+
-- Rust 1.70+
-- Python 3.11+ (for Python scripts)
-- Git
-
-**Installation:**
```bash
# Clone repository
-git clone https://github.com/YOUR_USERNAME/FinceptTerminal.git
+git clone https://github.com/Fincept-Corporation/FinceptTerminal.git
cd FinceptTerminal/fincept-terminal-desktop
# Install dependencies
-npm install
+bun install
# Run development server
-npm run tauri dev
-
-# Build for production
-npm run tauri build
-```
-
-</details>
-
----
-
-## 💻 Contribution Areas
-
-### 1️⃣ **Frontend Development** ⚛️
-
-**Focus:** React + TypeScript + TailwindCSS
-
-```typescript
-// Example: Creating a new component
-import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"
-import { Button } from "@/components/ui/button"
-
-interface StockCardProps {
- symbol: string
- price: number
- change: number
-}
-
-export function StockCard({ symbol, price, change }: StockCardProps) {
- const isPositive = change >= 0
-
- return (
- <Card className="hover:shadow-lg transition-shadow">
- <CardHeader>
- <CardTitle className="flex justify-between">
- <span>{symbol}</span>
- <span className={isPositive ? "text-green-500" : "text-red-500"}>
- ${price.toFixed(2)}
- </span>
- </CardTitle>
- </CardHeader>
- <CardContent>
- <p className={isPositive ? "text-green-500" : "text-red-500"}>
- {isPositive ? "▲" : "▼"} {Math.abs(change).toFixed(2)}%
- </p>
- </CardContent>
- </Card>
- )
-}
-```
-
-**Guidelines:**
-- ✅ Use TypeScript for type safety
-- ✅ Leverage shadcn/ui components
-- ✅ Follow React best practices (hooks, functional components)
-- ✅ Ensure responsive design (mobile, tablet, desktop)
-- ✅ Add proper error boundaries and loading states
-
-### 2️⃣ **Backend Development** 🦀
-
-**Focus:** Rust + Tauri Commands
-
-```rust
-// Example: Adding a new Tauri command
-use tauri::command;
-
-#[command]
-async fn calculate_portfolio_value(
- holdings: Vec<Holding>,
- prices: Vec<f64>
-) -> Result<f64, String> {
- if holdings.len() != prices.len() {
- return Err("Mismatched data".to_string());
- }
-
- let total = holdings
- .iter()
- .zip(prices.iter())
- .map(|(h, p)| h.quantity * p)
- .sum();
-
- Ok(total)
-}
-
-// Register in main.rs
-fn main() {
- tauri::Builder::default()
- .invoke_handler(tauri::generate_handler![calculate_portfolio_value])
- .run(tauri::generate_context!())
- .expect("error while running tauri application");
-}
-```
-
-**Guidelines:**
-- ✅ Use `#[tauri::command]` for frontend-callable functions
-- ✅ Implement proper error handling
-- ✅ Use async when necessary
-- ✅ Keep commands focused and testable
-- ✅ Document all public APIs
-
----
-
-## 🐍 Python Script Contributions
-
-**We have embedded Python for financial analysis!** You can contribute Python scripts for:
-
-### 📊 **Financial Data Processing**
-
-**Location:** `fincept-terminal-desktop/src-tauri/resources/scripts/`
-
-**Example: Adding a new indicator**
-```python
-#!/usr/bin/env python3
-"""
-Technical Indicator Calculator
-Usage: python indicators.py <symbol> <indicator> <period>
-"""
-
-import sys
-import json
-import yfinance as yf
-import pandas as pd
-from typing import Dict, Any
-
-def calculate_rsi(prices: pd.Series, period: int = 14) -> pd.Series:
- """Calculate Relative Strength Index"""
- delta = prices.diff()
- gain = (delta.where(delta > 0, 0)).rolling(window=period).mean()
- loss = (-delta.where(delta < 0, 0)).rolling(window=period).mean()
-
- rs = gain / loss
- rsi = 100 - (100 / (1 + rs))
- return rsi
-
-def main():
- if len(sys.argv) < 3:
- print(json.dumps({
- "success": False,
- "error": "Usage: indicators.py <symbol> <indicator>"
- }))
- sys.exit(1)
-
- symbol = sys.argv[1]
- indicator = sys.argv[2]
-
- try:
- # Fetch data
- ticker = yf.Ticker(symbol)
- hist = ticker.history(period="1y")
-
- # Calculate indicator
- result = None
- if indicator == "rsi":
- result = calculate_rsi(hist['Close']).iloc[-1]
-
- # Return JSON response
- print(json.dumps({
- "success": True,
- "data": {
- "symbol": symbol,
- "indicator": indicator,
- "value": float(result) if result is not None else None
- }
- }))
-
- except Exception as e:
- print(json.dumps({
- "success": False,
- "error": str(e)
- }))
- sys.exit(1)
-
-if __name__ == "__main__":
- main()
+bun run tauri:dev
```
-### 🐍 **Python Script Guidelines**
-
-<table>
-<tr>
-<td width="50%">
-
-**✅ Best Practices**
-- Use type hints (PEP 484)
-- Include docstrings
-- Handle errors gracefully
-- Return JSON output
-- Use argparse for CLI args
-- Add logging for debugging
-- Test with sample data
-- Document dependencies
-
-</td>
-<td width="50%">
-
-**📦 Dependencies**
-- Use `requirements.txt`
-- Pin versions (e.g., `yfinance==0.2.28`)
-- Keep dependencies minimal
-- Test compatibility
-- Document installation
-- Use virtual environments
-- Handle missing imports
-
-</td>
-</tr>
-</table>
-
-### 🔌 **Calling Python from Rust**
-
-```rust
-// Example: Invoking Python script from Tauri
-use std::process::Command;
-
-#[tauri::command]
-async fn calculate_indicator(
- symbol: String,
- indicator: String
-) -> Result<serde_json::Value, String> {
- let output = Command::new("./resources/python/python.exe")
- .arg("./resources/scripts/indicators.py")
- .arg(&symbol)
- .arg(&indicator)
- .output()
- .map_err(|e| e.to_string())?;
-
- let stdout = String::from_utf8_lossy(&output.stdout);
- let result: serde_json::Value = serde_json::from_str(&stdout)
- .map_err(|e| format!("JSON parse error: {}", e))?;
-
- Ok(result)
-}
-```
+### Verify Installation
-### 📁 **Python Script Structure**
-
-```
-src-tauri/resources/
-├── python/ # Embedded Python runtime
-│ ├── python.exe
-│ └── Lib/
-└── scripts/ # Your Python scripts go here!
- ├── yfinance_data.py
- ├── indicators.py # ← Add new scripts here
- ├── ml_predictions.py
- └── sentiment_analysis.py
+```bash
+bun --version # 1.0+
+rustc --version # 1.70+
+python --version # 3.11+
```
---
-## 📁 Project Structure
-
-```
-fincept-terminal-desktop/
-├── src/ # React frontend
-│ ├── components/
-│ │ ├── auth/ # Authentication screens
-│ │ ├── dashboard/ # Main terminal dashboard
-│ │ ├── tabs/ # Terminal tabs (Markets, News, etc.)
-│ │ └── ui/ # Reusable UI components (shadcn/ui)
-│ ├── contexts/ # React contexts (Auth, Theme)
-│ ├── services/ # API service layers
-│ ├── hooks/ # Custom React hooks
-│ └── types/ # TypeScript type definitions
+## Project Architecture
+
+### Frontend (`src/`)
+
+```
+src/
+├── components/
+│ ├── tabs/ # 80 terminal tabs
+│ │ ├── dashboard/ # Main dashboard
+│ │ ├── markets/ # Market data
+│ │ ├── portfolio-tab/ # Portfolio management
+│ │ ├── algo-trading/ # Algorithmic trading
+│ │ ├── ai-quant-lab/ # AI/ML analytics
+│ │ ├── quantlib-*/ # 15+ QuantLib modules
+│ │ ├── geopolitics/ # Geopolitical analysis
+│ │ ├── crypto-trading/# Cryptocurrency
+│ │ └── ... # 60+ more tabs
+│ │
+│ ├── ui/ # 42 UI components (shadcn/ui)
+│ ├── auth/ # Authentication
+│ ├── dashboard/ # Terminal shell
+│ ├── charts/ # Chart components
+│ ├── chat-mode/ # AI chat interface
+│ ├── command-bar/ # Command palette
+│ └── visualization/ # 3D visualizations
+│
+├── services/ # 35+ API services
+│ ├── analytics/ # Analytics APIs
+│ ├── trading/ # Trading APIs
+│ ├── markets/ # Market data
+│ ├── portfolio/ # Portfolio APIs
+│ ├── mcp/ # MCP integration
+│ └── ...
+│
+├── contexts/ # 12 React contexts
+│ ├── AuthContext.tsx
+│ ├── BrokerContext.tsx
+│ ├── DataSourceContext.tsx
+│ ├── NavigationContext.tsx
+│ ├── ThemeContext.tsx
+│ ├── WorkspaceContext.tsx
+│ └── ...
│
-├── src-tauri/ # Rust backend (Tauri)
-│ ├── src/
-│ │ ├── main.rs # Main Tauri entry point
-│ │ ├── commands/ # Tauri commands
-│ │ └── data_sources/ # Data source integrations
-│ ├── resources/
-│ │ ├── python/ # Embedded Python runtime
-│ │ └── scripts/ # Python scripts ← Add yours here!
-│ ├── Cargo.toml # Rust dependencies
-│ └── tauri.conf.json # Tauri configuration
+├── brokers/ # Broker integrations
+│ ├── crypto/ # Crypto exchanges
+│ ├── india/ # Indian brokers
+│ └── stocks/ # Stock brokers
│
-├── public/ # Static assets
-├── setup.bat # Windows automated setup
-├── setup.sh # Linux/macOS automated setup
-└── package.json # npm dependencies
+├── hooks/ # 8 custom hooks
+├── store/ # Redux store
+├── i18n/ # Internationalization
+└── paper-trading/ # Paper trading system
+```
+
+### Backend (`src-tauri/`)
+
+```
+src-tauri/
+├── src/
+│ ├── lib.rs # Main library (130K+ lines)
+│ ├── python.rs # Python runtime
+│ ├── setup.rs # App initialization
+│ ├── paper_trading.rs # Paper trading
+│ │
+│ ├── commands/ # 99 Tauri commands
+│ │ ├── analytics.rs # Financial analytics
+│ │ ├── agents.rs # AI agents
+│ │ ├── algo_trading.rs# Algo trading
+│ │ ├── databento.rs # Market data
+│ │ ├── portfolio.rs # Portfolio
+│ │ ├── brokers/ # Broker commands
+│ │ └── ... # 90+ more
+│ │
+│ ├── database/ # SQLite operations
+│ ├── services/ # Backend services
+│ └── websocket/ # WebSocket handlers
+│
+└── resources/scripts/ # 119 Python scripts
+ ├── Analytics/ # 34 analytics modules
+ ├── agents/ # AI agents
+ ├── strategies/ # Trading strategies
+ ├── technicals/ # Technical analysis
+ └── *.py # 80+ data fetchers
```
---
-## 🔄 Development Workflow
-
-### 🌿 **Branch Strategy**
+## Development Workflow
-```bash
-# Create feature branch
-git checkout -b feature/amazing-feature
+### Branch Naming
-# Create bugfix branch
-git checkout -b fix/bug-description
-
-# Create Python script branch
-git checkout -b python/new-indicator
```
-
-### 💡 **Adding a New Feature**
-
-**1. Frontend Feature (React Component)**
-```bash
-# Create component
-touch src/components/new-feature/NewFeature.tsx
-
-# Add to relevant page
-# Edit src/components/dashboard/DashboardScreen.tsx
+feature/add-options-tab
+fix/chart-rendering-bug
+docs/update-python-guide
```
-**2. Backend Feature (Rust Command)**
-```bash
-# Create command file
-touch src-tauri/src/commands/new_command.rs
+### Making Changes
-# Register in main.rs
-```
+1. Create branch from `main`
+2. Follow the appropriate language guide
+3. Test locally: `bun run build && bun run tauri:dev`
+4. Commit with clear messages
-**3. Python Script Feature**
-```bash
-# Create Python script
-touch src-tauri/resources/scripts/my_analysis.py
+### Commit Format
-# Add to requirements (if needed)
-echo "new-library==1.0.0" >> requirements.txt
```
+type: short description
-### 🔌 **Connecting Frontend to Backend**
-
-```typescript
-// React component calling Rust command
-import { invoke } from '@tauri-apps/api/core'
-
-async function fetchAnalysis(symbol: string) {
- try {
- const result = await invoke('calculate_indicator', {
- symbol,
- indicator: 'rsi'
- })
- console.log('Analysis result:', result)
- } catch (error) {
- console.error('Error:', error)
- }
-}
+Types: feat, fix, docs, refactor, test, chore
```
---
-## ✅ Pull Request Process
-
-### 📝 **Before Submitting**
-
-- [ ] Code follows project style guidelines
-- [ ] All tests pass locally
-- [ ] Added tests for new features
-- [ ] Updated documentation
-- [ ] Commits are clean and descriptive
-- [ ] No console errors or warnings
-- [ ] Python scripts tested independently
+## Pull Request Process
-### 🎯 **PR Title Format**
+### Before Submitting
-```
-feat: Add RSI indicator calculation
-fix: Resolve chart rendering issue
-docs: Update Python script guidelines
-chore: Update dependencies
-python: Add sentiment analysis script
-```
+- [ ] Code builds without errors
+- [ ] No console warnings
+- [ ] Tested in development mode
+- [ ] Follows existing patterns
+- [ ] Documentation updated
-### 📋 **PR Description Template**
+### PR Template
```markdown
## Description
-Brief description of changes
+Brief description
-## Type of Change
+## Type
- [ ] Bug fix
- [ ] New feature
-- [ ] Python script
- [ ] Documentation
-- [ ] Performance improvement
## Testing
How was this tested?
-## Screenshots (if applicable)
-Add screenshots here
-
-## Checklist
-- [ ] Code follows style guidelines
-- [ ] Self-review completed
-- [ ] Documentation updated
-- [ ] Tests added/updated
+## Screenshots (if UI)
```
---
-## 🧪 Testing Guidelines
-
-### ⚛️ **Frontend Tests**
-
-```bash
-npm test # Run all tests
-npm run test:watch # Watch mode
-npm run test:coverage # Coverage report
-```
-
-### 🦀 **Rust Tests**
+## Language-Specific Guides
-```bash
-cd src-tauri
-cargo test # Run all tests
-cargo test --release # Release mode
-```
-
-### 🐍 **Python Script Tests**
-
-```bash
-# Test Python script directly
-python src-tauri/resources/scripts/indicators.py AAPL rsi
-
-# Expected output:
-# {"success": true, "data": {"symbol": "AAPL", "indicator": "rsi", "value": 45.23}}
-```
+| Guide | Coverage |
+|-------|----------|
+| [TypeScript Guide](./TYPESCRIPT_CONTRIBUTOR_GUIDE.md) | 80 tabs, 42 UI components, services, contexts, hooks |
+| [Rust Guide](./RUST_CONTRIBUTOR_GUIDE.md) | 99 commands, WebSocket, database, Python execution |
+| [Python Guide](./PYTHON_CONTRIBUTOR_GUIDE.md) | 119 scripts, 34 Analytics modules, data fetchers |
---
-## 📝 Code Style
-
-### 📐 **TypeScript/React**
-
-```typescript
-// ✅ Good
-interface Props {
- symbol: string
- price: number
-}
-
-export function Component({ symbol, price }: Props) {
- const [data, setData] = useState<Data | null>(null)
-
- useEffect(() => {
- // Effect logic
- }, [symbol])
-
- return <div>{symbol}: ${price}</div>
-}
-
-// ❌ Bad
-export function Component(props: any) {
- const [data, setData] = useState(null)
- return <div>{props.symbol}</div>
-}
-```
-
-### 🦀 **Rust**
-
-```rust
-// ✅ Good
-#[tauri::command]
-async fn fetch_data(symbol: String) -> Result<Data, String> {
- match get_data(&symbol).await {
- Ok(data) => Ok(data),
- Err(e) => Err(e.to_string()),
- }
-}
-
-// ❌ Bad
-#[tauri::command]
-fn fetch_data(symbol: String) -> Data {
- get_data(&symbol).unwrap()
-}
-```
-
-### 🐍 **Python**
-
-```python
-# ✅ Good
-def calculate_metric(data: pd.Series, period: int = 14) -> float:
- """
- Calculate metric from price data.
-
- Args:
- data: Price series
- period: Calculation period
-
- Returns:
- Calculated metric value
- """
- result = data.rolling(window=period).mean().iloc[-1]
- return float(result)
-
-# ❌ Bad
-def calc(d, p=14):
- return d.rolling(p).mean().iloc[-1]
-```
-
----
-
-## 🎁 First-Time Contributors
-
-**New to open source?** We got you! Here are some easy ways to start:
-
-### 🌱 **Good First Issues**
-
-Look for issues labeled:
-- `good first issue` - Perfect for beginners
-- `documentation` - Help improve docs
-- `help wanted` - We need your help!
-- `python-script` - Add Python analysis scripts
-
-### 📚 **Learning Resources**
-
-- [React Documentation](https://react.dev/)
-- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
-- [Tauri Documentation](https://tauri.app/)
-- [Python Best Practices](https://docs.python.org/3/tutorial/)
-
----
-
-## 🏆 Recognition
-
-**We celebrate our contributors!** 🎉
-
-- 🌟 Listed in [Contributors](https://github.com/Fincept-Corporation/FinceptTerminal/graphs/contributors)
-- 📰 Mentioned in release notes
-- 🎖️ Special badges for consistent contributors
-- 💬 Shoutouts in community discussions
-
----
-
-## 📞 Need Help?
-
-<div align="center">
+## Getting Help
| Channel | Link |
|---------|------|
-| 💬 **Discussions** | [GitHub Discussions](https://github.com/Fincept-Corporation/FinceptTerminal/discussions) |
-| 🐛 **Bug Reports** | [GitHub Issues](https://github.com/Fincept-Corporation/FinceptTerminal/issues) |
-| 📧 **Email** | [email protected] |
-| 📖 **Documentation** | [Project Wiki](https://github.com/Fincept-Corporation/FinceptTerminal/wiki) |
+| Issues | [GitHub Issues](https://github.com/Fincept-Corporation/FinceptTerminal/issues) |
+| Discussions | [GitHub Discussions](https://github.com/Fincept-Corporation/FinceptTerminal/discussions) |
+| Discord | [Join Discord](https://discord.gg/ae87a8ygbN) |
+| Email | [email protected] |
-</div>
+### Good First Issues
----
+Look for labels: `good first issue`, `help wanted`, `documentation`
-<div align="center">
-
-## 🎉 Thank You!
-
-**Your contributions make Fincept Terminal better for everyone**
-
-[![Contributors](https://img.shields.io/github/contributors/Fincept-Corporation/FinceptTerminal)](https://github.com/Fincept-Corporation/FinceptTerminal/graphs/contributors)
-[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
-
-**Start small, think big! Every contribution counts.** 💙
-
-*Built by the community, for the community*
+---
-</div>
+**Repository**: https://github.com/Fincept-Corporation/FinceptTerminal
+**Version**: 3.3.1
+**License**: AGPL-3.0
diff --git a/docs/DEVELOPER_WALKTHROUGH.md b/docs/DEVELOPER_WALKTHROUGH.md
deleted file mode 100644
index 630905b31..000000000
--- a/docs/DEVELOPER_WALKTHROUGH.md
+++ /dev/null
@@ -1,878 +0,0 @@
-# Developer Walkthrough - Fincept Terminal
-
-**Version:** 3.0.11
-**Last Updated:** 2025-01-04
-
-## Quick Navigation
-
-- [Project Structure](#project-structure)
-- [Getting Started](#getting-started)
-- [Frontend Architecture](#frontend-architecture)
-- [Backend Architecture](#backend-architecture)
-- [Key Systems](#key-systems)
-- [Adding Features](#adding-features)
-- [Common Tasks](#common-tasks)
-
----
-
-## Project Structure
-
-```
-fincept-terminal-desktop/
-├── src/ # Frontend React application
-│ ├── main.tsx # Entry point
-│ ├── App.tsx # Root component
-│ ├── components/ # UI components
-│ ├── contexts/ # React contexts (global state)
-│ ├── services/ # API & business logic
-│ ├── hooks/ # Custom React hooks
-│ └── lib/ # Utility libraries
-│
-├── src-tauri/ # Backend Rust application
-│ ├── src/
-│ │ ├── lib.rs # Main Tauri library
-│ │ ├── main.rs # Entry point
-│ │ ├── commands/ # Tauri commands (exposed to frontend)
-│ │ ├── data_sources/ # Data source utilities
-│ │ └── utils/ # Backend utilities
-│ ├── resources/
-│ │ ├── python/ # Bundled Python runtime
-│ │ └── scripts/ # Python analytics & agents
-│ ├── Cargo.toml # Rust dependencies
-│ └── tauri.conf.json # Tauri configuration
-│
-├── docs/ # Documentation
-├── public/ # Static assets
-└── package.json # Node.js dependencies
-```
-
----
-
-## Getting Started
-
-### Prerequisites
-- Node.js 18+ (LTS recommended)
-- Rust 1.70+
-- Python 3.11+ (bundled with app, needed for development)
-
-### Installation
-```bash
-cd fincept-terminal-desktop
-npm install
-```
-
-### Development
-```bash
-npm run dev # Frontend only (port 1420)
-npm run tauri dev # Full app with Tauri
-```
-
-### Building
-```bash
-npm run build # Frontend build
-npm run tauri build # Production build (creates installer)
-```
-
----
-
-## Frontend Architecture
-
-### 📁 Directory Map
-
-#### **Components** (`src/components/`)
-
-**Authentication** (`auth/`)
-- `LoginScreen.tsx` - User login
-- `RegisterScreen.tsx` - New user registration
-- `PricingScreen.tsx` - Subscription plans
-- `ForgotPasswordScreen.tsx` - Password recovery
-
-**Dashboard** (`dashboard/`)
-- `DashboardScreen.tsx` - Main terminal layout & tab management
-
-**Terminal Tabs** (`tabs/`)
-All major features are in separate tab components:
-- `DashboardTab.tsx` - Overview & metrics
-- `MarketsTab.tsx` - Real-time market data
-- `PortfolioTab.tsx` - Portfolio management → [`portfolio/`](../src/components/tabs/portfolio/)
-- `AnalyticsTab.tsx` - Financial analytics
-- `ChatTab.tsx` - AI chat (Ollama integration)
-- `NodeEditorTab.tsx` - Visual workflow builder → [`node-editor/`](../src/components/tabs/node-editor/)
-- `SettingsTab.tsx` - App configuration
-- [See full list in CLAUDE.md](../CLAUDE.md#available-terminal-tabs)
-
-**Specialized Modules**
-- [`node-editor/`](../src/components/tabs/node-editor/) - Workflow system (ReactFlow-based)
- - `DataSourceNode.tsx` - Data source nodes
- - `MCPToolNode.tsx` - MCP tool nodes
- - `PythonAgentNode.tsx` - Python agent nodes
- - `WorkflowExecutor.ts` - Execution engine
-
-- [`data-sources/`](../src/components/tabs/data-sources/) - Data connectivity
- - [`adapters/`](../src/components/tabs/data-sources/adapters/) - 100+ data connectors
- - `PostgreSQLAdapter.ts`, `MongoDBAdapter.ts`, `KafkaAdapter.ts`, etc.
- - `dataSourceConfigs.ts` - Adapter registry
-
-- [`mcp/`](../src/components/tabs/mcp/) - Model Context Protocol integration
- - `MCPServerCard.tsx` - MCP server management UI
- - [`marketplace/`](../src/components/tabs/mcp/marketplace/) - MCP server marketplace
- - [`docs/`](../src/components/tabs/mcp/docs/) - MCP integration guides
-
-**UI Components** (`ui/`)
-shadcn/ui based components: button, card, dialog, dropdown, etc.
-
-#### **Contexts** (`src/contexts/`)
-Global state management via React Context:
-- `AuthContext.tsx` - Authentication, user session
-- `NavigationContext.tsx` - Tab navigation state
-- `ThemeContext.tsx` - Theme preferences
-- `DataSourceContext.tsx` - Data source connections
-
-#### **Services** (`src/services/`)
-API communication & business logic:
-
-**Authentication & User**
-- `authApi.tsx` - Login, register, session management
-- `paymentApi.tsx` - Subscription payments
-- `userApi.tsx` - User profile operations
-
-**Market Data**
-- `marketDataService.ts` - Unified market data interface
-- `polygonService.ts` - Polygon.io integration
-- `alphaVantageService.ts` - Alpha Vantage API
-- `yfinanceService.ts` - Yahoo Finance wrapper
-
-**Analytics & Portfolio**
-- `portfolioService.ts` - Portfolio analytics
-- `workflowService.ts` - Workflow execution engine
-- `nodeExecutionManager.ts` - Node execution logic
-
-**AI & Agents**
-- `ollamaService.ts` - Local LLM (Ollama)
-- `pythonAgentService.ts` - Python agent execution
-- `agentLLMService.ts` - Agent-LLM bridge
-- `mcpManager.ts` - MCP server lifecycle
-- `mcpClient.ts` - MCP client implementation
-
-**Data Management**
-- `dataSourceRegistry.ts` - Register all data adapters
-- `storageService.ts` - Local storage utilities
-- `chatDatabase.ts` - Chat history (Dexie/IndexedDB)
-- `duckdbService.ts` - DuckDB integration
-
-#### **Hooks** (`src/hooks/`)
-- `useDataSource.ts` - Data source connection hook
-- `useWebSocket.ts` - WebSocket connection management
-- `useAutoUpdater.ts` - Auto-update logic
-- `use-mobile.ts` - Mobile detection
-
----
-
-## Backend Architecture
-
-### 📁 Rust Backend (`src-tauri/src/`)
-
-#### **Main Files**
-- **`lib.rs`** - Tauri application entry, command registration
- - MCP server management (spawn, kill, communicate)
- - Python script execution
- - Command handler registration (~900 commands!)
-
-- **`main.rs`** - Application bootstrap
-
-#### **Commands** (`commands/`)
-Tauri commands expose backend functionality to frontend via `invoke()`:
-
-**Market Data Commands**
-- `market_data.rs` - Generic market data operations
-- `polygon.rs` - Polygon.io API wrapper
-- `yfinance.rs` - Yahoo Finance wrapper
-- `alphavantage.rs` - Alpha Vantage API
-
-**Economic Data Commands**
-- `fred.rs` - Federal Reserve Economic Data
-- `bis.rs` - Bank for International Settlements
-- `bls.rs` - Bureau of Labor Statistics
-- `eia.rs` - Energy Information Administration
-- `ecb.rs` - European Central Bank
-- `bea.rs` - Bureau of Economic Analysis
-- `worldbank.rs` - World Bank data
-- `oecd.rs` - OECD statistics
-- `imf.rs` - International Monetary Fund
-- `unesco.rs` - UNESCO statistics
-
-**Government & Regulatory**
-- `sec.rs` - SEC filings & data
-- `cftc.rs` - CFTC Commitments of Traders
-- `congress_gov.rs` - US Congress bills & legislation
-- `government_us.rs` - US Treasury data
-- `cboe.rs` - CBOE market data
-- `nasdaq.rs` - NASDAQ data & screeners
-
-**Financial Analytics**
-- `fmp.rs` - Financial Modeling Prep API
-- `multpl.rs` - Market multiples & valuations
-- `trading_economics.rs` - Trading Economics data
-- `econdb.rs` - EconDB integration
-
-**International Data**
-- `wto.rs` - World Trade Organization
-- `canada_gov.rs`, `datagovuk.rs`, `datagov_au.rs` - Government data
-- `estat_japan.rs`, `govdata_de.rs`, `datagovsg.rs` - Regional data
-- `french_gov.rs`, `swiss_gov.rs`, `spain_data.rs` - European data
-
-**Specialized**
-- `portfolio.rs` - Portfolio analytics commands
-- `agents.rs` - Python agent execution
-- `jupyter.rs` - Jupyter notebook operations
-- `coingecko.rs` - Cryptocurrency data
-- `oscar.rs` - Satellite & instrument data
-- `sentinelhub.rs` - Satellite imagery
-
-**Command Registration**
-All commands are registered in `lib.rs` (~line 390-945):
-```rust
-.invoke_handler(tauri::generate_handler![
- // ... 900+ commands
-])
-```
-
-#### **Utilities** (`utils/`)
-- Python path resolution
-- Bundled runtime management
-
-### 📁 Python Backend (`src-tauri/resources/scripts/`)
-
-#### **Analytics Modules** ([`Analytics/`](https://github.com/Fincept-Corporation/FinceptTerminal/tree/main/fincept-terminal-desktop/src-tauri/resources/scripts/Analytics))
-Complete CFA-level financial analytics:
-
-- **`equityInvestment/`** - Stock valuation
- - DCF models (FCFF, FCFE)
- - Dividend discount models
- - Multiples analysis
- - Fundamental analysis
-
-- **`portfolioManagement/`** - Portfolio optimization
- - Mean-variance optimization
- - Risk parity
- - Black-Litterman model
- - Factor models
-
-- **`derivatives/`** - Options pricing
- - Black-Scholes model
- - Greeks calculation
- - Options strategies
- - Hedging analysis
-
-- **`economics/`** - Economic indicators
- - GDP analysis
- - Inflation models
- - Policy analysis
-
-- **`quant/`** - Quantitative finance
- - Statistical models
- - Backtesting frameworks
- - Risk metrics
-
-- **`ml4Trading/`** - Machine learning
- - Prediction models
- - Feature engineering
- - Model evaluation
-
-- **`technical_indicators.py`** - Technical analysis functions
-
-#### **AI Agents** ([`agents/`](https://github.com/Fincept-Corporation/FinceptTerminal/tree/main/fincept-terminal-desktop/src-tauri/resources/scripts/agents))
-
-**Investor Personas** (`TraderInvestorsAgent/`)
-- Warren Buffett strategy
-- Benjamin Graham value investing
-- Peter Lynch growth investing
-- Ray Dalio principles
-- George Soros reflexivity
-- 20+ legendary investors
-
-**Hedge Fund Strategies** (`hedgeFundAgents/`)
-- Bridgewater All-Weather portfolio
-- Citadel multi-strategy quant
-- Renaissance Technologies statistical arbitrage
-- Two Sigma ML-driven strategies
-
-**Geopolitical Analysis** (`GeopoliticsAgents/`)
-- Grand Chessboard framework
-- Prisoners of Geography analysis
-- World Order models
-- Central bank policy tracking
-
-**Economic Agents** (`EconomicAgents/`)
-- Macro analysis
-- Policy impact assessment
-- Economic forecasting
-
-#### **Data Scripts**
-Individual Python scripts for data APIs:
-- `yfinance_data.py`, `polygon_data.py`, `alphavantage_data.py`
-- `bis_data.py`, `fred_data.py`, `worldbank_data.py`
-- `sec_data.py`, `eia_data.py`, `bls_data.py`
-- 50+ data source scripts
-
----
-
-## Key Systems
-
-### 🔐 Authentication Flow
-
-**Guest Users** (Temporary access)
-1. User clicks "Continue as Guest" → `LoginScreen.tsx`
-2. `authApi.guestLogin()` → Backend creates 24hr session
-3. `AuthContext` stores session → localStorage
-4. Navigate to dashboard
-
-**Registered Users**
-1. Login/Register → `LoginScreen.tsx` / `RegisterScreen.tsx`
-2. `authApi.login()` / `authApi.register()` → JWT token
-3. Check subscription status → redirect to pricing if needed
-4. `AuthContext` manages session
-
-**Files:**
-- Frontend: `src/components/auth/*.tsx`, `src/contexts/AuthContext.tsx`, `src/services/authApi.tsx`
-- Backend: Authentication handled by external API (not in Tauri)
-
-### 💳 Payment System
-
-1. User selects plan → `PricingScreen.tsx`
-2. `paymentApi.createOrder()` → Order ID
-3. Payment window opens (Razorpay/Stripe)
-4. Callback → verify payment → update subscription
-5. Navigate to dashboard
-
-**Files:**
-- `src/components/auth/PricingScreen.tsx`
-- `src/components/payment/*.tsx`
-- `src/services/paymentApi.tsx`
-
-### 📊 Market Data Pipeline
-
-**Unified Interface:**
-```typescript
-// Frontend
-import { marketDataService } from '@/services/marketDataService';
-const quote = await marketDataService.getQuote('AAPL');
-```
-
-**Data Flow:**
-1. Frontend calls `marketDataService.ts`
-2. Service selects provider (Polygon/Alpha Vantage/yfinance)
-3. Invokes Tauri command: `invoke('get_market_quote', { symbol })`
-4. Rust command executes Python script
-5. Python fetches from API → returns JSON
-6. Rust parses → returns to frontend
-7. Frontend updates UI
-
-**Files:**
-- Frontend: `src/services/marketDataService.ts`, `src/services/polygonService.ts`
-- Backend: `src-tauri/src/commands/market_data.rs`, `src-tauri/resources/scripts/polygon_data.py`
-
-### 🤖 AI Chat (Ollama)
-
-**Local LLM Integration:**
-1. User sends message → `ChatTab.tsx`
-2. `ollamaService.chat()` → Ollama API (local)
-3. Stream response → update UI
-4. Save to `chatDatabase.ts` (Dexie)
-
-**Optional MCP Tools:**
-- MCP servers provide tools to LLM
-- `mcpManager.ts` manages server lifecycle
-- LLM can invoke tools during chat
-
-**Files:**
-- `src/components/tabs/ChatTab.tsx`
-- `src/services/ollamaService.ts`
-- `src/services/mcpManager.ts`
-- `src/services/chatDatabase.ts`
-
-### 🔄 Workflow System (Node Editor)
-
-**Visual Programming:**
-1. User creates workflow → `NodeEditorTab.tsx` (ReactFlow)
-2. Drag nodes: Data Sources, Transformations, MCP Tools, Python Agents
-3. Connect nodes → define data flow
-4. Execute → `WorkflowExecutor.ts`
-5. Results displayed in `ResultsDisplayNode.tsx`
-
-**Node Types:**
-- **Data Source Node** (`DataSourceNode.tsx`) - Fetch data from 100+ sources
-- **MCP Tool Node** (`MCPToolNode.tsx`) - Execute MCP tools
-- **Python Agent Node** (`PythonAgentNode.tsx`) - Run AI agents
-- **Results Node** (`ResultsDisplayNode.tsx`) - Display output
-
-**Execution Engine:**
-- `WorkflowExecutor.ts` - Topological sort, dependency resolution
-- `nodeExecutionManager.ts` - Execute individual nodes
-- `workflowService.ts` - Save/load workflows
-
-**Files:**
-- `src/components/tabs/NodeEditorTab.tsx`
-- `src/components/tabs/node-editor/*`
-- `src/services/workflowService.ts`
-
-### 🔌 Data Sources (100+ Connectors)
-
-**Architecture:**
-```
-BaseAdapter (abstract)
- ├── PostgreSQLAdapter
- ├── MongoDBAdapter
- ├── KafkaAdapter
- ├── ...
- └── RESTAdapter
-```
-
-**Adding a New Data Source:**
-1. Create adapter: `src/components/tabs/data-sources/adapters/MyAdapter.ts`
- - Extend `BaseAdapter`
- - Implement `connect()`, `execute()`, `disconnect()`
-2. Register: `src/components/tabs/data-sources/adapters/index.ts`
-3. Add config: `src/components/tabs/data-sources/dataSourceConfigs.ts`
-4. Now available in Node Editor + Data Sources tab
-
-**Files:**
-- All adapters: `src/components/tabs/data-sources/adapters/`
-- See [ADD_NEW_DATA_SOURCE.md](ADD_NEW_DATA_SOURCE.md)
-
-### 🛠️ MCP Integration
-
-**Model Context Protocol** - Extend AI capabilities
-
-**MCP Server Lifecycle:**
-1. User adds server → `MCPMarketplace.tsx` or `MCPAddServerModal.tsx`
-2. Frontend invokes: `invoke('spawn_mcp_server', { command, args })`
-3. Rust spawns process → manages stdin/stdout
-4. Frontend sends JSON-RPC → `mcpClient.ts`
-5. Server returns tools/resources
-6. Tools available in Node Editor & Chat
-
-**Available in:**
-- **Node Editor** - `MCPToolNode.tsx` executes MCP tools
-- **Chat** - LLM can invoke MCP tools
-- **MCP Tab** - Manage servers, view logs
-
-**Adding MCP Server:**
-- See `src/components/tabs/mcp/docs/ADDING_NEW_MCP.md`
-- Define in `src/components/tabs/mcp/marketplace/serverDefinitions.ts`
-
-**Files:**
-- `src/components/tabs/mcp/*`
-- `src/services/mcpManager.ts`, `src/services/mcpClient.ts`
-- `src-tauri/src/lib.rs` (MCP commands: spawn, send, kill)
-
-### 📈 Portfolio Analytics
-
-**CFA-Level Analytics:**
-1. User inputs portfolio → `PortfolioTab.tsx`
-2. Frontend calls: `invoke('calculate_portfolio_metrics', { holdings })`
-3. Rust executes: `src-tauri/src/commands/portfolio.rs`
-4. Python script: `src-tauri/resources/scripts/Analytics/portfolioManagement/`
-5. Returns: Sharpe ratio, VaR, beta, correlations, etc.
-
-**Available Analytics:**
-- Portfolio optimization (efficient frontier)
-- Risk metrics (VaR, CVaR, max drawdown)
-- Factor analysis
-- Scenario analysis
-- Retirement planning
-- Behavioral bias detection
-
-**Files:**
-- Frontend: `src/components/tabs/PortfolioTab.tsx`, `src/components/tabs/portfolio/*`
-- Backend: `src-tauri/src/commands/portfolio.rs`
-- Python: `src-tauri/resources/scripts/Analytics/portfolioManagement/*`
-
-### 🧠 Python Agents
-
-**Execution Flow:**
-1. User selects agent → Node Editor or Analytics tab
-2. Frontend: `invoke('execute_python_agent', { agentPath, params })`
-3. Rust: `src-tauri/src/commands/agents.rs`
-4. Python: `src-tauri/resources/scripts/agents/[AgentCategory]/agent.py`
-5. Agent executes → returns analysis
-6. Frontend displays results
-
-**Agent Categories:**
-- Investor personas (Buffett, Dalio, etc.)
-- Hedge fund strategies
-- Geopolitical analysis
-- Economic forecasting
-
-**Files:**
-- Frontend: `src/components/tabs/node-editor/PythonAgentNode.tsx`
-- Backend: `src-tauri/src/commands/agents.rs`
-- Python: `src-tauri/resources/scripts/agents/*`
-
----
-
-## Adding Features
-
-### ✨ Add a New Terminal Tab
-
-**1. Create Component**
-```tsx
-// src/components/tabs/MyNewTab.tsx
-import React from 'react';
-
-const MyNewTab: React.FC = () => {
- return (
- <div className="p-4">
- <h1>My New Feature</h1>
- </div>
- );
-};
-
-export default MyNewTab;
-```
-
-**2. Register Tab**
-Edit `src/components/dashboard/DashboardScreen.tsx`:
-```tsx
-import MyNewTab from '@/components/tabs/MyNewTab';
-
-// Add to tabs array
-const tabs = [
- // ...
- { id: 'mynew', label: 'My Feature', icon: Sparkles, component: MyNewTab },
-];
-```
-
-**3. Test**
-```bash
-npm run tauri dev
-```
-
-### 🔌 Add a Data Source Adapter
-
-**1. Create Adapter**
-```typescript
-// src/components/tabs/data-sources/adapters/MyAPIAdapter.ts
-import { BaseAdapter } from './BaseAdapter';
-
-export class MyAPIAdapter extends BaseAdapter {
- async connect(config: any): Promise<void> {
- // Initialize connection
- }
-
- async execute(query: string): Promise<any> {
- // Fetch data
- }
-
- async disconnect(): Promise<void> {
- // Cleanup
- }
-}
-```
-
-**2. Register**
-```typescript
-// src/components/tabs/data-sources/adapters/index.ts
-export { MyAPIAdapter } from './MyAPIAdapter';
-```
-
-**3. Add Config**
-```typescript
-// src/components/tabs/data-sources/dataSourceConfigs.ts
-export const dataSourceConfigs = {
- // ...
- myapi: {
- name: 'My API',
- fields: [
- { name: 'apiKey', label: 'API Key', type: 'password' },
- ],
- },
-};
-```
-
-### 🤖 Add a Python Analytics Module
-
-**1. Create Python Module**
-```python
-# src-tauri/resources/scripts/Analytics/myAnalysis/calculator.py
-import json
-import sys
-
-def calculate(data):
- # Your analysis logic
- result = { "metric": 42 }
- return result
-
-if __name__ == "__main__":
- input_data = json.loads(sys.argv[1])
- output = calculate(input_data)
- print(json.dumps(output))
-```
-
-**2. Create Rust Command**
-```rust
-// src-tauri/src/commands/my_analysis.rs
-use tauri::command;
-
-#[command]
-pub fn run_my_analysis(
- app: tauri::AppHandle,
- data: String,
-) -> Result<String, String> {
- crate::execute_python_script(
- app,
- "Analytics/myAnalysis/calculator.py".to_string(),
- vec![data],
- None,
- )
-}
-```
-
-**3. Register Command**
-```rust
-// src-tauri/src/commands/mod.rs
-pub mod my_analysis;
-
-// src-tauri/src/lib.rs
-.invoke_handler(tauri::generate_handler![
- // ...
- commands::my_analysis::run_my_analysis,
-])
-```
-
-**4. Call from Frontend**
-```typescript
-import { invoke } from '@tauri-apps/api/core';
-
-const result = await invoke('run_my_analysis', {
- data: JSON.stringify({ values: [1, 2, 3] })
-});
-```
-
-### 🛠️ Add an MCP Server Definition
-
-**1. Define Server**
-```typescript
-// src/components/tabs/mcp/marketplace/serverDefinitions.ts
-export const serverDefinitions = {
- // ...
- my_tool: {
- id: 'my_tool',
- name: 'My Custom Tool',
- description: 'Does something useful',
- command: 'npx',
- args: ['-y', '@my/mcp-server'],
- env: {},
- category: 'utilities',
- },
-};
-```
-
-**2. (Optional) Create Custom Form**
-```tsx
-// src/components/tabs/mcp/marketplace/forms/MyToolForm.tsx
-export const MyToolForm: React.FC<Props> = ({ onSubmit }) => {
- // Custom configuration UI
-};
-```
-
-**3. User Can Now:**
-- Install from MCP Marketplace tab
-- Use in Node Editor (`MCPToolNode`)
-- Available to AI chat
-
-### 🎨 Add a Custom Node Type
-
-**1. Create Node Component**
-```tsx
-// src/components/tabs/node-editor/MyCustomNode.tsx
-import { Handle, Position } from 'reactflow';
-
-export const MyCustomNode = ({ data }: NodeProps) => {
- return (
- <div className="custom-node">
- <Handle type="target" position={Position.Top} />
- <div>My Custom Logic</div>
- <Handle type="source" position={Position.Bottom} />
- </div>
- );
-};
-```
-
-**2. Register Node Type**
-```typescript
-// src/components/tabs/NodeEditorTab.tsx
-const nodeTypes = {
- // ...
- myCustom: MyCustomNode,
-};
-```
-
-**3. Add Execution Logic**
-```typescript
-// src/components/tabs/node-editor/WorkflowExecutor.ts
-case 'myCustom':
- result = await executeMyCustomLogic(node.data);
- break;
-```
-
----
-
-## Common Tasks
-
-### 🔍 Debugging
-
-**Frontend**
-```bash
-npm run dev # Open http://localhost:1420
-# Use browser DevTools (F12)
-# React DevTools extension recommended
-```
-
-**Backend (Rust)**
-```bash
-npm run tauri dev
-# Check terminal output for Rust logs
-# println!() statements appear in terminal
-```
-
-**Python Scripts**
-- Errors appear in Tauri terminal
-- Add `print()` statements for debugging
-- Output captured in Rust command
-
-### 🧪 Testing
-
-**Manual Testing**
-```bash
-npm run tauri dev # Test in development
-npm run tauri build # Test production build
-```
-
-**Test Checklist:**
-- Authentication flows (guest & registered)
-- Tab navigation
-- Data source connections
-- Workflow execution
-- Python analytics
-- MCP server spawning
-
-### 📦 Building Release
-
-**Full Build**
-```bash
-npm run build # Frontend
-npm run tauri build # Creates installer
-```
-
-**Output:**
-- Windows: `.msi` in `src-tauri/target/release/bundle/msi/`
-- macOS: `.dmg` in `src-tauri/target/release/bundle/dmg/`
-- Linux: `.AppImage`, `.deb` in `src-tauri/target/release/bundle/`
-
-**Version Bump**
-```bash
-npm run bump-version # Auto-increment version
-git tag v3.0.12
-git push --tags
-```
-
-### 🔧 Common Issues
-
-**Build fails with Rust errors:**
-```bash
-cd src-tauri
-cargo clean
-cargo build
-```
-
-**Python script not found:**
-- Check path in Rust command
-- Verify script exists in `src-tauri/resources/scripts/`
-- Ensure Python runtime is bundled
-
-**MCP server not spawning:**
-- Check server command/args in definition
-- Verify npm packages installed globally
-- Check Tauri terminal for spawn errors
-
-**Data source connection fails:**
-- Verify adapter config
-- Check API keys/credentials
-- Review adapter implementation
-
-### 📝 Code Style
-
-**TypeScript:**
-- Use functional components
-- Prefer `const` over `let`
-- Type all function parameters
-- Use interfaces for complex types
-
-**Rust:**
-- Follow Rust naming conventions
-- Use `Result<T, String>` for error handling
-- Document public functions
-
-**Python:**
-- PEP 8 style guide
-- Type hints recommended
-- JSON input/output for Tauri integration
-
----
-
-## File Quick Reference
-
-### Essential Files
-
-| File | Purpose |
-|------|---------|
-| `src/main.tsx` | Frontend entry point |
-| `src/App.tsx` | Root component, routing |
-| `src/components/dashboard/DashboardScreen.tsx` | Main terminal layout |
-| `src/contexts/AuthContext.tsx` | Authentication state |
-| `src/services/authApi.tsx` | Auth API calls |
-| `src-tauri/src/lib.rs` | Tauri commands registration |
-| `src-tauri/src/commands/mod.rs` | Command module registry |
-| `src-tauri/tauri.conf.json` | Tauri configuration |
-| `package.json` | Node.js dependencies |
-| `src-tauri/Cargo.toml` | Rust dependencies |
-
-### Key Directories
-
-| Directory | Contents |
-|-----------|----------|
-| `src/components/tabs/` | All terminal tabs |
-| `src/components/tabs/node-editor/` | Workflow system |
-| `src/components/tabs/data-sources/adapters/` | Data connectors |
-| `src/components/tabs/mcp/` | MCP integration |
-| `src/services/` | Business logic & APIs |
-| `src-tauri/src/commands/` | Backend commands |
-| `src-tauri/resources/scripts/Analytics/` | Python analytics |
-| `src-tauri/resources/scripts/agents/` | AI agents |
-
----
-
-## Additional Resources
-
-- [README.md](../README.md) - Project overview
-- [CLAUDE.md](../CLAUDE.md) - Detailed architecture guide
-- [ADD_NEW_DATA_SOURCE.md](ADD_NEW_DATA_SOURCE.md) - Data source tutorial
-- [src/components/tabs/mcp/docs/ADDING_NEW_MCP.md](../src/components/tabs/mcp/docs/ADDING_NEW_MCP.md) - MCP integration
-
-**External Docs:**
-- [Tauri Documentation](https://tauri.app/v2/)
-- [React 19 Docs](https://react.dev/)
-- [ReactFlow Docs](https://reactflow.dev/)
-
----
-
-## Get Help
-
-- **Issues:** [GitHub Issues](https://github.com/Fincept-Corporation/FinceptTerminal/issues)
-- **Discussions:** [GitHub Discussions](https://github.com/Fincept-Corporation/FinceptTerminal/discussions)
-- **Email:** [email protected]
-
----
-
-**Happy Building! 🚀**
diff --git a/docs/PYTHON_CONTRIBUTOR_GUIDE.md b/docs/PYTHON_CONTRIBUTOR_GUIDE.md
index e37a95641..2abc018f7 100644
--- a/docs/PYTHON_CONTRIBUTOR_GUIDE.md
+++ b/docs/PYTHON_CONTRIBUTOR_GUIDE.md
@@ -1,212 +1,322 @@
-# Python Contributor Guide for Fincept Terminal
+# Python Contributor Guide
-## Quick Start Guide for Absolute Beginners
+This guide covers Python development for Fincept Terminal - 119 scripts including 34 Analytics modules and 80+ data fetchers.
-Welcome! This guide helps you contribute Python code to Fincept Terminal, even if you're new to programming.
+> **Prerequisites**: Read the [Contributing Guide](./CONTRIBUTING.md) first for setup and workflow.
---
-## 📋 Table of Contents
+## Table of Contents
-1. [What You Need](#what-you-need)
-2. [Project Structure](#project-structure)
-3. [Your First Contribution](#your-first-contribution)
-4. [Python Basics](#python-basics)
-5. [How to Test](#how-to-test)
-6. [Common Tasks](#common-tasks)
-7. [Get Help](#get-help)
+- [Overview](#overview)
+- [Project Structure](#project-structure)
+- [Analytics Modules](#analytics-modules)
+- [Data Fetcher Scripts](#data-fetcher-scripts)
+- [Script Standards](#script-standards)
+- [Integration with Rust](#integration-with-rust)
+- [Testing](#testing)
+- [Resources](#resources)
---
-## What You Need
+## Overview
-### Essential Tools:
-- **Python 3.8+** - Download from python.org
-- **Code Editor** - VS Code (recommended) or PyCharm
-- **Git** - Download from git-scm.com
+Python powers Fincept Terminal's analytics and data capabilities:
+- **34 Analytics modules** - Financial calculations, portfolio optimization, ML models
+- **80+ Data fetchers** - APIs for market data, economics, government sources
+- **AI Agents** - Geopolitical analysis, trading strategies
+- **Technical Analysis** - Indicators and chart patterns
-### Setup:
-```bash
-# Install Python packages
-pip install requests pandas
-
-# Clone the project
-git clone [project-url]
-cd fincept_terminal
-```
+**Related Guides:**
+- [Rust Guide](./RUST_CONTRIBUTOR_GUIDE.md) - How Rust executes Python
+- [TypeScript Guide](./TYPESCRIPT_CONTRIBUTOR_GUIDE.md) - Frontend that displays results
---
## Project Structure
```
-fincept_terminal/
-├── Agents/ # AI hedge fund agents
-│ ├── Trader_Investors_agent/ # Famous investor strategies
-│ └── src/ # Shared utilities
-├── Analytics/economics/ # Economic analysis tools
-└── docs/ # Documentation (you're here!)
+src-tauri/resources/scripts/ # 119 Python scripts
+│
+├── Analytics/ # 34 analytics modules
+│ ├── equityInvestment/ # Stock valuation, DCF
+│ ├── portfolioManagement/ # Portfolio optimization
+│ ├── derivatives/ # Options pricing, Greeks
+│ ├── fixedIncome/ # Bond analytics
+│ ├── corporateFinance/ # M&A, valuation
+│ ├── economics/ # Economic models
+│ ├── quant/ # Quantitative analysis
+│ ├── alternateInvestment/ # Alternative assets
+│ ├── backtesting/ # Strategy backtesting
+│ ├── finanicalanalysis/ # Financial statements
+│ ├── technical_analysis/ # Technical indicators
+│ │
+│ ├── pyportfolioopt_wrapper/ # Portfolio optimization
+│ ├── quantstats_analytics.py # Portfolio metrics
+│ ├── skfolio_wrapper.py # Scikit-portfolio
+│ ├── riskfoliolib_wrapper.py # Risk-folio lib
+│ ├── talipp_wrapper/ # Technical indicators
+│ ├── gs_quant_wrapper/ # Goldman Sachs Quant
+│ ├── gluonts_wrapper/ # Time series forecasting
+│ ├── statsmodels_wrapper/ # Statistical models
+│ ├── finrl/ # Reinforcement learning
+│ └── vnpy_wrapper/ # VN.PY trading
+│
+├── agents/ # AI agents
+│ ├── geopolitics/ # Geopolitical analysis
+│ └── trading/ # Trading agents
+│
+├── strategies/ # Trading strategies
+├── technicals/ # Technical analysis
+│
+├── yfinance_data.py # Yahoo Finance
+├── fred_data.py # Federal Reserve
+├── imf_data.py # IMF data
+├── worldbank_data.py # World Bank
+├── oecd_data.py # OECD data
+├── ecb_data.py # European Central Bank
+├── bis_data.py # Bank for Intl Settlements
+├── nasdaq_data.py # NASDAQ data
+├── sec_data.py # SEC filings
+├── edgar_tools.py # EDGAR database
+├── fmp_data.py # Financial Modeling Prep
+├── databento_provider.py # Databento market data
+│
+├── akshare_*.py # 20+ Chinese market scripts
+├── *_gov_api.py # Government data APIs
+└── ... # 40+ more data fetchers
```
-**Where you'll work:** `Agents/` folder, adding comments and simple functions.
+---
+
+## Analytics Modules
+
+### Core Financial Modules
+
+| Module | Purpose | Key Functions |
+|--------|---------|---------------|
+| `equityInvestment/` | Stock analysis | DCF, comparables, valuation |
+| `portfolioManagement/` | Portfolio optimization | Mean-variance, Black-Litterman |
+| `derivatives/` | Options & futures | Black-Scholes, Greeks, pricing |
+| `fixedIncome/` | Bond analytics | Duration, convexity, yields |
+| `corporateFinance/` | Corporate valuation | M&A, LBO, WACC |
+| `economics/` | Economic models | GDP, inflation, policy |
+| `quant/` | Quantitative analysis | Factor models, risk |
+
+### Library Wrappers
+
+| Wrapper | Library | Purpose |
+|---------|---------|---------|
+| `pyportfolioopt_wrapper/` | PyPortfolioOpt | Portfolio optimization |
+| `quantstats_analytics.py` | QuantStats | Performance metrics |
+| `skfolio_wrapper.py` | Skfolio | Scikit-learn portfolios |
+| `riskfoliolib_wrapper.py` | Riskfolio-Lib | Risk management |
+| `talipp_wrapper/` | Talipp | Technical indicators |
+| `statsmodels_wrapper/` | Statsmodels | Statistical models |
+| `gluonts_wrapper/` | GluonTS | Time series forecasting |
+| `gs_quant_wrapper/` | GS Quant | Goldman Sachs library |
+| `finrl/` | FinRL | Reinforcement learning |
---
-## Your First Contribution
+## Data Fetcher Scripts
+
+### Market Data
+
+| Script | Source | Data Types |
+|--------|--------|------------|
+| `yfinance_data.py` | Yahoo Finance | Stocks, ETFs, options |
+| `databento_provider.py` | Databento | Real-time market data |
+| `nasdaq_data.py` | NASDAQ | US equities |
+| `fmp_data.py` | Financial Modeling Prep | Fundamentals |
+| `coingecko.py` | CoinGecko | Cryptocurrency |
+
+### Economic Data
+
+| Script | Source | Data Types |
+|--------|--------|------------|
+| `fred_data.py` | Federal Reserve | US economic indicators |
+| `imf_data.py` | IMF | Global economic data |
+| `worldbank_data.py` | World Bank | Development indicators |
+| `oecd_data.py` | OECD | OECD statistics |
+| `ecb_data.py` | ECB | European data |
+| `bis_data.py` | BIS | Banking statistics |
+| `bls_data.py` | Bureau of Labor | Employment, CPI |
+| `bea_data.py` | Bureau of Economic Analysis | GDP, trade |
+
+### Chinese Market (AkShare)
+
+20+ scripts for Chinese market data:
+- `akshare_stocks_*.py` - A-shares data
+- `akshare_futures.py` - Futures data
+- `akshare_funds_*.py` - Fund data
+- `akshare_macro.py` - Macro indicators
+- `akshare_index.py` - Index data
+
+### Government & Regulatory
+
+| Script | Source |
+|--------|--------|
+| `sec_data.py` | SEC filings |
+| `edgar_tools.py` | EDGAR database |
+| `congress_gov_data.py` | US Congress |
+| `cftc_data.py` | CFTC positions |
+| `government_us_data.py` | US government |
-### Easy Start: Add Comments
+---
-1. **Pick a file** in `Agents/Trader_Investors_agent/`
-2. **Add data source comments** at the top:
+## Script Standards
-```python
-# ===== DATA SOURCES REQUIRED =====
-# INPUT:
-# - ticker symbols (array)
-# - end_date (string)
-# - API_KEY (string)
-
-# OUTPUT:
-# - Financial metrics (ROE, P/E ratio, etc.)
-# - Analysis results (signals, confidence)
-
-# PARAMETERS:
-# - period: "annual" or "quarterly"
-# - limit: Number of years of data
-```
+### Input/Output Format
+
+All scripts use JSON for communication:
-3. **Save the file** (Ctrl+S)
+```python
+import sys
+import json
-That's it! You've made your first contribution.
+def main():
+ if len(sys.argv) < 2:
+ print(json.dumps({"success": False, "error": "Usage: script.py <command>"}))
+ sys.exit(1)
----
+ command = sys.argv[1]
-## Python Basics
+ try:
+ result = process_command(command)
+ print(json.dumps({"success": True, "data": result}))
+ except Exception as e:
+ print(json.dumps({"success": False, "error": str(e)}))
+ sys.exit(1)
-### Comments (Explain Your Code)
-```python
-# This is a single-line comment
-'''
-This is a multi-line comment
-Can span multiple lines
-'''
+if __name__ == "__main__":
+ main()
```
-### Variables (Store Data)
-```python
-agent_name = "Warren Buffett"
-confidence = 85.5
-is_bullish = True
-```
+### Type Hints
+
+Always use type hints:
-### Functions (Reusable Code)
```python
-def analyze_stock(ticker):
- """Analyze a stock and return signal"""
- return "bullish"
+from typing import List, Dict, Any, Optional
+
+def calculate_returns(prices: List[float], period: int = 1) -> Dict[str, Any]:
+ """Calculate returns from price series."""
+ ...
```
-### Lists and Dictionaries (Collections)
+### Error Handling
+
```python
-tickers = ["AAPL", "GOOGL", "MSFT"]
-result = {"signal": "buy", "confidence": 90}
+def safe_fetch(symbol: str) -> Dict[str, Any]:
+ try:
+ if not symbol:
+ return {"success": False, "error": "Symbol required"}
+
+ data = fetch_data(symbol)
+ return {"success": True, "data": data}
+
+ except ValueError as e:
+ return {"success": False, "error": f"Invalid input: {e}"}
+ except Exception as e:
+ return {"success": False, "error": f"Unexpected error: {e}"}
```
---
-## How to Test
+## Integration with Rust
-### Simple Test:
-```python
-# Test your function
-result = analyze_stock("AAPL")
-print(result) # Should print "bullish"
+Python scripts are called from Rust:
+
+```
+Frontend (React)
+ ↓ invoke('calculate_portfolio')
+Rust (Tauri Command)
+ ↓ Command::new("python").arg("script.py")
+Python Script
+ ↓ JSON to stdout
+Rust
+ ↓ parse JSON, return to frontend
+Frontend
+ ↓ display results
```
-### How to Run:
-- **VS Code**: Press F5
-- **Command Line**: `python your_file.py`
-- **PyCharm**: Right-click → Run
+### Script Execution
-### Test Checklist:
-✅ Code runs without errors
-✅ Output looks correct
-✅ Comments explain what code does
+```bash
+# Scripts are called as:
+python Analytics/portfolioManagement/optimize.py '{"symbols":["AAPL","MSFT"]}'
+
+# Expected output:
+{"success": true, "data": {"weights": [0.6, 0.4], "sharpe": 1.23}}
+```
---
-## Common Tasks
+## Testing
-### 1. Add Comments
-```python
-# ===== DATA SOURCES REQUIRED =====
-# INPUT: ticker symbols, end_date, API_KEY
-# OUTPUT: financial metrics, analysis results
-# PARAMETERS: period, limit
-```
+### Manual Testing
-### 2. Fix Typos
-- Read through code
-- Fix spelling errors in comments
-- Correct variable names
+```bash
+cd src-tauri/resources/scripts
-### 3. Add Simple Functions
-```python
-def calculate_simple_moving_average(prices, period=20):
- """Calculate moving average"""
- if len(prices) < period:
- return None
- return sum(prices[-period:]) / period
-```
+# Test a data fetcher
+python yfinance_data.py quote AAPL
-### 4. Improve Error Messages
-```python
-# Before: return "Error"
-# After: return "Invalid ticker symbol format"
+# Test an analytics module
+python Analytics/quantstats_analytics.py metrics '{"returns":[0.01,0.02,-0.01]}'
```
----
+### Test Pattern
+
+```python
+def test_calculate_returns():
+ prices = [100, 102, 101, 105]
+ result = calculate_returns(prices)
-## Get Help
+ assert result["success"] == True
+ assert "returns" in result["data"]
+ assert len(result["data"]["returns"]) == 3
-### Where to Ask:
-- **GitHub Issues**: For bugs/questions
-- **Discord/Slack**: Community chat (if available)
-- **Stack Overflow**: General Python questions
+if __name__ == "__main__":
+ test_calculate_returns()
+ print("Tests passed!")
+```
-### What to Include:
-1. What you're trying to do
-2. Code you've written
-3. Error messages (copy full text)
-4. What you've tried already
+---
-### Best Practices:
-✅ Start with small changes
-✅ Ask questions if stuck
-✅ Celebrate small wins
-✅ Learn from existing code
+## Resources
-❌ Don't delete existing code
-❌ Don't commit broken code
-❌ Don't worry about mistakes!
+### Key Libraries
----
+| Library | Purpose |
+|---------|---------|
+| `pandas` | Data manipulation |
+| `numpy` | Numerical computing |
+| `scipy` | Scientific computing |
+| `yfinance` | Yahoo Finance API |
+| `akshare` | Chinese market data |
+| `pyportfolioopt` | Portfolio optimization |
+| `quantstats` | Performance analytics |
+| `ta-lib` / `talipp` | Technical indicators |
+| `statsmodels` | Statistical models |
+| `scikit-learn` | Machine learning |
+| `langchain` | LLM integration |
-## Quick Reference
+### Documentation
-### File Locations:
-- **Agents**: `Agents/Trader_Investors_agent/`
-- **Analytics**: `Analytics/economics/`
-- **Tools**: `Agents/src/tools/`
+- [Pandas Docs](https://pandas.pydata.org/docs/)
+- [NumPy Docs](https://numpy.org/doc/)
+- [PyPortfolioOpt](https://pyportfolioopt.readthedocs.io/)
+- [QuantStats](https://github.com/ranaroussi/quantstats)
+- [AkShare](https://akshare.readthedocs.io/)
-### Common Commands:
-- Run code: `python filename.py`
-- Install packages: `pip install package_name`
-- Check Python version: `python --version`
+### Related Guides
-### Remember:
-Every contribution helps! Even fixing a typo makes the project better. Welcome aboard! 🎉
+- [Contributing Guide](./CONTRIBUTING.md) - General workflow
+- [Rust Guide](./RUST_CONTRIBUTOR_GUIDE.md) - How Rust calls Python
+- [TypeScript Guide](./TYPESCRIPT_CONTRIBUTOR_GUIDE.md) - Frontend integration
---
-**Happy coding! 🚀**
+**Questions?** Open an issue on [GitHub](https://github.com/Fincept-Corporation/FinceptTerminal).
diff --git a/docs/RUST_CONTRIBUTOR_GUIDE.md b/docs/RUST_CONTRIBUTOR_GUIDE.md
index d070ecade..3320c991d 100644
--- a/docs/RUST_CONTRIBUTOR_GUIDE.md
+++ b/docs/RUST_CONTRIBUTOR_GUIDE.md
@@ -1,1046 +1,444 @@
-# Rust Developer Intern Guide
-## Fincept Terminal - Performance & Native Integration
+# Rust Contributor Guide
-Welcome to the Fincept Terminal Rust development team! This guide will help you contribute to building performance-critical features and native integrations, even if you're new to the project or Rust.
+This guide covers Rust/Tauri development for Fincept Terminal - 99 commands, WebSocket handlers, database operations, and Python integration.
----
-
-## 📋 Table of Contents
-
-1. [What You'll Be Building](#what-youll-be-building)
-2. [Getting Started](#getting-started)
-3. [Understanding the Architecture](#understanding-the-architecture)
-4. [Your First Contribution](#your-first-contribution)
-5. [Tauri Command Development](#tauri-command-development)
-6. [Performance Optimization](#performance-optimization)
-7. [Data Processing Modules](#data-processing-modules)
-8. [Native Integration](#native-integration)
-9. [Working with Python Scripts](#working-with-python-scripts)
-10. [Code Standards & Best Practices](#code-standards--best-practices)
-11. [Testing & Debugging](#testing--debugging)
-12. [Submitting Your Work](#submitting-your-work)
-13. [Resources & Learning](#resources--learning)
+> **Prerequisites**: Read the [Contributing Guide](./CONTRIBUTING.md) first for setup and workflow.
---
-## 🎯 What You'll Be Building
-
-As a Rust developer intern, your role focuses on **performance** and **native capabilities**:
-
-- **Tauri Commands** - Bridge between frontend (React) and backend (Rust)
-- **Data Processing** - High-performance calculations, parsing, transformations
-- **Native Integrations** - File I/O, system APIs, database operations
-- **Python Orchestration** - Execute Python scripts, manage processes
-- **Performance Optimization** - Optimize slow operations, reduce memory usage
-- **Concurrent Operations** - Async/await, parallel processing
-
-### Why Rust?
+## Table of Contents
-Rust provides:
-- **Speed** - Near C/C++ performance
-- **Safety** - Memory safety without garbage collection
-- **Concurrency** - Fearless parallel processing
-- **Small Binaries** - Desktop app stays lightweight (~15MB vs 500MB+ Electron)
+- [Overview](#overview)
+- [Project Structure](#project-structure)
+- [Command Categories](#command-categories)
+- [Tauri Commands](#tauri-commands)
+- [Python Integration](#python-integration)
+- [Database Operations](#database-operations)
+- [WebSocket Handlers](#websocket-handlers)
+- [Code Standards](#code-standards)
+- [Resources](#resources)
---
-## 🚀 Getting Started
-
-### Prerequisites
-
-You need:
-- **Rust** 1.70+ - https://www.rust-lang.org/tools/install
-- **Node.js** 18+ - For frontend development
-- **Git** - Version control
-- A **code editor** with Rust support (VS Code + rust-analyzer)
-- **Basic Rust knowledge** (ownership, borrowing, error handling)
-
-### Setup Instructions
-
-1. **Fork and Clone Repository**
-```bash
-# Fork on GitHub first, then:
-git clone https://github.com/YOUR_USERNAME/FinceptTerminal.git
-cd FinceptTerminal
-```
+## Overview
-2. **Navigate to Tauri Directory**
-```bash
-cd fincept-terminal-desktop/src-tauri
-```
+The Rust backend handles:
+- **99 Tauri commands** - Bridge between frontend and backend
+- **Python execution** - Running 119 analytics scripts
+- **Database** - SQLite operations via Tauri plugin
+- **WebSocket** - Real-time data streaming
+- **Native features** - File I/O, system APIs, performance
-3. **Install Rust Dependencies**
-```bash
-# Check Rust installation
-rustc --version
-cargo --version
-
-# Build project
-cargo build
-```
-
-4. **Install Node Dependencies** (from parent directory)
-```bash
-cd ..
-npm install
-```
-
-5. **Run Development Mode**
-```bash
-npm run tauri dev
-```
+**Related Guides:**
+- [TypeScript Guide](./TYPESCRIPT_CONTRIBUTOR_GUIDE.md) - Frontend that calls commands
+- [Python Guide](./PYTHON_CONTRIBUTOR_GUIDE.md) - Scripts executed by Rust
---
-## 🏗️ Understanding the Architecture
-
-### How Tauri Works
-
-```
-┌─────────────────────────────────────────┐
-│ Frontend (React/TypeScript) │
-│ │
-│ User clicks button → invoke('command') │
-└──────────────────┬──────────────────────┘
- │
- │ IPC (Inter-Process Communication)
- │
-┌──────────────────▼──────────────────────┐
-│ Backend (Rust/Tauri) │
-│ │
-│ #[tauri::command] │
-│ async fn command() -> Result<...> {} │
-│ │
-│ - File I/O │
-│ - Database operations │
-│ - Python script execution │
-│ - Heavy computations │
-└─────────────────────────────────────────┘
-```
-
-### Project Structure
+## Project Structure
```
src-tauri/
├── src/
-│ ├── main.rs # Entry point
-│ ├── lib.rs # Library setup, command registration
+│ ├── main.rs # Entry point
+│ ├── lib.rs # Main library (130K+ lines)
+│ ├── python.rs # Python runtime management
+│ ├── setup.rs # App initialization
+│ ├── paper_trading.rs # Paper trading system
│ │
-│ ├── commands/ # Tauri commands (YOUR WORK HERE)
-│ │ ├── mod.rs # Module exports
-│ │ └── market_data.rs # Market data commands
+│ ├── commands/ # 99 Tauri commands
+│ │ ├── mod.rs # Module exports
+│ │ │
+│ │ ├── # Analytics & Data
+│ │ ├── analytics.rs # Financial analytics
+│ │ ├── market_data.rs # Market data
+│ │ ├── technical_analysis.rs # Technical indicators
+│ │ ├── portfolio.rs # Portfolio management
+│ │ ├── quantstats.rs # Performance metrics
+│ │ │
+│ │ ├── # Trading
+│ │ ├── algo_trading.rs # Algorithmic trading (81K)
+│ │ ├── unified_trading.rs # Unified trading API
+│ │ ├── strategies.rs # Trading strategies
+│ │ ├── backtesting.rs # Strategy backtesting
+│ │ │
+│ │ ├── # AI & Agents
+│ │ ├── agents.rs # AI agents
+│ │ ├── ai_agents.rs # AI agent management
+│ │ ├── agent_streaming.rs # Streaming responses
+│ │ ├── ai_quant_lab.rs # AI/ML analytics
+│ │ ├── alpha_arena.rs # Alpha Arena
+│ │ │
+│ │ ├── # Data Sources
+│ │ ├── yfinance.rs # Yahoo Finance
+│ │ ├── databento.rs # Databento
+│ │ ├── akshare.rs # Chinese markets
+│ │ ├── fred.rs # Federal Reserve
+│ │ ├── imf.rs # IMF data
+│ │ ├── nasdaq.rs # NASDAQ
+│ │ ├── sec.rs # SEC filings
+│ │ ├── ecb.rs # European Central Bank
+│ │ ├── bis.rs # Bank for Intl Settlements
+│ │ ├── oecd.rs # OECD data
+│ │ └── ... # 50+ more data sources
+│ │ │
+│ │ ├── # Library Wrappers
+│ │ ├── pyportfolioopt.rs # Portfolio optimization
+│ │ ├── skfolio.rs # Scikit-portfolio
+│ │ ├── gluonts.rs # Time series
+│ │ ├── gs_quant.rs # GS Quant
+│ │ ├── talipp.rs # Technical indicators
+│ │ │
+│ │ ├── # Brokers
+│ │ ├── brokers/ # Broker integrations
+│ │ ├── broker_credentials.rs # Credential management
+│ │ │
+│ │ ├── # System
+│ │ ├── database.rs # Database operations
+│ │ ├── storage.rs # File storage
+│ │ ├── news.rs # News aggregation
+│ │ └── screener_commands.rs # Stock screener
│ │
-│ └── data_sources/ # Data processing modules
-│ ├── mod.rs
-│ └── yfinance.rs # yfinance integration
+│ ├── database/ # SQLite operations
+│ ├── services/ # Backend services
+│ ├── websocket/ # WebSocket handlers
+│ ├── data_sources/ # Data processing
+│ └── market_sim/ # Market simulation
│
-├── resources/ # Bundled resources
-│ └── scripts/ # Python scripts
-│ ├── yfinance_data.py
-│ └── polygon_data.py
+├── resources/
+│ └── scripts/ # 119 Python scripts
│
-├── Cargo.toml # Rust dependencies
-└── tauri.conf.json # Tauri configuration
-```
-
-### Key Dependencies (Cargo.toml)
-
-```toml
-[dependencies]
-tauri = { version = "2", features = [] }
-tauri-plugin-sql = { version = "2", features = ["sqlite"] }
-serde = { version = "1", features = ["derive"] }
-serde_json = "1"
-tokio = { version = "1", features = ["full"] }
-anyhow = "1.0"
-chrono = "0.4"
+├── Cargo.toml # Dependencies
+└── tauri.conf.json # Tauri configuration
```
---
-## 🎓 Your First Contribution
+## Command Categories
-Let's build your first Tauri command - a simple calculator that demonstrates Rust performance!
+### By Function
-### Step 1: Create Command Module
+| Category | Commands | Description |
+|----------|----------|-------------|
+| Analytics | 15+ | Financial calculations, metrics |
+| Trading | 10+ | Order management, strategies |
+| Data Sources | 50+ | External API integrations |
+| AI/Agents | 8+ | LLM and agent commands |
+| Portfolio | 10+ | Portfolio optimization |
+| Database | 5+ | CRUD operations |
+| System | 10+ | File, storage, news |
-Create `src/commands/calculator.rs`:
-
-```rust
-use tauri::command;
+### By Size (Lines of Code)
-/// Calculate moving average of a price series
-/// This demonstrates Rust's performance for numerical computations
-#[command]
-pub fn calculate_moving_average(prices: Vec<f64>, window: usize) -> Result<Vec<f64>, String> {
- // Validate inputs
- if prices.is_empty() {
- return Err("Price array is empty".to_string());
- }
+| Command File | Lines | Purpose |
+|--------------|-------|---------|
+| `algo_trading.rs` | 81K | Algorithmic trading |
+| `bis.rs` | 32K | BIS data |
+| `databento.rs` | 29K | Market data |
+| `agents.rs` | 25K | AI agents |
+| `analytics.rs` | 22K | Financial analytics |
+| `unified_trading.rs` | 25K | Trading API |
- if window == 0 || window > prices.len() {
- return Err(format!(
- "Invalid window size: {}. Must be between 1 and {}",
- window,
- prices.len()
- ));
- }
-
- // Calculate moving averages
- let mut result = Vec::new();
-
- for i in 0..=(prices.len() - window) {
- let window_slice = &prices[i..i + window];
- let sum: f64 = window_slice.iter().sum();
- let avg = sum / window as f64;
- result.push(avg);
- }
-
- Ok(result)
-}
-
-/// Calculate Relative Strength Index (RSI)
-#[command]
-pub fn calculate_rsi(prices: Vec<f64>, period: usize) -> Result<Vec<f64>, String> {
- if prices.len() < period + 1 {
- return Err("Not enough data points for RSI calculation".to_string());
- }
-
- let mut gains = Vec::new();
- let mut losses = Vec::new();
-
- // Calculate price changes
- for i in 1..prices.len() {
- let change = prices[i] - prices[i - 1];
- if change > 0.0 {
- gains.push(change);
- losses.push(0.0);
- } else {
- gains.push(0.0);
- losses.push(change.abs());
- }
- }
-
- // Calculate RSI values
- let mut rsi_values = Vec::new();
-
- for i in period..gains.len() {
- let avg_gain: f64 = gains[i - period..i].iter().sum::<f64>() / period as f64;
- let avg_loss: f64 = losses[i - period..i].iter().sum::<f64>() / period as f64;
-
- let rs = if avg_loss == 0.0 {
- 100.0
- } else {
- avg_gain / avg_loss
- };
-
- let rsi = 100.0 - (100.0 / (1.0 + rs));
- rsi_values.push(rsi);
- }
-
- Ok(rsi_values)
-}
-
-/// Batch process multiple symbols' data
-#[command]
-pub async fn batch_process_data(
- symbols: Vec<String>,
- operation: String,
-) -> Result<Vec<String>, String> {
- // Use Tokio for async operations
- let mut results = Vec::new();
-
- for symbol in symbols {
- let result = format!("Processed {} with operation: {}", symbol, operation);
- results.push(result);
-
- // Simulate async work
- tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
- }
-
- Ok(results)
-}
-```
+---
-### Step 2: Register Commands
+## Tauri Commands
-Update `src/commands/mod.rs`:
+### Basic Command
```rust
-pub mod calculator;
-pub mod market_data; // Existing module
-
-// Re-export
-pub use calculator::*;
-pub use market_data::*;
-```
-
-Update `src/lib.rs`:
+use tauri::command;
-```rust
-mod commands;
-
-#[cfg_attr(mobile, tauri::mobile_entry_point)]
-pub fn run() {
- tauri::Builder::default()
- .invoke_handler(tauri::generate_handler![
- // Existing commands...
- commands::calculate_moving_average,
- commands::calculate_rsi,
- commands::batch_process_data,
- ])
- .run(tauri::generate_context!())
- .expect("error while running tauri application");
+#[command]
+pub fn greet(name: String) -> String {
+ format!("Hello, {}!", name)
}
```
-### Step 3: Test Your Command
-
-Build and run:
-
-```bash
-cargo build
-npm run tauri dev
-```
-
-Call from frontend (React):
-
-```typescript
-import { invoke } from '@tauri-apps/api/core';
-
-// Test moving average
-const prices = [100, 102, 101, 105, 107, 103, 108];
-const result = await invoke<number[]>('calculate_moving_average', {
- prices,
- window: 3
-});
-
-console.log('Moving Average:', result);
-// Output: [101.0, 102.67, 104.33, 105.0, 106.0]
-
-// Test RSI
-const rsi = await invoke<number[]>('calculate_rsi', {
- prices,
- period: 5
-});
-
-console.log('RSI:', rsi);
-```
-
----
-
-## 📚 Tauri Command Development
-
-### Command Anatomy
+### Command with Structured Types
```rust
-use tauri::command;
-use serde::{Serialize, Deserialize};
-
-// Define request/response types
-#[derive(Deserialize)]
-pub struct CalculateRequest {
- pub data: Vec<f64>,
- pub options: CalculationOptions,
-}
+use serde::{Deserialize, Serialize};
#[derive(Deserialize)]
-pub struct CalculationOptions {
- pub method: String,
- pub window: usize,
+pub struct PortfolioRequest {
+ pub symbols: Vec<String>,
+ pub weights: Option<Vec<f64>>,
+ pub optimize: bool,
}
#[derive(Serialize)]
-pub struct CalculateResponse {
- pub success: bool,
- pub result: Vec<f64>,
- pub metadata: Metadata,
+pub struct PortfolioResponse {
+ pub weights: Vec<f64>,
+ pub expected_return: f64,
+ pub volatility: f64,
+ pub sharpe_ratio: f64,
}
-#[derive(Serialize)]
-pub struct Metadata {
- pub calculation_time_ms: u64,
- pub data_points: usize,
-}
-
-/// Advanced calculation command with structured types
#[command]
-pub async fn advanced_calculate(
- request: CalculateRequest
-) -> Result<CalculateResponse, String> {
- let start = std::time::Instant::now();
-
- // Perform calculation
- let result = match request.options.method.as_str() {
- "sma" => calculate_sma(&request.data, request.options.window),
- "ema" => calculate_ema(&request.data, request.options.window),
- _ => return Err("Unknown calculation method".to_string()),
- }?;
-
- let elapsed = start.elapsed().as_millis() as u64;
-
- Ok(CalculateResponse {
- success: true,
- result,
- metadata: Metadata {
- calculation_time_ms: elapsed,
- data_points: request.data.len(),
- },
- })
-}
+pub async fn optimize_portfolio(
+ request: PortfolioRequest
+) -> Result<PortfolioResponse, String> {
+ // Validation
+ if request.symbols.is_empty() {
+ return Err("No symbols provided".to_string());
+ }
-// Helper functions
-fn calculate_sma(data: &[f64], window: usize) -> Result<Vec<f64>, String> {
- // Implementation
- Ok(vec![])
-}
+ // Call Python script
+ let result = run_python_script(
+ "Analytics/portfolioManagement/optimize.py",
+ &serde_json::to_string(&request).unwrap()
+ ).await?;
-fn calculate_ema(data: &[f64], window: usize) -> Result<Vec<f64>, String> {
- // Implementation
- Ok(vec![])
+ Ok(serde_json::from_str(&result).map_err(|e| e.to_string())?)
}
```
-### Async Commands
+### Async Command
```rust
-use tokio::fs;
-
-#[command]
-pub async fn read_large_file(path: String) -> Result<String, String> {
- // Async file reading (non-blocking)
- let content = fs::read_to_string(&path)
- .await
- .map_err(|e| e.to_string())?;
-
- Ok(content)
-}
-
#[command]
-pub async fn parallel_fetch(urls: Vec<String>) -> Result<Vec<String>, String> {
- let mut handles = vec![];
-
- for url in urls {
- let handle = tokio::spawn(async move {
- // Fetch from URL
- format!("Data from {}", url)
- });
- handles.push(handle);
- }
+pub async fn fetch_market_data(
+ symbols: Vec<String>
+) -> Result<Vec<Quote>, String> {
+ let mut results = Vec::new();
- // Wait for all to complete
- let mut results = vec![];
- for handle in handles {
- let result = handle.await.map_err(|e| e.to_string())?;
- results.push(result);
+ for symbol in symbols {
+ let quote = fetch_quote(&symbol).await?;
+ results.push(quote);
}
Ok(results)
}
```
-### Error Handling
+### Registering Commands
-```rust
-use anyhow::{Result, Context};
-
-#[command]
-pub fn robust_command(input: String) -> Result<String, String> {
- // Use anyhow for better error handling
- let result = process_input(&input)
- .context("Failed to process input")
- .map_err(|e| e.to_string())?;
+In `lib.rs`:
- Ok(result)
-}
-
-fn process_input(input: &str) -> Result<String> {
- if input.is_empty() {
- anyhow::bail!("Input cannot be empty");
- }
-
- // Processing logic
- Ok(input.to_uppercase())
-}
+```rust
+tauri::Builder::default()
+ .invoke_handler(tauri::generate_handler![
+ commands::greet,
+ commands::optimize_portfolio,
+ commands::fetch_market_data,
+ // ... 96 more commands
+ ])
```
---
-## ⚡ Performance Optimization
+## Python Integration
-### Parallel Processing
+### Execute Python Script
```rust
-use rayon::prelude::*;
-
-#[command]
-pub fn process_large_dataset(data: Vec<f64>) -> Result<Vec<f64>, String> {
- // Use Rayon for parallel iteration
- let results: Vec<f64> = data
- .par_iter() // Parallel iterator
- .map(|&x| {
- // Heavy computation per item
- expensive_calculation(x)
- })
- .collect();
-
- Ok(results)
-}
-
-fn expensive_calculation(value: f64) -> f64 {
- // Simulate expensive operation
- (0..1000).fold(value, |acc, _| acc * 1.001)
-}
-```
+use std::process::Command;
-### Memory Optimization
+pub async fn run_python_script(
+ script: &str,
+ args: &str
+) -> Result<String, String> {
+ let script_path = format!("resources/scripts/{}", script);
-```rust
-#[command]
-pub fn process_streaming_data(chunk_size: usize) -> Result<usize, String> {
- let mut count = 0;
+ let output = Command::new("python")
+ .arg(&script_path)
+ .arg(args)
+ .output()
+ .map_err(|e| format!("Failed to execute: {}", e))?;
- // Process in chunks instead of loading all at once
- for chunk in (0..1_000_000).collect::<Vec<_>>().chunks(chunk_size) {
- count += chunk.len();
- // Process chunk
+ if !output.status.success() {
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ return Err(format!("Script error: {}", stderr));
}
- Ok(count)
+ Ok(String::from_utf8_lossy(&output.stdout).to_string())
}
```
-### Caching with Lazy Static
+### Parse JSON Response
```rust
-use std::sync::Mutex;
-use lazy_static::lazy_static;
-use std::collections::HashMap;
-
-lazy_static! {
- static ref CACHE: Mutex<HashMap<String, String>> = Mutex::new(HashMap::new());
+#[derive(Deserialize)]
+struct PythonResponse<T> {
+ success: bool,
+ data: Option<T>,
+ error: Option<String>,
}
-#[command]
-pub fn cached_fetch(key: String) -> Result<String, String> {
- let mut cache = CACHE.lock().unwrap();
-
- // Check cache first
- if let Some(value) = cache.get(&key) {
- return Ok(value.clone());
- }
-
- // Expensive fetch
- let value = expensive_fetch(&key)?;
-
- // Cache result
- cache.insert(key, value.clone());
+pub async fn call_analytics<T: DeserializeOwned>(
+ script: &str,
+ args: &str
+) -> Result<T, String> {
+ let output = run_python_script(script, args).await?;
- Ok(value)
-}
+ let response: PythonResponse<T> = serde_json::from_str(&output)
+ .map_err(|e| format!("JSON parse error: {}", e))?;
-fn expensive_fetch(key: &str) -> Result<String, String> {
- // Simulate expensive operation
- std::thread::sleep(std::time::Duration::from_secs(1));
- Ok(format!("Data for {}", key))
+ if response.success {
+ response.data.ok_or("No data returned".to_string())
+ } else {
+ Err(response.error.unwrap_or("Unknown error".to_string()))
+ }
}
```
---
-## 🔧 Data Processing Modules
+## Database Operations
-### Time Series Analysis
+### SQLite via Tauri Plugin
```rust
-use chrono::{DateTime, Utc};
-use serde::{Deserialize, Serialize};
-
-#[derive(Debug, Serialize, Deserialize)]
-pub struct Candle {
- pub timestamp: i64,
- pub open: f64,
- pub high: f64,
- pub low: f64,
- pub close: f64,
- pub volume: u64,
-}
-
-pub struct TimeSeriesProcessor;
-
-impl TimeSeriesProcessor {
- /// Resample candles to different timeframe
- pub fn resample(candles: Vec<Candle>, target_period: u64) -> Vec<Candle> {
- // Group by target period and aggregate
- let mut result = Vec::new();
-
- // Implementation...
-
- result
+use tauri_plugin_sql::{Migration, MigrationKind};
+
+// Define migrations
+let migrations = vec![
+ Migration {
+ version: 1,
+ description: "create watchlist",
+ sql: "CREATE TABLE watchlist (
+ id INTEGER PRIMARY KEY,
+ symbol TEXT NOT NULL,
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP
+ )",
+ kind: MigrationKind::Up,
}
-
- /// Detect outliers using Z-score
- pub fn detect_outliers(data: &[f64], threshold: f64) -> Vec<usize> {
- let mean = data.iter().sum::<f64>() / data.len() as f64;
- let variance = data.iter()
- .map(|&x| (x - mean).powi(2))
- .sum::<f64>() / data.len() as f64;
- let std_dev = variance.sqrt();
-
- data.iter()
- .enumerate()
- .filter(|(_, &value)| {
- ((value - mean) / std_dev).abs() > threshold
- })
- .map(|(i, _)| i)
- .collect()
- }
-
- /// Calculate Bollinger Bands
- pub fn bollinger_bands(
- prices: &[f64],
- period: usize,
- std_multiplier: f64,
- ) -> Result<(Vec<f64>, Vec<f64>, Vec<f64>), String> {
- if prices.len() < period {
- return Err("Not enough data".to_string());
- }
-
- let mut upper = Vec::new();
- let mut middle = Vec::new();
- let mut lower = Vec::new();
-
- for i in period - 1..prices.len() {
- let window = &prices[i - period + 1..=i];
- let mean = window.iter().sum::<f64>() / period as f64;
-
- let variance = window.iter()
- .map(|&x| (x - mean).powi(2))
- .sum::<f64>() / period as f64;
- let std_dev = variance.sqrt();
-
- middle.push(mean);
- upper.push(mean + std_multiplier * std_dev);
- lower.push(mean - std_multiplier * std_dev);
- }
-
- Ok((upper, middle, lower))
- }
-}
+];
```
-### CSV/JSON Parsing
+### Database Commands
```rust
-use serde_json::Value;
-use std::fs::File;
-use std::io::BufReader;
-
#[command]
-pub fn parse_financial_json(path: String) -> Result<Vec<FinancialRecord>, String> {
- let file = File::open(&path).map_err(|e| e.to_string())?;
- let reader = BufReader::new(file);
-
- let data: Value = serde_json::from_reader(reader)
- .map_err(|e| e.to_string())?;
-
- // Parse into structured format
- let records = data["data"]
- .as_array()
- .ok_or("Invalid JSON structure")?
- .iter()
- .filter_map(|item| {
- Some(FinancialRecord {
- symbol: item["symbol"].as_str()?.to_string(),
- price: item["price"].as_f64()?,
- volume: item["volume"].as_u64()?,
- })
- })
- .collect();
-
- Ok(records)
-}
+pub async fn save_watchlist(
+ app: tauri::AppHandle,
+ symbols: Vec<String>
+) -> Result<(), String> {
+ let db = app.state::<Database>();
-#[derive(Serialize)]
-struct FinancialRecord {
- symbol: String,
- price: f64,
- volume: u64,
-}
-```
-
----
-
-## 🐍 Working with Python Scripts
-
-### Execute Python Script
-
-```rust
-use std::process::Command;
-
-#[command]
-pub async fn fetch_yfinance_quote(symbol: String) -> Result<String, String> {
- // Path to Python script
- let script_path = "resources/scripts/yfinance_data.py";
-
- // Execute Python script
- let output = Command::new("python")
- .arg(script_path)
- .arg("quote")
- .arg(&symbol)
- .output()
- .map_err(|e| format!("Failed to execute Python: {}", e))?;
-
- // Check if command succeeded
- if !output.status.success() {
- let stderr = String::from_utf8_lossy(&output.stderr);
- return Err(format!("Python script error: {}", stderr));
+ for symbol in symbols {
+ sqlx::query("INSERT INTO watchlist (symbol) VALUES (?)")
+ .bind(&symbol)
+ .execute(&db.pool)
+ .await
+ .map_err(|e| e.to_string())?;
}
- // Parse stdout as JSON
- let stdout = String::from_utf8_lossy(&output.stdout);
- Ok(stdout.to_string())
+ Ok(())
}
```
-### Async Python Execution
-
-```rust
-use tokio::process::Command as TokioCommand;
+---
-#[command]
-pub async fn async_fetch_data(symbols: Vec<String>) -> Result<Vec<String>, String> {
- let mut handles = vec![];
+## WebSocket Handlers
- for symbol in symbols {
- let handle = tokio::spawn(async move {
- let output = TokioCommand::new("python")
- .arg("resources/scripts/yfinance_data.py")
- .arg("quote")
- .arg(&symbol)
- .output()
- .await
- .map_err(|e| e.to_string())?;
-
- let stdout = String::from_utf8_lossy(&output.stdout);
- Ok::<String, String>(stdout.to_string())
- });
-
- handles.push(handle);
- }
+### WebSocket Server
- // Wait for all
- let mut results = vec![];
- for handle in handles {
- let result = handle.await.map_err(|e| e.to_string())??;
- results.push(result);
+```rust
+// src/websocket/mod.rs
+use tokio_tungstenite::tungstenite::Message;
+
+pub async fn handle_websocket(
+ ws_stream: WebSocketStream<TcpStream>
+) {
+ let (mut write, mut read) = ws_stream.split();
+
+ while let Some(msg) = read.next().await {
+ match msg {
+ Ok(Message::Text(text)) => {
+ // Handle message
+ let response = process_message(&text).await;
+ write.send(Message::Text(response)).await.ok();
+ }
+ Ok(Message::Close(_)) => break,
+ _ => {}
+ }
}
-
- Ok(results)
}
```
---
-## ✅ Code Standards & Best Practices
+## Code Standards
### Error Handling
```rust
-// ✅ GOOD - Use Result types
+// ✅ Good - Use Result
#[command]
pub fn safe_operation(input: String) -> Result<String, String> {
if input.is_empty() {
return Err("Input cannot be empty".to_string());
}
-
Ok(input.to_uppercase())
}
-// ❌ BAD - Don't panic in commands
+// ❌ Bad - Never panic in commands
#[command]
-pub fn unsafe_operation(input: String) -> String {
+pub fn bad_operation(input: String) -> String {
if input.is_empty() {
- panic!("Input is empty!"); // NEVER DO THIS
+ panic!("Empty!"); // Never do this
}
- input.to_uppercase()
-}
-```
-
-### Ownership & Borrowing
-
-```rust
-// ✅ GOOD - Borrow when possible
-fn process_data(data: &[f64]) -> f64 {
- data.iter().sum()
-}
-
-// ❌ BAD - Unnecessary ownership transfer
-fn process_data_bad(data: Vec<f64>) -> f64 {
- data.iter().sum() // Consumes data
+ input
}
```
### Type Safety
```rust
-// ✅ GOOD - Strong typing
+// ✅ Good - Strong typing
#[derive(Deserialize)]
-pub struct StockRequest {
+pub struct Request {
pub symbol: String,
- pub start_date: String,
- pub end_date: String,
-}
-
-#[command]
-pub fn fetch_stock(request: StockRequest) -> Result<String, String> {
- // Type-safe!
- Ok(format!("Fetching {}", request.symbol))
-}
-
-// ❌ BAD - Weak typing
-#[command]
-pub fn fetch_stock_bad(symbol: String, dates: String) -> Result<String, String> {
- // Have to parse dates from string
- Ok(symbol)
+ pub period: String,
}
-```
-
-### Documentation
-
-```rust
-/// Calculate the Simple Moving Average (SMA) for a price series
-///
-/// # Arguments
-///
-/// * `prices` - Vector of price data points
-/// * `window` - Size of the moving window
-///
-/// # Returns
-///
-/// Vector of SMA values, or error if window is invalid
-///
-/// # Example
-///
-/// ```
-/// let prices = vec![100.0, 102.0, 101.0, 105.0];
-/// let sma = calculate_sma(prices, 2)?;
-/// ```
-#[command]
-pub fn calculate_sma(prices: Vec<f64>, window: usize) -> Result<Vec<f64>, String> {
- // Implementation
- Ok(vec![])
-}
-```
-
----
-
-## 🧪 Testing & Debugging
-
-### Unit Tests
-
-```rust
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn test_moving_average() {
- let prices = vec![100.0, 102.0, 104.0, 106.0];
- let result = calculate_moving_average(prices, 2).unwrap();
-
- assert_eq!(result.len(), 3);
- assert_eq!(result[0], 101.0);
- assert_eq!(result[1], 103.0);
- assert_eq!(result[2], 105.0);
- }
-
- #[test]
- fn test_empty_input() {
- let prices = vec![];
- let result = calculate_moving_average(prices, 2);
-
- assert!(result.is_err());
- }
-
- #[test]
- fn test_invalid_window() {
- let prices = vec![100.0, 102.0];
- let result = calculate_moving_average(prices, 5);
- assert!(result.is_err());
- }
-}
-```
-
-### Running Tests
-
-```bash
-# Run all tests
-cargo test
-
-# Run specific test
-cargo test test_moving_average
-
-# Run tests with output
-cargo test -- --nocapture
-```
-
-### Debugging
-
-```rust
-// Add debug prints
-#[command]
-pub fn debug_command(input: String) -> Result<String, String> {
- eprintln!("DEBUG: Input received: {}", input);
-
- let result = process(&input)?;
-
- eprintln!("DEBUG: Result: {}", result);
-
- Ok(result)
-}
+// ❌ Bad - Weak typing
+pub fn bad_fn(data: String) -> String { ... }
```
-### Benchmarking
-
-```rust
-use std::time::Instant;
-
-#[command]
-pub fn benchmark_operation() -> Result<String, String> {
- let data = vec![1.0; 1_000_000];
-
- let start = Instant::now();
- let result = heavy_computation(&data);
- let elapsed = start.elapsed();
-
- Ok(format!(
- "Processed {} items in {:?}",
- result.len(),
- elapsed
- ))
-}
-```
-
----
-
-## 🚀 Submitting Your Work
-
### Pre-Submission Checklist
-- [ ] Code compiles without warnings (`cargo build`)
-- [ ] All tests pass (`cargo test`)
-- [ ] Code is formatted (`cargo fmt`)
-- [ ] No clippy warnings (`cargo clippy`)
-- [ ] Documentation added
-- [ ] Error handling implemented
-- [ ] Tested in Tauri app (`npm run tauri dev`)
-
-### Formatting & Linting
-
-```bash
-# Format code
-cargo fmt
-
-# Check for issues
-cargo clippy
-
-# Fix auto-fixable issues
-cargo clippy --fix
-```
-
-### Creating Pull Request
-
```bash
-# Create branch
-git checkout -b feature/rsi-calculator
-
-# Commit
-git add src/commands/calculator.rs
-git commit -m "Add RSI calculator command
-
-- Implement RSI calculation
-- Add unit tests
-- Optimize for large datasets
-- Async processing support"
-
-# Push
-git push origin feature/rsi-calculator
+cargo build # Compiles
+cargo test # Tests pass
+cargo fmt # Formatted
+cargo clippy # No warnings
```
---
-## 📖 Resources & Learning
+## Resources
### Rust Learning
-**Basics:**
-- The Rust Book: https://doc.rust-lang.org/book/
-- Rust by Example: https://doc.rust-lang.org/rust-by-example/
-- Rustlings Exercises: https://github.com/rust-lang/rustlings
-
-**Advanced:**
-- Async Rust: https://rust-lang.github.io/async-book/
-- Performance Book: https://nnethercote.github.io/perf-book/
-
-### Tauri Specific
-
-- Tauri Docs: https://tauri.app/
-- Command System: https://tauri.app/v1/guides/features/command/
-- Async Commands: https://tauri.app/v1/guides/features/command/#async-commands
-
-### Performance
-
-- Rayon (parallelism): https://docs.rs/rayon/
-- Tokio (async): https://tokio.rs/
-- Serde (serialization): https://serde.rs/
+- [The Rust Book](https://doc.rust-lang.org/book/)
+- [Rust by Example](https://doc.rust-lang.org/rust-by-example/)
+- [Async Rust](https://rust-lang.github.io/async-book/)
-### Project Code
+### Tauri Documentation
-Study existing files:
-- `src/lib.rs` - Command registration
-- `src/commands/market_data.rs` - Example commands
-- `Cargo.toml` - Dependencies
-
----
-
-## 💡 Project Ideas
-
-### Beginner (Week 1-2)
-- Add simple calculation commands
-- Implement data validation
-- Create utility functions
-- Write unit tests
-
-### Intermediate (Week 3-6)
-- Build data processing modules
-- Optimize existing code
-- Add SQLite database integration
-- Create file I/O commands
-
-### Advanced (Week 7+)
-- Multi-threaded data processing
-- WebSocket server for real-time data
-- Custom technical indicators
-- Performance profiling & optimization
-
----
+- [Tauri v2 Docs](https://tauri.app/v2/)
+- [Command System](https://tauri.app/v2/guides/features/command/)
+- [Plugin System](https://tauri.app/v2/guides/plugins/)
-## 🎉 Final Words
+### Key Crates
-Welcome to Rust development at Fincept Terminal! Your work on performance and native capabilities is crucial for making this the fastest financial terminal available.
+| Crate | Purpose |
+|-------|---------|
+| `tauri` | Desktop framework |
+| `serde` | Serialization |
+| `tokio` | Async runtime |
+| `reqwest` | HTTP client |
+| `sqlx` | Database |
+| `anyhow` | Error handling |
-**Remember:**
-- Safety first - use Result types
-- Performance matters - profile before optimizing
-- Test thoroughly
-- Document well
-- Ask questions when stuck
+### Related Guides
-Your contributions make Fincept Terminal blazingly fast! 🚀
+- [Contributing Guide](./CONTRIBUTING.md) - General workflow
+- [TypeScript Guide](./TYPESCRIPT_CONTRIBUTOR_GUIDE.md) - Frontend
+- [Python Guide](./PYTHON_CONTRIBUTOR_GUIDE.md) - Analytics scripts
---
-**Repository**: https://github.com/Fincept-Corporation/FinceptTerminal/
-**Contact**: [email protected]
+**Questions?** Open an issue on [GitHub](https://github.com/Fincept-Corporation/FinceptTerminal).
diff --git a/docs/TRADEMARK.md b/docs/TRADEMARK.md
deleted file mode 100644
index b45a360b6..000000000
--- a/docs/TRADEMARK.md
+++ /dev/null
@@ -1,338 +0,0 @@
-# Trademark Notice and Usage Guidelines
-
-## Registered Trademarks
-
-The following names, logos, and marks are trademarks of **Fincept Corporation**:
-
-- **"Fincept Terminal"** (Word Mark)
-- **"Fincept"** (Word Mark)
-- **Fincept Logo** (Design Mark)
-- **Fincept Terminal Logo** (Design Mark)
-
-**All rights reserved.** These trademarks are protected under applicable trademark laws.
-
----
-
-## Trademark Registration Status
-
-| Mark | Status | Registration Number | Jurisdiction |
-|------|--------|---------------------|--------------|
-| Fincept Terminal | Pending | TBD | United States |
-| Fincept | Pending | TBD | United States |
-| Fincept Logo | Pending | TBD | United States |
-| Fincept Terminal Logo | Pending | TBD | United States |
-
-**Note**: Trademark applications are in process. Common law trademark rights are asserted for all marks.
-
----
-
-## Permitted Use
-
-### ✅ You MAY Use Fincept Trademarks:
-
-#### 1. **Attribution and Compliance**
- - When required to comply with AGPL-3.0 license attribution requirements
- - In unmodified form to indicate the origin of the software
- - Example: "Powered by Fincept Terminal" or "Based on Fincept Terminal"
-
-#### 2. **Factual References**
- - In blog posts, articles, or documentation describing Fincept Terminal
- - In comparative analysis or reviews (must be factual and not misleading)
- - Example: "Our platform integrates with Fincept Terminal"
-
-#### 3. **Community & Educational Use**
- - In user groups, meetups, or educational workshops
- - In tutorials, guides, or training materials
- - Example: "Fincept Terminal User Group - San Francisco"
-
-#### 4. **Link References**
- - When linking to official Fincept Terminal resources
- - In README files pointing to the official repository
- - Example: "Fork of [Fincept Terminal](https://github.com/Fincept-Corporation/FinceptTerminal)"
-
----
-
-## Prohibited Use
-
-### ❌ You MAY NOT Use Fincept Trademarks:
-
-#### 1. **In Product Names or Branding**
- - Naming derivative works "Fincept [X]" or "[X] Fincept"
- - Using "Fincept" in company names without permission
- - Examples of prohibited names:
- - ❌ "Fincept Pro"
- - ❌ "Fincept Analytics"
- - ❌ "MyFincept Terminal"
- - ❌ "Fincept Cloud Services"
-
-#### 2. **Implying Endorsement**
- - Suggesting official approval or partnership without agreement
- - Using trademarks in a way that implies sponsorship
- - Example: ❌ "Official Fincept Consulting Services"
-
-#### 3. **Confusingly Similar Marks**
- - Creating logos or branding that resembles Fincept marks
- - Using variations like "Finsept", "Fincet", "Phincept"
- - Mimicking Fincept's trade dress or visual identity
-
-#### 4. **Commercial Exploitation**
- - Selling merchandise with Fincept branding without license
- - Using marks to promote competing products
- - White-labeling without commercial license
-
-#### 5. **Disparaging Use**
- - Using trademarks in connection with unlawful activities
- - Modifying logos in offensive or misleading ways
- - Associating marks with harmful or unethical content
-
----
-
-## Naming Guidelines for Derivative Works
-
-If you create a modified version or fork of Fincept Terminal, you must:
-
-### 1. **Choose a Distinct Name**
- Your project name should:
- - Be clearly different from "Fincept Terminal" or "Fincept"
- - Not suggest official endorsement
- - Not create confusion in the marketplace
-
- **Good Examples:**
- - ✅ "QuantTerminal" (based on Fincept Terminal)
- - ✅ "TradeDesk Pro" (fork of Fincept Terminal)
- - ✅ "AlphaAnalyzer" (powered by Fincept Terminal)
-
- **Bad Examples:**
- - ❌ "Fincept Community Edition"
- - ❌ "Fincept Terminal Plus"
- - ❌ "Fincept Terminal Lite"
-
-### 2. **Provide Clear Attribution**
- Include a notice in your documentation:
- ```
- This software is based on Fincept Terminal
- (https://github.com/Fincept-Corporation/FinceptTerminal)
- developed by Fincept Corporation.
-
- [Your Project Name] is not affiliated with, endorsed by,
- or sponsored by Fincept Corporation.
- ```
-
-### 3. **Use Distinctive Visual Identity**
- - Create your own logo and color scheme
- - Do not copy or closely imitate Fincept's visual design
- - Ensure users can easily distinguish your product
-
----
-
-## Logo Usage Guidelines
-
-If you have permission to use the Fincept logo (e.g., as a partner or contributor):
-
-### Specifications
-
-1. **Minimum Size**
- - Print: 0.5 inches (12.7mm) width minimum
- - Digital: 120px width minimum
-
-2. **Clear Space**
- - Maintain clear space equal to the height of the "F" in Fincept
- - No text, graphics, or other elements in this zone
-
-3. **Color Variants**
- - Primary: Full color on white background
- - Secondary: White logo on dark background
- - Tertiary: Black logo on light background
-
-4. **Prohibited Modifications**
- - ❌ Do not rotate, skew, or distort
- - ❌ Do not change colors or add effects
- - ❌ Do not recreate or redraw
- - ❌ Do not use outdated versions
-
-### Download Official Assets
-
-Authorized partners can download official logos at:
-**https://fincept.in/brand-assets** (requires login)
-
----
-
-## Commercial Trademark License
-
-### When You Need a Trademark License
-
-You need explicit permission to use Fincept trademarks for:
-
-- **White-Label Solutions**: Rebranding Fincept Terminal for clients
-- **Partnership Marketing**: Co-marketing materials featuring Fincept
-- **Merchandise**: T-shirts, stickers, or promotional items
-- **Domain Names**: Registering domains containing "Fincept"
-- **App Store Listings**: Publishing apps that include "Fincept" in the name
-
-### How to Obtain Permission
-
-Contact **[email protected]** with:
-- Proposed use case and duration
-- Mock-ups or examples of intended usage
-- Audience reach and distribution channels
-- Company background and credentials
-
-We typically respond within 5-7 business days.
-
----
-
-## Partner Program
-
-### Official Partner Benefits
-
-Approved partners receive:
-
-1. **Trademark License**
- - Right to use "Fincept Partner" badge
- - Co-marketing permissions
- - Logo usage rights
-
-2. **Marketing Support**
- - Listing in partner directory
- - Social media promotion
- - Joint press releases
-
-3. **Technical Benefits**
- - Priority support
- - Early access to features
- - Technical collaboration
-
-### Partner Tiers
-
-- **Technology Partners**: Integration and API partners
-- **Solution Partners**: Consulting and implementation firms
-- **Resale Partners**: Distributors and OEMs
-- **Community Partners**: User groups and education providers
-
-Apply at: **https://fincept.in/partners**
-
----
-
-## Contributor Recognition
-
-### Open Source Contributors
-
-Active contributors (10+ merged PRs) may:
-- Use "Fincept Terminal Contributor" badge
-- List contribution in portfolio/resume
-- Receive mention in project credits
-
-This does not grant trademark license for commercial use.
-
----
-
-## Enforcement
-
-### Reporting Violations
-
-If you encounter unauthorized use of Fincept trademarks:
-
-**Email**: [email protected]
-**Subject**: Trademark Violation Report
-
-Include:
-- URL or location of infringement
-- Description of unauthorized use
-- Screenshots or evidence
-- Your contact information
-
-### Our Response Process
-
-1. **Investigation** (5-7 business days)
- - Review reported usage
- - Determine if violation exists
- - Assess severity and impact
-
-2. **Notification** (if violation confirmed)
- - Contact infringing party
- - Request voluntary compliance
- - Provide 30-day cure period
-
-3. **Escalation** (if non-compliant)
- - Formal cease and desist notice
- - Legal action if necessary
- - Cooperation with hosting platforms
-
----
-
-## Domain Name Policy
-
-### Permitted Domains
-
-- **Official**: fincept.in, fincept.com, fincept.io (owned by Fincept Corporation)
-- **Community**: finceptterminal-[city].org (with prior approval)
-- **Personal**: yourname-fincept-tutorial.com (for tutorials/education)
-
-### Prohibited Domains
-
-- ❌ finceptpro.com
-- ❌ fincept-cloud.com
-- ❌ fincept-terminal.io (without permission)
-- ❌ fincept-trading.com
-
-If you registered a domain before these guidelines, contact us to discuss.
-
----
-
-## Social Media Handles
-
-### Official Accounts
-
-- Twitter: @FinceptTerminal
-- LinkedIn: Fincept Corporation
-- Discord: Fincept Terminal (official server)
-- GitHub: Fincept-Corporation
-
-### Community Accounts
-
-You may create community accounts with clear naming:
-- ✅ @FinceptTerminal_NYC (for local user group)
-- ✅ @FinceptTips (for tips/tutorials, must state "unofficial")
-
-You may NOT:
-- ❌ Impersonate official accounts
-- ❌ Use handles that suggest official status without disclosure
-
----
-
-## Updates to This Policy
-
-This trademark policy may be updated periodically. Changes will be:
-
-- Posted to this document with updated revision date
-- Announced on official channels
-- Applied prospectively (grace period for existing uses)
-
-**Last Updated**: January 5, 2026
-**Version**: 1.0
-**Effective Date**: January 5, 2026
-
----
-
-## Legal Disclaimer
-
-This document provides guidelines only and does not constitute legal advice. Fincept Corporation reserves all rights to its trademarks and may take action against unauthorized use. For specific legal questions, consult an attorney.
-
----
-
-## Contact Information
-
-**Trademark Inquiries**: [email protected]
-**Partnership Requests**: [email protected]
-**Violation Reports**: [email protected]
-**Legal Department**: [email protected]
-
-**Mailing Address**:
-Fincept Corporation
-[Address TBD]
-
----
-
-**© 2025 Fincept Corporation. All rights reserved.**
-
-For more information, visit: **https://fincept.in/trademark**
diff --git a/docs/TYPESCRIPT_CONTRIBUTOR_GUIDE.md b/docs/TYPESCRIPT_CONTRIBUTOR_GUIDE.md
index b2022474d..dcc209d83 100644
--- a/docs/TYPESCRIPT_CONTRIBUTOR_GUIDE.md
+++ b/docs/TYPESCRIPT_CONTRIBUTOR_GUIDE.md
@@ -1,1224 +1,475 @@
-# TypeScript/React Developer Intern Guide
-## Fincept Terminal - Building Financial UI & Features
+# TypeScript/React Contributor Guide
-Welcome to the Fincept Terminal TypeScript/React development team! This guide will help you contribute to building user interfaces and features for the financial terminal, even if you're new to the project.
+This guide covers frontend development for Fincept Terminal - 80 terminal tabs, 42 UI components, 35+ services, 12 contexts, and 8 hooks.
----
-
-## 📋 Table of Contents
-
-1. [What You'll Be Building](#what-youll-be-building)
-2. [Getting Started](#getting-started)
-3. [Understanding the Codebase](#understanding-the-codebase)
-4. [Your First Contribution](#your-first-contribution)
-5. [Component Development Guide](#component-development-guide)
-6. [Tab Development](#tab-development)
-7. [Working with APIs](#working-with-apis)
-8. [Bloomberg-Style UI Standards](#bloomberg-style-ui-standards)
-9. [State Management](#state-management)
-10. [Testing & Debugging](#testing--debugging)
-11. [Code Standards & Best Practices](#code-standards--best-practices)
-12. [Submitting Your Work](#submitting-your-work)
-13. [Resources & Learning](#resources--learning)
+> **Prerequisites**: Read the [Contributing Guide](./CONTRIBUTING.md) first for setup and workflow.
---
-## 🎯 What You'll Be Building
-
-As a TypeScript/React developer intern, you'll be creating:
-
-- **Financial Terminal Tabs** - Dashboard, Markets, Analysis, Charts, News, etc.
-- **UI Components** - Data tables, charts, forms, modals
-- **Real-time Data Displays** - Stock quotes, market indices, economic indicators
-- **Interactive Features** - Watchlists, alerts, portfolio tracking
-- **Data Visualization** - Charts, graphs, heatmaps
-- **Integration UIs** - API connectors, broker integrations, MCP servers
+## Table of Contents
-### The Vision
-
-You're building a **Bloomberg Terminal alternative** - a professional-grade financial analysis platform with:
-- Clean, terminal-style interface
-- Real-time data updates
-- Powerful analysis tools
-- AI-powered insights
-- All open source and free!
+- [Overview](#overview)
+- [Project Structure](#project-structure)
+- [Terminal Tabs](#terminal-tabs)
+- [Services](#services)
+- [Contexts & State](#contexts--state)
+- [Component Development](#component-development)
+- [Calling Rust Commands](#calling-rust-commands)
+- [Styling](#styling)
+- [Code Standards](#code-standards)
+- [Resources](#resources)
---
-## 🚀 Getting Started
-
-### Prerequisites
-
-You need:
-- **Node.js 18+** and **npm** installed
-- **Rust** (for Tauri) - https://www.rust-lang.org/tools/install
-- **Git** for version control
-- A **code editor** (VS Code recommended)
-- **Basic React/TypeScript knowledge**
-
-### Setup Instructions
+## Overview
-1. **Fork and Clone the Repository**
-```bash
-# Fork the repo on GitHub first, then:
-git clone https://github.com/YOUR_USERNAME/FinceptTerminal.git
-cd FinceptTerminal
-```
-
-2. **Navigate to the App Directory**
-```bash
-cd fincept-terminal-desktop
-```
-
-3. **Install Dependencies**
-```bash
-npm install
-```
-
-4. **Run Development Server**
-```bash
-# Option 1: Just frontend (hot reload, fast)
-npm run dev
-
-# Option 2: Full Tauri app (includes Rust backend)
-npm run tauri dev
-```
+The frontend provides:
+- **80 Terminal tabs** - Financial tools, analytics, trading
+- **42 UI components** - Reusable shadcn/ui components
+- **35+ Services** - API integrations, data fetching
+- **12 Contexts** - Global state management
+- **8 Custom hooks** - Reusable logic
-5. **Test the App**
-- Frontend will open at http://localhost:1420
-- Or Tauri window will launch
-- Try navigating through different tabs
-- Check browser console for errors
+**Related Guides:**
+- [Rust Guide](./RUST_CONTRIBUTOR_GUIDE.md) - Backend commands
+- [Python Guide](./PYTHON_CONTRIBUTOR_GUIDE.md) - Analytics scripts
---
-## 🏗️ Understanding the Codebase
-
-### Project Structure
+## Project Structure
```
-fincept-terminal-desktop/
-├── src/ # React frontend (YOUR WORK HERE)
-│ ├── main.tsx # App entry point
-│ ├── App.tsx # Root component
-│ │
-│ ├── components/
-│ │ ├── auth/ # Authentication screens
-│ │ │ ├── LoginScreen.tsx
-│ │ │ ├── RegisterScreen.tsx
-│ │ │ └── PricingScreen.tsx
-│ │ │
-│ │ ├── dashboard/ # Main terminal interface
-│ │ │ └── DashboardScreen.tsx # Bloomberg-style dashboard
-│ │ │
-│ │ ├── tabs/ # Financial terminal tabs
-│ │ │ ├── DashboardTab.tsx # Overview tab
-│ │ │ ├── MarketsTab.tsx # Live market data
-│ │ │ ├── ChatTab.tsx # AI chat
-│ │ │ ├── NewsTab.tsx
-│ │ │ ├── AnalyticsTab.tsx
-│ │ │ ├── agents/ # AI agent management
-│ │ │ ├── mcp/ # MCP marketplace
-│ │ │ └── data-sources/ # Data connectors
-│ │ │
-│ │ ├── ui/ # Reusable components
-│ │ │ ├── button.tsx
-│ │ │ ├── input.tsx
-│ │ │ ├── card.tsx
-│ │ │ ├── table.tsx
-│ │ │ └── ... (40+ components)
-│ │ │
-│ │ ├── common/ # Shared components
-│ │ │ ├── Header.tsx
-│ │ │ ├── Footer.tsx
-│ │ │ └── BackgroundPattern.tsx
-│ │ │
-│ │ ├── payment/ # Payment screens
-│ │ └── info/ # Legal/info pages
-│ │
-│ ├── contexts/ # React contexts
-│ │ └── AuthContext.tsx # Authentication state
-│ │
-│ ├── services/ # API services
-│ │ ├── authApi.tsx # Auth API calls
-│ │ ├── paymentApi.tsx # Payment API
-│ │ ├── forumApi.tsx # Forum API
-│ │ └── marketDataService.tsx # Market data
-│ │
-│ ├── hooks/ # Custom React hooks
-│ │ └── use-mobile.ts
+src/
+├── main.tsx # Entry point
+├── App.tsx # Root component, routing
+│
+├── components/
+│ ├── tabs/ # 80 terminal tabs
+│ │ ├── dashboard/ # Main dashboard
+│ │ ├── markets/ # Market data
+│ │ ├── portfolio-tab/ # Portfolio management
+│ │ ├── algo-trading/ # Algorithmic trading
+│ │ ├── ai-quant-lab/ # AI/ML analytics
+│ │ ├── crypto-trading/ # Cryptocurrency
+│ │ ├── derivatives/ # Options & futures
+│ │ ├── equity-research/ # Stock research
+│ │ ├── screener/ # Stock screener
+│ │ ├── geopolitics/ # Geopolitical analysis
+│ │ ├── economics/ # Economic data
+│ │ ├── chat/ # AI chat
+│ │ ├── node-editor/ # Visual workflows
+│ │ ├── strategies/ # Trading strategies
+│ │ ├── backtesting/ # Strategy testing
+│ │ ├── quantlib-*/ # 15+ QuantLib modules
+│ │ └── ... # 50+ more tabs
│ │
-│ ├── lib/ # Utilities
-│ │ └── utils.ts # Helper functions
+│ ├── ui/ # 42 UI components
+│ │ ├── button.tsx
+│ │ ├── card.tsx
+│ │ ├── table.tsx
+│ │ ├── dialog.tsx
+│ │ ├── dropdown-menu.tsx
+│ │ ├── tabs.tsx
+│ │ └── ...
│ │
-│ └── stockBrokers/ # Broker integrations
+│ ├── auth/ # Authentication
+│ ├── dashboard/ # Terminal shell
+│ ├── charts/ # Chart components
+│ ├── chat-mode/ # AI chat interface
+│ ├── command-bar/ # Command palette (cmdk)
+│ ├── settings/ # Settings screens
+│ ├── payment/ # Payment flow
+│ └── visualization/ # 3D visualizations
+│
+├── services/ # 35+ API services
+│ ├── analytics/ # Analytics APIs
+│ ├── trading/ # Trading APIs
+│ ├── markets/ # Market data
+│ ├── portfolio/ # Portfolio APIs
+│ ├── auth/ # Authentication
+│ ├── mcp/ # MCP integration
+│ ├── news/ # News feeds
+│ ├── geopolitics/ # Geopolitical data
+│ └── ...
+│
+├── contexts/ # 12 React contexts
+│ ├── AuthContext.tsx # User authentication
+│ ├── BrokerContext.tsx # Broker connections
+│ ├── DataSourceContext.tsx # Data sources
+│ ├── NavigationContext.tsx # Tab navigation
+│ ├── ThemeContext.tsx # Theme settings
+│ ├── WorkspaceContext.tsx # Workspace state
+│ ├── LanguageContext.tsx # i18n
+│ ├── TimezoneContext.tsx # Timezone
+│ ├── InterfaceModeContext.tsx # Interface mode
+│ ├── ProviderContext.tsx # AI providers
+│ └── StockBrokerContext.tsx # Stock broker state
│
-├── src-tauri/ # Rust backend (less relevant)
-├── package.json # Dependencies
-├── tsconfig.json # TypeScript config
-├── vite.config.ts # Vite config
-└── tailwind.config.js # Tailwind config
+├── hooks/ # 8 custom hooks
+│ ├── useAutoUpdater.ts # Auto-update
+│ ├── useCache.ts # Caching
+│ ├── useDataSource.ts # Data sources
+│ ├── use-mobile.ts # Mobile detection
+│ ├── useRustWebSocket.ts # WebSocket
+│ ├── useTabSession.ts # Tab sessions
+│ ├── useWatchlist.ts # Watchlist
+│ └── useWorkspaceTabState.ts # Workspace tabs
+│
+├── brokers/ # Broker integrations
+│ ├── crypto/ # Crypto exchanges
+│ ├── india/ # Indian brokers
+│ └── stocks/ # Stock brokers
+│
+├── store/ # Redux store
+├── i18n/ # Internationalization
+├── paper-trading/ # Paper trading
+├── types/ # TypeScript types
+├── utils/ # Utility functions
+├── constants/ # Constants
+├── lib/ # Shared libraries
+└── polyfills/ # Browser polyfills
```
-### Tech Stack
-
-- **React 19** - UI library
-- **TypeScript** - Type-safe JavaScript
-- **Vite** - Build tool (super fast!)
-- **TailwindCSS v4** - Styling framework
-- **Radix UI** - Accessible component primitives
-- **Lucide React** - Icon library
-- **Tauri** - Desktop app framework (Rust backend)
-
---
-## 🎓 Your First Contribution
-
-Let's build your first feature - a simple stock watchlist component!
-
-### Step 1: Create a New Component
-
-Create `src/components/tabs/WatchlistWidget.tsx`:
-
-```tsx
-import React, { useState } from 'react';
-import { X, Plus } from 'lucide-react';
-
-interface Stock {
- symbol: string;
- price: number;
- change: number;
- changePercent: number;
-}
-
-const WatchlistWidget: React.FC = () => {
- // State for watchlist
- const [stocks, setStocks] = useState<Stock[]>([
- { symbol: 'AAPL', price: 175.43, change: 2.34, changePercent: 1.35 },
- { symbol: 'MSFT', price: 420.67, change: 4.12, changePercent: 0.99 },
- { symbol: 'GOOGL', price: 140.23, change: -1.23, changePercent: -0.87 }
- ]);
-
- const [newSymbol, setNewSymbol] = useState('');
-
- // Bloomberg colors
- const BLOOMBERG_ORANGE = '#FFA500';
- const BLOOMBERG_WHITE = '#FFFFFF';
- const BLOOMBERG_RED = '#FF0000';
- const BLOOMBERG_GREEN = '#00C800';
- const BLOOMBERG_GRAY = '#787878';
- const BLOOMBERG_DARK_BG = '#1a1a1a';
- const BLOOMBERG_PANEL_BG = '#000000';
-
- // Add new stock
- const addStock = () => {
- if (!newSymbol) return;
-
- // In real app, fetch from API
- const newStock: Stock = {
- symbol: newSymbol.toUpperCase(),
- price: 100,
- change: 0,
- changePercent: 0
- };
-
- setStocks([...stocks, newStock]);
- setNewSymbol('');
- };
-
- // Remove stock
- const removeStock = (symbol: string) => {
- setStocks(stocks.filter(s => s.symbol !== symbol));
- };
-
- return (
- <div style={{
- backgroundColor: BLOOMBERG_PANEL_BG,
- border: `1px solid ${BLOOMBERG_GRAY}`,
- padding: '12px',
- borderRadius: '4px',
- maxWidth: '400px'
- }}>
- {/* Header */}
- <div style={{
- color: BLOOMBERG_ORANGE,
- fontSize: '14px',
- fontWeight: 'bold',
- marginBottom: '12px',
- fontFamily: 'Consolas, monospace'
- }}>
- MY WATCHLIST
- </div>
-
- {/* Add Stock Form */}
- <div style={{
- display: 'flex',
- gap: '8px',
- marginBottom: '12px'
- }}>
- <input
- type="text"
- value={newSymbol}
- onChange={(e) => setNewSymbol(e.target.value)}
- onKeyPress={(e) => e.key === 'Enter' && addStock()}
- placeholder="Enter symbol..."
- style={{
- backgroundColor: BLOOMBERG_DARK_BG,
- border: `1px solid ${BLOOMBERG_GRAY}`,
- color: BLOOMBERG_WHITE,
- padding: '6px 10px',
- fontSize: '12px',
- flex: 1,
- fontFamily: 'Consolas, monospace'
- }}
- />
- <button
- onClick={addStock}
- style={{
- backgroundColor: BLOOMBERG_ORANGE,
- border: 'none',
- color: 'black',
- padding: '6px 12px',
- fontSize: '12px',
- fontWeight: 'bold',
- cursor: 'pointer',
- display: 'flex',
- alignItems: 'center',
- gap: '4px'
- }}
- >
- <Plus size={14} />
- ADD
- </button>
- </div>
-
- {/* Stock List */}
- <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>
-
- {stocks.length === 0 ? (
- <div style={{
- color: BLOOMBERG_GRAY,
- fontSize: '12px',
- textAlign: 'center',
- padding: '20px',
- fontFamily: 'Consolas, monospace'
- }}>
- No stocks in watchlist
- </div>
- ) : (
- stocks.map(stock => (
- <div
- key={stock.symbol}
- style={{
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'space-between',
- padding: '8px',
- borderBottom: `1px solid rgba(120,120,120,0.3)`,
- fontFamily: 'Consolas, monospace'
- }}
- >
- <div style={{ flex: 1 }}>
- <div style={{
- color: BLOOMBERG_WHITE,
- fontSize: '13px',
- fontWeight: 'bold'
- }}>
- {stock.symbol}
- </div>
- <div style={{
- color: BLOOMBERG_WHITE,
- fontSize: '11px'
- }}>
- ${stock.price.toFixed(2)}
- </div>
- </div>
-
- <div style={{
- color: stock.change >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED,
- fontSize: '11px',
- textAlign: 'right',
- marginRight: '8px'
- }}>
- <div>
- {stock.change >= 0 ? '+' : ''}{stock.change.toFixed(2)}
- </div>
- <div>
- {stock.changePercent >= 0 ? '+' : ''}{stock.changePercent.toFixed(2)}%
- </div>
- </div>
-
- <button
- onClick={() => removeStock(stock.symbol)}
- style={{
- background: 'none',
- border: 'none',
- color: BLOOMBERG_GRAY,
- cursor: 'pointer',
- padding: '4px'
- }}
- >
- <X size={16} />
- </button>
- </div>
- ))
- )}
- </div>
- );
-};
-
-export default WatchlistWidget;
-```
-
-### Step 2: Test Your Component
-
-Create a test page in `src/App.tsx`:
-
-```tsx
-import WatchlistWidget from './components/tabs/WatchlistWidget';
-
-function App() {
- return (
- <div style={{
- backgroundColor: '#1a1a1a',
- minHeight: '100vh',
- padding: '20px'
- }}>
- <WatchlistWidget />
- </div>
- );
-}
-
-export default App;
-```
+## Terminal Tabs
-Run `npm run dev` and see your component!
+### Tab Categories
-### Step 3: Add Real Data
+| Category | Tabs | Description |
+|----------|------|-------------|
+| Markets | 5+ | Market data, charts, watchlists |
+| Trading | 8+ | Algo trading, crypto, equity |
+| Analytics | 10+ | Portfolio, risk, performance |
+| Research | 5+ | Equity research, screener |
+| QuantLib | 15+ | Quantitative analysis modules |
+| AI/ML | 3+ | AI chat, agents, quant lab |
+| Data | 5+ | Data sources, mapping, DBnomics |
+| Other | 30+ | Geopolitics, economics, forum |
-Replace dummy data with actual API calls:
+### Creating a New Tab
```tsx
-import { useEffect } from 'react';
-import { marketDataService } from '../../services/marketDataService';
+// src/components/tabs/my-tab/MyTab.tsx
+import React, { useState, useEffect } from 'react';
+import { invoke } from '@tauri-apps/api/core';
-const WatchlistWidget: React.FC = () => {
- // ... existing code ...
+const MyTab: React.FC = () => {
+ const [data, setData] = useState<any>(null);
+ const [loading, setLoading] = useState(true);
- // Fetch real data on mount
useEffect(() => {
const fetchData = async () => {
- const symbols = stocks.map(s => s.symbol);
- const quotes = await marketDataService.getQuotes(symbols);
-
- setStocks(quotes.map(q => ({
- symbol: q.symbol,
- price: q.price,
- change: q.change,
- changePercent: q.change_percent
- })));
+ try {
+ const result = await invoke('my_command');
+ setData(result);
+ } catch (err) {
+ console.error(err);
+ } finally {
+ setLoading(false);
+ }
};
-
fetchData();
}, []);
- // ... rest of component ...
-};
-```
-
----
-
-## 📚 Component Development Guide
-
-### Component Structure Template
-
-```tsx
-import React, { useState, useEffect } from 'react';
-import { SomeIcon } from 'lucide-react';
-
-// Type definitions
-interface ComponentProps {
- title: string;
- data: DataType[];
- onAction?: (id: string) => void;
-}
+ if (loading) return <div>Loading...</div>;
-interface DataType {
- id: string;
- name: string;
- value: number;
-}
-
-// Bloomberg color constants
-const COLORS = {
- ORANGE: '#FFA500',
- WHITE: '#FFFFFF',
- RED: '#FF0000',
- GREEN: '#00C800',
- GRAY: '#787878',
- DARK_BG: '#1a1a1a',
- PANEL_BG: '#000000'
-};
-
-const MyComponent: React.FC<ComponentProps> = ({ title, data, onAction }) => {
- // State
- const [isLoading, setIsLoading] = useState(false);
- const [error, setError] = useState<string | null>(null);
-
- // Effects
- useEffect(() => {
- // Fetch data, setup listeners, etc.
- }, []);
-
- // Event handlers
- const handleClick = (id: string) => {
- onAction?.(id);
- };
-
- // Render
return (
- <div style={{
- backgroundColor: COLORS.PANEL_BG,
- border: `1px solid ${COLORS.GRAY}`,
- padding: '12px'
- }}>
- {/* Header */}
- <div style={{
- color: COLORS.ORANGE,
- fontSize: '14px',
- fontWeight: 'bold',
- marginBottom: '12px'
- }}>
- {title.toUpperCase()}
- </div>
-
+ <div className="h-full bg-[#1a1a1a] text-white font-mono p-4">
+ <h1 className="text-orange-500 font-bold">MY TAB</h1>
{/* Content */}
- {isLoading ? (
- <div>Loading...</div>
- ) : error ? (
- <div style={{ color: COLORS.RED }}>{error}</div>
- ) : (
- <div>
- {data.map(item => (
- <div key={item.id} onClick={() => handleClick(item.id)}>
- {item.name}: {item.value}
- </div>
- ))}
- </div>
- )}
</div>
);
};
-export default MyComponent;
-```
-
-### Using Existing UI Components
-
-Fincept Terminal has 40+ pre-built components in `src/components/ui/`:
-
-```tsx
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
-import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
-
-function MyTab() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Market Data</CardTitle>
- </CardHeader>
- <CardContent>
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead>Symbol</TableHead>
- <TableHead>Price</TableHead>
- </TableRow>
- </TableHeader>
- <TableBody>
- <TableRow>
- <TableCell>AAPL</TableCell>
- <TableCell>$175.43</TableCell>
- </TableRow>
- </TableBody>
- </Table>
-
- <Input placeholder="Enter symbol..." />
- <Button>Search</Button>
- </CardContent>
- </Card>
- );
-}
+export default MyTab;
```
---
-## 🔥 Tab Development
+## Services
-### Creating a New Tab
+### Service Categories
-Tabs are the main features of Fincept Terminal. Here's how to create one:
+| Service | Purpose |
+|---------|---------|
+| `analytics/` | Financial calculations |
+| `trading/` | Order management |
+| `markets/` | Market data |
+| `portfolio/` | Portfolio operations |
+| `auth/` | Authentication |
+| `news/` | News aggregation |
+| `mcp/` | MCP integration |
+| `geopolitics/` | Geopolitical data |
+| `maritime/` | Maritime tracking |
+| `screener/` | Stock screening |
-**Step 1: Create Tab File** (`src/components/tabs/MyNewTab.tsx`)
+### Service Pattern
```tsx
-import React, { useState, useEffect } from 'react';
-
-const MyNewTab: React.FC = () => {
- const [currentTime, setCurrentTime] = useState(new Date());
-
- useEffect(() => {
- const timer = setInterval(() => {
- setCurrentTime(new Date());
- }, 1000);
- return () => clearInterval(timer);
- }, []);
-
- // Bloomberg colors
- const BLOOMBERG_ORANGE = '#FFA500';
- const BLOOMBERG_WHITE = '#FFFFFF';
- const BLOOMBERG_DARK_BG = '#1a1a1a';
- const BLOOMBERG_PANEL_BG = '#000000';
- const BLOOMBERG_GRAY = '#787878';
-
- return (
- <div style={{
- height: '100%',
- backgroundColor: BLOOMBERG_DARK_BG,
- color: BLOOMBERG_WHITE,
- fontFamily: 'Consolas, monospace',
- overflow: 'hidden',
- display: 'flex',
- flexDirection: 'column'
- }}>
- {/* Header Bar */}
- <div style={{
- padding: '8px 12px',
- backgroundColor: BLOOMBERG_PANEL_BG,
- borderBottom: `1px solid ${BLOOMBERG_GRAY}`,
- fontSize: '13px'
- }}>
- <span style={{ color: BLOOMBERG_ORANGE, fontWeight: 'bold' }}>
- MY NEW TAB
- </span>
- <span style={{ marginLeft: '16px', color: BLOOMBERG_WHITE }}>
- {currentTime.toLocaleTimeString()}
- </span>
- </div>
-
- {/* Main Content */}
- <div style={{
- flex: 1,
- overflow: 'auto',
- padding: '16px'
- }}>
- <div style={{
- color: BLOOMBERG_ORANGE,
- fontSize: '16px',
- fontWeight: 'bold',
- marginBottom: '16px'
- }}>
- TAB CONTENT
- </div>
-
- {/* Your content here */}
- </div>
-
- {/* Status Bar */}
- <div style={{
- borderTop: `1px solid ${BLOOMBERG_GRAY}`,
- backgroundColor: BLOOMBERG_PANEL_BG,
- padding: '6px 12px',
- fontSize: '10px',
- color: BLOOMBERG_GRAY
- }}>
- Status: Ready
- </div>
- </div>
- );
-};
-
-export default MyNewTab;
-```
-
-**Step 2: Register Tab** in `DashboardScreen.tsx`:
-
-```tsx
-// Import your tab
-import MyNewTab from '../tabs/MyNewTab';
-
-// Add to tabs array
-const tabs = [
- { id: 'dashboard', label: 'Dashboard', component: DashboardTab },
- { id: 'markets', label: 'Markets', component: MarketsTab },
- { id: 'mynew', label: 'My New Tab', component: MyNewTab }, // ADD THIS
- // ... other tabs
-];
-```
-
-**Step 3: Assign Function Key** (optional):
-
-```tsx
-// In DashboardScreen.tsx, add keyboard shortcut
-useEffect(() => {
- const handleKeyPress = (e: KeyboardEvent) => {
- if (e.key === 'F9') {
- setActiveTab('mynew');
- }
- };
-
- window.addEventListener('keydown', handleKeyPress);
- return () => window.removeEventListener('keydown', handleKeyPress);
-}, []);
-```
-
----
-
-## 🌐 Working with APIs
-
-### API Service Pattern
-
-All API calls go through service files in `src/services/`:
-
-**Example: Market Data Service** (`marketDataService.tsx`)
+// services/marketService.ts
+import { invoke } from '@tauri-apps/api/core';
-```typescript
-interface QuoteData {
+export interface Quote {
symbol: string;
price: number;
change: number;
- change_percent: number;
- volume?: number;
- high?: number;
- low?: number;
+ changePercent: number;
}
-export const marketDataService = {
- async getQuote(symbol: string): Promise<QuoteData> {
- try {
- const response = await fetch(`/api/quote/${symbol}`);
- if (!response.ok) {
- throw new Error(`Failed to fetch ${symbol}`);
- }
- return await response.json();
- } catch (error) {
- console.error('Error fetching quote:', error);
- throw error;
- }
+export const marketService = {
+ async getQuote(symbol: string): Promise<Quote> {
+ return invoke('get_quote', { symbol });
},
- async getQuotes(symbols: string[]): Promise<QuoteData[]> {
- const promises = symbols.map(s => this.getQuote(s));
- return await Promise.all(promises);
+ async getQuotes(symbols: string[]): Promise<Quote[]> {
+ return invoke('get_quotes', { symbols });
+ },
+
+ async getHistoricalData(symbol: string, period: string) {
+ return invoke('get_historical', { symbol, period });
}
};
```
-### Using Tauri Commands
-
-For native functionality, invoke Rust commands:
+---
-```typescript
-import { invoke } from '@tauri-apps/api/core';
+## Contexts & State
-// Call Rust backend
-const result = await invoke<string>('fetch_market_data', {
- symbol: 'AAPL'
-});
+### Available Contexts
-const data = JSON.parse(result);
-```
+| Context | Purpose | Key Values |
+|---------|---------|------------|
+| `AuthContext` | User auth | user, isAuthenticated, login, logout |
+| `BrokerContext` | Brokers | activeBroker, connect, disconnect |
+| `DataSourceContext` | Data sources | sources, addSource, removeSource |
+| `NavigationContext` | Navigation | activeTab, setActiveTab |
+| `ThemeContext` | Theming | theme, setTheme |
+| `WorkspaceContext` | Workspace | workspaces, activeWorkspace |
-### Real-time Data Updates
+### Using Context
```tsx
-const [quotes, setQuotes] = useState<QuoteData[]>([]);
-const [lastUpdate, setLastUpdate] = useState(new Date());
+import { useAuth } from '@/contexts/AuthContext';
+import { useNavigation } from '@/contexts/NavigationContext';
-// Auto-update every 10 seconds
-useEffect(() => {
- const fetchData = async () => {
- const data = await marketDataService.getQuotes(['AAPL', 'MSFT', 'GOOGL']);
- setQuotes(data);
- setLastUpdate(new Date());
- };
+function MyComponent() {
+ const { user, isAuthenticated } = useAuth();
+ const { activeTab, setActiveTab } = useNavigation();
- fetchData(); // Initial fetch
+ if (!isAuthenticated) {
+ return <div>Please log in</div>;
+ }
- const interval = setInterval(fetchData, 10000); // Every 10s
- return () => clearInterval(interval);
-}, []);
+ return <div>Welcome, {user?.email}</div>;
+}
```
---
-## 🎨 Bloomberg-Style UI Standards
+## Component Development
-### Color Palette
+### UI Components
-Always use these exact colors:
+Pre-built shadcn/ui components in `src/components/ui/`:
-```typescript
-const BLOOMBERG_COLORS = {
- ORANGE: '#FFA500', // Headers, highlights
- WHITE: '#FFFFFF', // Primary text
- RED: '#FF0000', // Negative values
- GREEN: '#00C800', // Positive values
- YELLOW: '#FFFF00', // Warnings, secondary headers
- GRAY: '#787878', // Borders, disabled text
- DARK_BG: '#1a1a1a', // Background
- PANEL_BG: '#000000' // Panel backgrounds
-};
+```tsx
+import { Button } from '@/components/ui/button';
+import { Card, CardHeader, CardContent } from '@/components/ui/card';
+import { Table, TableBody, TableRow, TableCell } from '@/components/ui/table';
+import { Dialog, DialogTrigger, DialogContent } from '@/components/ui/dialog';
+import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
```
-### Typography
-
-```css
-/* Use Consolas monospace font */
-fontFamily: 'Consolas, monospace'
+### Component Template
-/* Size hierarchy */
-fontSize: '16px' // Main headers
-fontSize: '14px' // Section headers
-fontSize: '12px' // Body text
-fontSize: '11px' // Small text
-fontSize: '10px' // Status bar
-fontSize: '9px' // Table data
-```
+```tsx
+import React, { useState } from 'react';
-### Layout Patterns
+interface Props {
+ symbol: string;
+ onSelect?: (symbol: string) => void;
+}
-**Terminal Header:**
-```tsx
-<div style={{
- padding: '8px 12px',
- backgroundColor: '#000000',
- borderBottom: '1px solid #787878',
- fontSize: '13px'
-}}>
- <span style={{ color: '#FFA500', fontWeight: 'bold' }}>
- SECTION NAME
- </span>
- <span style={{ marginLeft: '16px', color: '#FFFFFF' }}>
- Additional Info
- </span>
-</div>
-```
+const StockCard: React.FC<Props> = ({ symbol, onSelect }) => {
+ const [price, setPrice] = useState<number>(0);
-**Data Panel:**
-```tsx
-<div style={{
- backgroundColor: '#000000',
- border: '1px solid #787878',
- padding: '12px'
-}}>
- {/* Content */}
-</div>
-```
+ return (
+ <div
+ className="bg-black border border-gray-600 p-3 cursor-pointer"
+ onClick={() => onSelect?.(symbol)}
+ >
+ <span className="text-orange-500 font-bold">{symbol}</span>
+ <span className="text-white ml-4">${price.toFixed(2)}</span>
+ </div>
+ );
+};
-**Positive/Negative Values:**
-```tsx
-<div style={{
- color: value >= 0 ? '#00C800' : '#FF0000'
-}}>
- {value >= 0 ? '+' : ''}{value.toFixed(2)}%
-</div>
+export default StockCard;
```
---
-## 🔄 State Management
-
-### Using React Context
+## Calling Rust Commands
-**Access Authentication:**
+### Basic Invocation
```tsx
-import { useAuth } from '../../contexts/AuthContext';
-
-function MyComponent() {
- const { user, isAuthenticated, login, logout } = useAuth();
+import { invoke } from '@tauri-apps/api/core';
- if (!isAuthenticated) {
- return <div>Please log in</div>;
- }
+// Simple call
+const result = await invoke<string>('greet', { name: 'World' });
- return (
- <div>
- Welcome, {user?.email}!
- Subscription: {user?.subscription_plan}
- </div>
- );
+// With types
+interface PortfolioResult {
+ weights: number[];
+ sharpe: number;
}
-```
-### Local State
-
-```tsx
-// Simple state
-const [count, setCount] = useState(0);
-
-// Object state
-const [formData, setFormData] = useState({
- symbol: '',
- quantity: 0
+const portfolio = await invoke<PortfolioResult>('optimize_portfolio', {
+ symbols: ['AAPL', 'MSFT', 'GOOGL'],
+ optimize: true
});
-
-// Update object state
-setFormData(prev => ({
- ...prev,
- symbol: 'AAPL'
-}));
```
-### Derived State
+### Error Handling
```tsx
-const stocks = [...]; // array of stocks
-const totalValue = stocks.reduce((sum, s) => sum + s.price, 0);
-const avgChange = stocks.reduce((sum, s) => sum + s.changePercent, 0) / stocks.length;
+try {
+ const data = await invoke('fetch_data', { symbol: 'AAPL' });
+ setData(data);
+} catch (error) {
+ console.error('Error:', error);
+ setError(error as string);
+}
```
---
-## 🧪 Testing & Debugging
-
-### Manual Testing Checklist
-
-Before submitting:
-- [ ] Component renders without errors
-- [ ] All buttons/inputs work correctly
-- [ ] Data loads properly
-- [ ] Error states display correctly
-- [ ] Loading states show
-- [ ] Responsive on different screen sizes
-- [ ] Bloomberg colors used correctly
-- [ ] No console errors or warnings
+## Styling
-### Debugging Tools
+### Bloomberg Theme Colors
-**React DevTools:**
-- Install React DevTools browser extension
-- Inspect component tree
-- View props and state
-- Track re-renders
-
-**Console Logging:**
```tsx
-console.log('Data loaded:', data);
-console.error('Error occurred:', error);
-console.table(arrayOfObjects); // Nice table view
+const COLORS = {
+ ORANGE: '#FFA500', // Headers
+ WHITE: '#FFFFFF', // Text
+ GREEN: '#00C800', // Positive
+ RED: '#FF0000', // Negative
+ GRAY: '#787878', // Borders
+ DARK_BG: '#1a1a1a', // Background
+ BLACK: '#000000' // Panels
+};
```
-**TypeScript Errors:**
-```bash
-# Check TypeScript errors
-npm run build
-```
+### Common Patterns
-### Common Issues
+```tsx
+// Header
+<div className="text-orange-500 font-bold text-sm font-mono">
+ SECTION HEADER
+</div>
-**Issue: "Cannot find module '@/components/ui/button'"**
-**Fix:** Check import path, ensure `@` alias is configured in `vite.config.ts`
+// Panel
+<div className="bg-black border border-gray-600 p-3">
+ Content
+</div>
-**Issue: "Hooks called out of order"**
-**Fix:** Ensure hooks are always called in the same order, not inside conditions
+// Positive/Negative
+<span className={value >= 0 ? 'text-green-500' : 'text-red-500'}>
+ {value >= 0 ? '+' : ''}{value.toFixed(2)}%
+</span>
-**Issue: "State not updating"**
-**Fix:** Use functional update: `setState(prev => ...)`
+// Table row
+<div className="flex justify-between py-1 border-b border-gray-800">
+ <span className="text-white">{symbol}</span>
+ <span className="text-gray-400">${price}</span>
+</div>
+```
---
-## ✅ Code Standards & Best Practices
-
-### TypeScript Best Practices
-
-**1. Always Define Types:**
-```tsx
-// ❌ BAD
-const handleClick = (data: any) => { ... }
+## Code Standards
-// ✅ GOOD
-interface ClickData {
- id: string;
- value: number;
-}
-const handleClick = (data: ClickData) => { ... }
-```
+### TypeScript
-**2. Use Interfaces for Props:**
```tsx
-interface ComponentProps {
- title: string;
- count: number;
+// ✅ Good - Define types
+interface Props {
+ symbol: string;
+ price: number;
onUpdate?: (value: number) => void;
}
-const Component: React.FC<ComponentProps> = ({ title, count, onUpdate }) => {
+const Component: React.FC<Props> = ({ symbol, price, onUpdate }) => {
// ...
};
-```
-**3. Use Enums for Constants:**
-```tsx
-enum TabType {
- Dashboard = 'dashboard',
- Markets = 'markets',
- News = 'news'
-}
+// ❌ Bad - Using any
+const Component = (props: any) => { ... };
```
### React Best Practices
-**1. Cleanup Effects:**
```tsx
+// Cleanup effects
useEffect(() => {
- const timer = setInterval(() => { ... }, 1000);
-
- // CLEANUP
+ const timer = setInterval(() => {}, 1000);
return () => clearInterval(timer);
}, []);
-```
-**2. Memoize Expensive Calculations:**
-```tsx
-import { useMemo } from 'react';
-
-const expensiveValue = useMemo(() => {
- return complexCalculation(data);
-}, [data]);
-```
-
-**3. Use Callbacks for Event Handlers:**
-```tsx
-import { useCallback } from 'react';
+// Memoize expensive calculations
+const expensive = useMemo(() => calculate(data), [data]);
+// Stable callbacks
const handleClick = useCallback(() => {
console.log('Clicked');
}, []);
```
-**4. Conditional Rendering:**
-```tsx
-// ✅ GOOD
-{isLoading && <LoadingSpinner />}
-{error && <ErrorMessage error={error} />}
-{data && <DataDisplay data={data} />}
-```
-
-### File Organization
-
-**Component Structure:**
-```
-MyFeatureTab/
-├── MyFeatureTab.tsx # Main component
-├── components/ # Sub-components
-│ ├── DataTable.tsx
-│ ├── FilterPanel.tsx
-│ └── ChartView.tsx
-├── hooks/ # Custom hooks
-│ └── useFeatureData.ts
-└── types.ts # Type definitions
-```
-
----
-
-## 🚀 Submitting Your Work
-
### Pre-Submission Checklist
-- [ ] Code builds without errors (`npm run build`)
+- [ ] `bun run build` passes
- [ ] No TypeScript errors
-- [ ] No console errors/warnings
-- [ ] Follows Bloomberg color scheme
-- [ ] Uses Consolas font
-- [ ] Responsive design
-- [ ] Tested in dev mode (`npm run tauri dev`)
-- [ ] Code is commented
-- [ ] Similar patterns to existing code
-
-### Creating a Pull Request
-
-**1. Create Branch:**
-```bash
-git checkout -b feature/watchlist-widget
-```
-
-**2. Commit Changes:**
-```bash
-git add src/components/tabs/WatchlistWidget.tsx
-git commit -m "Add watchlist widget component
-
-- Real-time price updates
-- Add/remove stocks
-- Bloomberg-style UI
-- Responsive design"
-```
-
-**3. Push and Create PR:**
-```bash
-git push origin feature/watchlist-widget
-```
-
-**4. Fill PR Template:**
-```markdown
-## Description
-Add watchlist widget for tracking favorite stocks
-
-## Type of Change
-- [x] New feature
-- [ ] Bug fix
-- [ ] UI improvement
-
-## Screenshots
-[Paste screenshot of the widget]
-
-## Testing
-- [x] Tested add/remove functionality
-- [x] Tested real-time updates
-- [x] Tested responsive design
-- [x] No console errors
-
-## Checklist
-- [x] Code follows project style
-- [x] Bloomberg colors used
-- [x] TypeScript types defined
-- [x] Tested in dev mode
-```
+- [ ] No console errors
+- [ ] Bloomberg colors used
+- [ ] Monospace font
+- [ ] Tested in dev mode
---
-## 📖 Resources & Learning
+## Resources
### React & TypeScript
-**Basics:**
-- React Docs: https://react.dev/
-- TypeScript Handbook: https://www.typescriptlang.org/docs/
-- React + TypeScript Cheatsheet: https://react-typescript-cheatsheet.netlify.app/
-
-**Advanced:**
-- React Hooks: https://react.dev/reference/react
-- TypeScript Advanced Types: https://www.typescriptlang.org/docs/handbook/2/types-from-types.html
+- [React Docs](https://react.dev/)
+- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
-### UI/UX
+### UI Libraries
-**Design:**
-- Bloomberg Terminal UI (Google images for reference)
-- Radix UI Docs: https://www.radix-ui.com/
-- TailwindCSS: https://tailwindcss.com/
+- [Radix UI](https://www.radix-ui.com/)
+- [TailwindCSS](https://tailwindcss.com/)
+- [Lucide Icons](https://lucide.dev/)
+- [shadcn/ui](https://ui.shadcn.com/)
-**Charts & Visualization:**
-- Lightweight Charts: https://tradingview.github.io/lightweight-charts/
-- Recharts: https://recharts.org/
-
-### Financial Domain
-
-**Learn Finance:**
-- Stock market basics
-- Technical indicators (RSI, MACD, Bollinger Bands)
-- Candlestick patterns
-- Portfolio management
-
-**Resources:**
-- Investopedia: https://www.investopedia.com/
-- Trading View ideas: https://www.tradingview.com/
-
-### Project-Specific
-
-**Study Existing Code:**
-- `MarketsTab.tsx` - Real-time data, auto-refresh
-- `DashboardTab.tsx` - Bloomberg layout, 3-panel design
-- `ChatTab.tsx` - AI integration
-- All components in `src/components/ui/`
-
----
-
-## 💡 Project Ideas
-
-### Beginner Tasks (Week 1-2)
-- Fix UI bugs
-- Add small features to existing tabs
-- Create reusable UI components
-- Improve mobile responsiveness
-
-### Intermediate Tasks (Week 3-6)
-- Build new tab (News, Screener, etc.)
-- Integrate charting library
-- Add real-time WebSocket data
-- Create data visualization widgets
-
-### Advanced Tasks (Week 7+)
-- Build portfolio management UI
-- Create backtesting interface
-- Implement AI chat features
-- Design custom indicators
-- Build broker integration UIs
-
-### High-Impact Features
-
-1. **News Tab**
- - RSS feed integration
- - Sentiment analysis display
- - Real-time news ticker
-
-2. **Screener Tab**
- - Stock screening filters
- - Custom criteria builder
- - Results table with sorting
-
-3. **Chart Tab**
- - Interactive charts (TradingView-style)
- - Multiple timeframes
- - Technical indicators overlay
-
-4. **Portfolio Tab**
- - Holdings display
- - P&L tracking
- - Asset allocation pie chart
-
-5. **Alerts Tab**
- - Price alerts management
- - Technical indicator alerts
- - Notification system
-
----
-
-## 🤝 Getting Help
-
-**When Stuck:**
-1. Check existing components for similar patterns
-2. Read React error messages carefully
-3. Search GitHub issues
-4. Ask in GitHub Discussions
-5. Reach out on community channels
-
-**Where to Ask:**
-- GitHub Issues: Bugs or technical questions
-- GitHub Discussions: General help
-- Project Discord/Slack (if available)
-
----
+### Charting
-## 🎉 Final Words
+- [Lightweight Charts](https://tradingview.github.io/lightweight-charts/)
+- [Recharts](https://recharts.org/)
+- [Plotly](https://plotly.com/javascript/)
+- [D3.js](https://d3js.org/)
-You're now ready to build amazing financial UI features for Fincept Terminal!
+### Tauri
-**Remember:**
-- Start with small components
-- Study existing code patterns
-- Test thoroughly
-- Follow Bloomberg styling
-- Ask questions when stuck
-- Have fun coding!
+- [Tauri v2 Docs](https://tauri.app/v2/)
+- [invoke API](https://tauri.app/v2/reference/js/core/#invoke)
-Your work will help thousands of financial professionals access powerful analysis tools for free!
+### Related Guides
-Welcome aboard! 🚀
+- [Contributing Guide](./CONTRIBUTING.md) - General workflow
+- [Rust Guide](./RUST_CONTRIBUTOR_GUIDE.md) - Backend commands
+- [Python Guide](./PYTHON_CONTRIBUTOR_GUIDE.md) - Analytics scripts
---
-**Repository**: https://github.com/Fincept-Corporation/FinceptTerminal/
-**Contact**: [email protected]
+**Questions?** Open an issue on [GitHub](https://github.com/Fincept-Corporation/FinceptTerminal).
diff --git a/fincept-terminal-desktop/bun.lock b/fincept-terminal-desktop/bun.lock
index 440d3ab64..2820c2b1e 100644
--- a/fincept-terminal-desktop/bun.lock
+++ b/fincept-terminal-desktop/bun.lock
@@ -20,6 +20,7 @@
"@langchain/google-genai": "^2.1.10",
"@langchain/ollama": "^0.2.4",
"@langchain/openai": "^1.2.2",
+ "@loaders.gl/draco": "^4.3.0",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-aspect-ratio": "^1.1.7",
diff --git a/fincept-terminal-desktop/package.json b/fincept-terminal-desktop/package.json
index e4099befa..d3f78ab08 100644
--- a/fincept-terminal-desktop/package.json
+++ b/fincept-terminal-desktop/package.json
@@ -34,6 +34,7 @@
"@langchain/google-genai": "^2.1.10",
"@langchain/ollama": "^0.2.4",
"@langchain/openai": "^1.2.2",
+ "@loaders.gl/draco": "^4.3.0",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-aspect-ratio": "^1.1.7",
diff --git a/fincept-terminal-desktop/src/components/command-bar/CommandBar.tsx b/fincept-terminal-desktop/src/components/command-bar/CommandBar.tsx
index 9e0f9c235..6024693eb 100644
--- a/fincept-terminal-desktop/src/components/command-bar/CommandBar.tsx
+++ b/fincept-terminal-desktop/src/components/command-bar/CommandBar.tsx
@@ -107,7 +107,7 @@ export const CommandBar: React.FC<CommandBarProps> = ({ onExecuteCommand }) => {
}, []);
return (
- <div style={{ position: 'relative', width: '200px', flexShrink: 0 }}>
+ <div style={{ position: 'relative', width: '180px', minWidth: '120px', maxWidth: '200px', flex: '0 1 180px' }}>
<div style={{
display: 'flex',
alignItems: 'center',
diff --git a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx
index d00ffcfc1..654b320f9 100644
--- a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx
+++ b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx
@@ -672,7 +672,7 @@ function FinxeptTerminalContent() {
minHeight: '28px'
}}>
{/* Left: Menus */}
- <div style={{ display: 'flex', alignItems: 'center', gap: '16px', flexShrink: 0 }}>
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px', flexShrink: 0 }}>
<DropdownMenu label="File" items={fileMenuItems} onItemClick={handleMenuAction} />
<DropdownMenu label="Navigate" items={navigateMenuItems} onItemClick={handleMenuAction} />
<DropdownMenu label="View" items={viewMenuItems} onItemClick={handleMenuAction} />
@@ -680,20 +680,20 @@ function FinxeptTerminalContent() {
</div>
{/* Center: Command Bar + Info */}
- <div style={{ display: 'flex', alignItems: 'center', gap: '12px', flex: 1, justifyContent: 'center', minWidth: 0 }}>
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', flex: 1, justifyContent: 'center', minWidth: 0, overflow: 'hidden' }}>
<CommandBar onExecuteCommand={setActiveTab} />
- <div style={{ width: '1px', height: '14px', backgroundColor: '#525252', flexShrink: 0 }}></div>
- <HeaderTimeDisplay />
- <div style={{ width: '1px', height: '14px', backgroundColor: '#525252', flexShrink: 0 }}></div>
- <span style={{ color: '#10b981', fontSize: '12px', fontWeight: 'bold', whiteSpace: 'nowrap' }}>v{APP_VERSION}</span>
- <div style={{ width: '1px', height: '14px', backgroundColor: '#525252', flexShrink: 0 }}></div>
- <span style={{ color: '#ea580c', fontSize: '11px', fontWeight: 'bold', letterSpacing: '0.5px', whiteSpace: 'nowrap' }}>FINCEPT PROFESSIONAL</span>
+ <div className="hidden-on-small" style={{ width: '1px', height: '14px', backgroundColor: '#525252', flexShrink: 0 }}></div>
+ <div className="hidden-on-small"><HeaderTimeDisplay /></div>
+ <div className="hidden-on-medium" style={{ width: '1px', height: '14px', backgroundColor: '#525252', flexShrink: 0 }}></div>
+ <span className="hidden-on-medium" style={{ color: '#10b981', fontSize: '12px', fontWeight: 'bold', whiteSpace: 'nowrap' }}>v{APP_VERSION}</span>
+ <div className="hidden-on-small" style={{ width: '1px', height: '14px', backgroundColor: '#525252', flexShrink: 0 }}></div>
+ <span className="hidden-on-small" style={{ color: '#ea580c', fontSize: '11px', fontWeight: 'bold', letterSpacing: '0.5px', whiteSpace: 'nowrap' }}>FINCEPT</span>
</div>
{/* Right: Session + Actions */}
- <div style={{ display: 'flex', alignItems: 'center', gap: '10px', flexShrink: 0 }}>
- {getClickableSessionDisplay()}
- <div style={{ width: '1px', height: '14px', backgroundColor: '#525252' }}></div>
+ <div style={{ display: 'flex', alignItems: 'center', gap: '6px', flexShrink: 0 }}>
+ <div className="hidden-on-small">{getClickableSessionDisplay()}</div>
+ <div className="hidden-on-small" style={{ width: '1px', height: '14px', backgroundColor: '#525252' }}></div>
<button
onClick={toggleMode}
style={{
@@ -728,12 +728,12 @@ function FinxeptTerminalContent() {
{mode === 'chat' ? (
<>
<Terminal size={12} />
- <span>TERMINAL</span>
+ <span className="hidden-on-small">TERMINAL</span>
</>
) : (
<>
<MessageSquare size={12} />
- <span>CHAT</span>
+ <span className="hidden-on-small">CHAT</span>
</>
)}
</button>
@@ -800,7 +800,7 @@ function FinxeptTerminalContent() {
title={isLoggingOut ? "Logging out..." : "Logout"}
>
<LogOut size={12} className={isLoggingOut ? 'animate-pulse' : ''} />
- {isLoggingOut ? 'LOGGING OUT...' : 'LOGOUT'}
+ <span className="hidden-on-small">{isLoggingOut ? 'LOGGING OUT...' : 'LOGOUT'}</span>
</button>
</div>
</div>
@@ -834,6 +834,12 @@ function FinxeptTerminalContent() {
.hide-scrollbar::-webkit-scrollbar {
display: none;
}
+ @media (max-width: 1200px) {
+ .hidden-on-medium { display: none !important; }
+ }
+ @media (max-width: 900px) {
+ .hidden-on-small { display: none !important; }
+ }
`}</style>
<Tabs value={activeTab} onValueChange={setActiveTab} className="h-full">
<TabsList style={{