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.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
first update in tauri
tilakpatel226f8af4d28ef1
diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.ymlnew file mode 100644index 000000000..82e712237--- /dev/null+++ b/.github/workflows/build-and-release.yml@@ -0,0 +1,200 @@+name: Build FinceptTerminal+on:+ push:+ branches: [ main ]+ pull_request:+ branches: [ main ]+ workflow_dispatch: # Allows manual trigger++jobs:+ build:+ strategy:+ fail-fast: false+ matrix:+ include:+ - platform: 'macos-latest'+ target: 'aarch64-apple-darwin'+ arch: 'arm64'+ os_name: 'macOS'+ file_ext: '.dmg'+ - platform: 'macos-latest'+ target: 'x86_64-apple-darwin'+ arch: 'x64'+ os_name: 'macOS'+ file_ext: '.dmg'+ - platform: 'ubuntu-22.04'+ target: 'x86_64-unknown-linux-gnu'+ arch: 'x64'+ os_name: 'Linux'+ file_ext: '.AppImage'+ - platform: 'windows-latest'+ target: 'x86_64-pc-windows-msvc'+ arch: 'x64'+ os_name: 'Windows'+ file_ext: '.msi'++ runs-on: ${{ matrix.platform }}++ outputs:+ version: ${{ steps.get_version.outputs.version }}++ steps:+ - name: Checkout repository+ uses: actions/checkout@v4++ - name: Get version from Cargo.toml+ id: get_version+ run: |+ if [ "${{ runner.os }}" = "Windows" ]; then+ VERSION=$(grep '^version = ' src-tauri/Cargo.toml | head -n1 | cut -d '"' -f2)+ echo "version=$VERSION" >> $GITHUB_OUTPUT+ else+ VERSION=$(grep '^version = ' src-tauri/Cargo.toml | head -n1 | cut -d '"' -f2)+ echo "version=$VERSION" >> $GITHUB_OUTPUT+ fi+ shell: bash++ - name: Install dependencies (ubuntu only)+ if: matrix.platform == 'ubuntu-22.04'+ run: |+ sudo apt-get update+ sudo apt-get install -y \+ libwebkit2gtk-4.1-dev \+ libwebkit2gtk-4.0-dev \+ libjavascriptcoregtk-4.1-dev \+ libjavascriptcoregtk-4.0-dev \+ libsoup-3.0-dev \+ libsoup2.4-dev \+ build-essential \+ curl \+ wget \+ file \+ libssl-dev \+ libgtk-3-dev \+ libayatana-appindicator3-dev \+ librsvg2-dev \+ patchelf++ - name: Rust setup+ uses: dtolnay/rust-toolchain@stable+ with:+ targets: ${{ matrix.target }}++ - name: Rust cache+ uses: swatinem/rust-cache@v2+ with:+ workspaces: './src-tauri -> target'+ key: ${{ matrix.target }}++ - name: Sync node version and setup cache+ uses: actions/setup-node@v4+ with:+ node-version: 'lts/*'+ cache: 'npm'++ - name: Install frontend dependencies+ run: npm install++ - name: Build the app+ uses: tauri-apps/tauri-action@v0+ env:+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ with:+ args: '--target ${{ matrix.target }}'++ - name: Upload artifacts+ uses: actions/upload-artifact@v4+ with:+ name: finceptterminal-${{ matrix.os_name }}-${{ matrix.arch }}+ path: |+ src-tauri/target/${{ matrix.target }}/release/bundle/+ !src-tauri/target/${{ matrix.target }}/release/bundle/**/*.dSYM/+ retention-days: 30++ update-readme:+ needs: build+ runs-on: ubuntu-latest+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'++ steps:+ - name: Checkout repository+ uses: actions/checkout@v4+ with:+ token: ${{ secrets.GITHUB_TOKEN }}++ - name: Download all artifacts+ uses: actions/download-artifact@v4+ with:+ path: ./artifacts++ - name: Update README with download links+ run: |+ # Get the run ID and commit SHA+ RUN_ID="${{ github.run_id }}"+ COMMIT_SHA="${{ github.sha }}"+ SHORT_SHA=${COMMIT_SHA:0:7}+ VERSION="${{ needs.build.outputs.version }}"+ REPO_URL="https://github.com/${{ github.repository }}"++ # Create the download links section+ cat > download_section.md << EOF+ ## 📥 Download Latest Build++ **Version:** \`v${VERSION}\` | **Commit:** \`${SHORT_SHA}\` | **Build:** [#${RUN_ID}](${REPO_URL}/actions/runs/${RUN_ID})++ | Platform | Architecture | Download |+ |----------|-------------|----------|+ | 🍎 **macOS** | Apple Silicon (ARM64) | [](${REPO_URL}/actions/runs/${RUN_ID}/artifacts) |+ | 🍎 **macOS** | Intel (x64) | [](${REPO_URL}/actions/runs/${RUN_ID}/artifacts) |+ | 🐧 **Linux** | x64 | [](${REPO_URL}/actions/runs/${RUN_ID}/artifacts) |+ | 🪟 **Windows** | x64 | [](${REPO_URL}/actions/runs/${RUN_ID}/artifacts) |++ > **Note:** Click on the download buttons above to access the artifacts page, then download the specific build for your platform.++ ### 📋 Installation Instructions++ - **macOS**: Download the \`.dmg\` file, open it, and drag FinceptTerminal to Applications+ - **Linux**: Download the \`.AppImage\` file, make it executable (\`chmod +x\`), and run+ - **Windows**: Download the \`.msi\` file and run the installer++ ---+ EOF++ # Check if README has the download section markers+ if grep -q "<!-- DOWNLOAD_SECTION_START -->" README.md && grep -q "<!-- DOWNLOAD_SECTION_END -->" README.md; then+ # Replace existing section+ sed -i '/<!-- DOWNLOAD_SECTION_START -->/,/<!-- DOWNLOAD_SECTION_END -->/c\+ <!-- DOWNLOAD_SECTION_START -->\+ '"$(cat download_section.md | sed 's/$/\\/')"'\+ <!-- DOWNLOAD_SECTION_END -->' README.md+ else+ # Add section at the top after the title+ if grep -q "^# " README.md; then+ # Insert after the first heading+ sed -i '/^# /r download_section.md' README.md+ sed -i '/^# /a\\n<!-- DOWNLOAD_SECTION_START -->' README.md+ sed -i '/<!-- DOWNLOAD_SECTION_START -->/,/---/a\<!-- DOWNLOAD_SECTION_END -->' README.md+ else+ # Prepend to file+ cat download_section.md README.md > temp_readme.md+ mv temp_readme.md README.md+ sed -i '1i<!-- DOWNLOAD_SECTION_START -->' README.md+ sed -i '/---/a\<!-- DOWNLOAD_SECTION_END -->' README.md+ fi+ fi++ # Clean up+ rm download_section.md++ - name: Commit and push changes+ run: |+ git config --local user.email "[email protected]"+ git config --local user.name "GitHub Action"++ if git diff --quiet; then+ echo "No changes to commit"+ else+ git add README.md+ git commit -m "🚀 Update download links for build #${{ github.run_id }}"+ git push+ fi\ No newline at end of filediff --git a/.gitignore b/.gitignoreindex a85fc72fb..4b649f28a 100644--- a/.gitignore+++ b/.gitignore@@ -31,6 +31,9 @@ fincept_terminal/settings.jsonfincept_terminal/watchlist_settings.jsonupx.exefincept_icon.ico+legacy-python-depreciated/python+fincept-terminal-desktop/.vscode+fincept-terminal-desktop/node_modulessetup.issupx.exe"build/".envdiff --git a/fincept-terminal-desktop/README.md b/fincept-terminal-desktop/README.mdindex 102e36689..bc013ac51 100644--- a/fincept-terminal-desktop/README.md+++ b/fincept-terminal-desktop/README.md@@ -1,7 +1,77 @@-# Tauri + React + Typescript+# FinceptTerminal-This template should help get you started developing with Tauri, React and Typescript in Vite.+A modern terminal application built with Tauri and React.-## Recommended IDE Setup+<!-- DOWNLOAD_SECTION_START -->+## 📥 Download Latest Build-- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)+**Version:** `v1.0.0` | **Commit:** `abc1234` | **Build:** [#123](https://github.com/your-username/FinceptTerminal/actions/runs/123)++| Platform | Architecture | Download |+|----------|-------------|----------|+| 🍎 **macOS** | Apple Silicon (ARM64) | [](https://github.com/your-username/FinceptTerminal/actions/runs/123/artifacts) |+| 🍎 **macOS** | Intel (x64) | [](https://github.com/your-username/FinceptTerminal/actions/runs/123/artifacts) |+| 🐧 **Linux** | x64 | [](https://github.com/your-username/FinceptTerminal/actions/runs/123/artifacts) |+| 🪟 **Windows** | x64 | [](https://github.com/your-username/FinceptTerminal/actions/runs/123/artifacts) |++> **Note:** Click on the download buttons above to access the artifacts page, then download the specific build for your platform.++### 📋 Installation Instructions++- **macOS**: Download the `.dmg` file, open it, and drag FinceptTerminal to Applications+- **Linux**: Download the `.AppImage` file, make it executable (`chmod +x`), and run+- **Windows**: Download the `.msi` file and run the installer++---+<!-- DOWNLOAD_SECTION_END -->++## ✨ Features++- Modern terminal interface+- Cross-platform support (macOS, Linux, Windows)+- Built with Tauri for performance and security+- React-based UI for smooth user experience++## 🚀 Development++### Prerequisites++- Node.js (LTS version)+- Rust (latest stable)+- Platform-specific dependencies (see workflow file)++### Setup++```bash+# Clone the repository+git clone https://github.com/your-username/FinceptTerminal.git+cd FinceptTerminal++# Install dependencies+npm install++# Start development server+npm run tauri dev+```++### Building++```bash+# Build for your current platform+npm run tauri build++# Build for specific target+npm run tauri build -- --target x86_64-unknown-linux-gnu+```++## 📖 Documentation++[Add your documentation here]++## 🤝 Contributing++[Add contribution guidelines]++## 📄 License++[Add license information]\ No newline at end of filediff --git a/fincept-terminal-desktop/src-tauri/icons/128x128.png b/fincept-terminal-desktop/src-tauri/icons/128x128.pngindex 6be5e50e9..120e7ae0d 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/128x128.png and b/fincept-terminal-desktop/src-tauri/icons/128x128.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/[email protected] b/fincept-terminal-desktop/src-tauri/icons/[email protected]index e81becee5..d56d0a46c 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/[email protected] and b/fincept-terminal-desktop/src-tauri/icons/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/32x32.png b/fincept-terminal-desktop/src-tauri/icons/32x32.pngindex a437dd517..7b4d4d846 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/32x32.png and b/fincept-terminal-desktop/src-tauri/icons/32x32.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/64x64.png b/fincept-terminal-desktop/src-tauri/icons/64x64.pngnew file mode 100644index 000000000..609f205f2Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/64x64.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square107x107Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square107x107Logo.pngindex 0ca4f2719..a82c06246 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square107x107Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square107x107Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square142x142Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square142x142Logo.pngindex b81f82039..03bfccea6 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square142x142Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square142x142Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square150x150Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square150x150Logo.pngindex 624c7bfba..838f67510 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square150x150Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square150x150Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square284x284Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square284x284Logo.pngindex c021d2ba7..c93567dc5 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square284x284Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square284x284Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square30x30Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square30x30Logo.pngindex 621970023..59e0211e5 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square30x30Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square30x30Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square310x310Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square310x310Logo.pngindex f9bc04839..c9b51eda1 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square310x310Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square310x310Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square44x44Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square44x44Logo.pngindex d5fbfb2ab..b253c12c7 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square44x44Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square44x44Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square71x71Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square71x71Logo.pngindex 63440d798..d903f74af 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square71x71Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square71x71Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/Square89x89Logo.png b/fincept-terminal-desktop/src-tauri/icons/Square89x89Logo.pngindex f3f705af2..ca31c3272 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/Square89x89Logo.png and b/fincept-terminal-desktop/src-tauri/icons/Square89x89Logo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/StoreLogo.png b/fincept-terminal-desktop/src-tauri/icons/StoreLogo.pngindex 455638826..6e2664472 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/StoreLogo.png and b/fincept-terminal-desktop/src-tauri/icons/StoreLogo.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.pngnew file mode 100644index 000000000..2c8895811Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.pngnew file mode 100644index 000000000..32b41f38dBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.pngnew file mode 100644index 000000000..2c8895811Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.pngnew file mode 100644index 000000000..fa095b9acBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.pngnew file mode 100644index 000000000..0cbbc5b7bBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.pngnew file mode 100644index 000000000..fa095b9acBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.pngnew file mode 100644index 000000000..f339ec448Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.pngnew file mode 100644index 000000000..4eac1f317Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.pngnew file mode 100644index 000000000..f339ec448Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.pngnew file mode 100644index 000000000..d76b8d990Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.pngnew file mode 100644index 000000000..935699b2fBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.pngnew file mode 100644index 000000000..d76b8d990Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.pngnew file mode 100644index 000000000..74f97c92aBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.pngnew file mode 100644index 000000000..f41f304cbBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.pngnew file mode 100644index 000000000..74f97c92aBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/icon.icns b/fincept-terminal-desktop/src-tauri/icons/icon.icnsindex 12a5bcee2..72196c4d2 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/icon.icns and b/fincept-terminal-desktop/src-tauri/icons/icon.icns differdiff --git a/fincept-terminal-desktop/src-tauri/icons/icon.ico b/fincept-terminal-desktop/src-tauri/icons/icon.icoindex b3636e4b2..ccc5ae9b2 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/icon.ico and b/fincept-terminal-desktop/src-tauri/icons/icon.ico differdiff --git a/fincept-terminal-desktop/src-tauri/icons/icon.png b/fincept-terminal-desktop/src-tauri/icons/icon.pngindex e1cd2619e..bae9a71c0 100644Binary files a/fincept-terminal-desktop/src-tauri/icons/icon.png and b/fincept-terminal-desktop/src-tauri/icons/icon.png differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..3f6954b1dBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..f81da7cfdBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..f81da7cfdBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..73e04d870Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..4a50d706fBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..d16330cb6Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..d16330cb6Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..a8c651ee0Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..f81da7cfdBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..224f43672Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..224f43672Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..b11b14818Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..cc9156522Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..b11b14818Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..803b60695Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..46daf10cfBinary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..daded0238Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected]new file mode 100644index 000000000..db3438636Binary files /dev/null and b/fincept-terminal-desktop/src-tauri/icons/ios/[email protected] differdiff --git a/fincept-terminal-desktop/src-tauri/tauri.conf.json b/fincept-terminal-desktop/src-tauri/tauri.conf.jsonindex 075b5af94..e31fefec6 100644--- a/fincept-terminal-desktop/src-tauri/tauri.conf.json+++ b/fincept-terminal-desktop/src-tauri/tauri.conf.json@@ -1,8 +1,8 @@{"$schema": "https://schema.tauri.app/config/2",- "productName": "fincept-terminal-desktop",+ "productName": "Fincept Terminal","version": "0.1.0",- "identifier": "com.tilak.fincept-terminal-desktop",+ "identifier": "com.tilak.fincept.terminal.desktop","build": {"beforeDevCommand": "npm run dev","devUrl": "http://localhost:1420",@@ -12,7 +12,7 @@"app": {"windows": [{- "title": "fincept-terminal-desktop",+ "title": "Fincept Terminal","width": 800,"height": 600}diff --git a/fincept-terminal-desktop/src/App.tsx b/fincept-terminal-desktop/src/App.tsxindex c95fb3271..c57026aff 100644--- a/fincept-terminal-desktop/src/App.tsx+++ b/fincept-terminal-desktop/src/App.tsx@@ -1,301 +1,111 @@-import React, { useState } from 'react';-import { Button } from "@/components/ui/button";-import { Input } from "@/components/ui/input";-import { Label } from "@/components/ui/label";-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";-import { Eye, EyeOff, TrendingUp, BarChart3, PieChart, LineChart } from "lucide-react";+// File: src/App.tsx+// Main application file that handles routing between authentication screens and dashboard++import React, { useState, useEffect } from 'react';+import { useAuth } from './contexts/AuthContext';+import LoginScreen from './components/auth/LoginScreen';+import RegisterScreen from './components/auth/RegisterScreen';+import ForgotPasswordScreen from './components/auth/ForgotPasswordScreen';+import HelpScreen from './components/auth/HelpScreen';+import ContactUsScreen from './components/info/ContactUsScreen';+import TermsOfServiceScreen from './components/info/TermsOfServiceScreen';+import TrademarksScreen from './components/info/TrademarksScreen';+import PrivacyPolicyScreen from './components/info/PrivacyPolicyScreen';+import DashboardScreen from './components/dashboard/DashboardScreen';+import BackgroundPattern from './components/common/BackgroundPattern';+import Header from './components/common/Header';+import Footer from './components/common/Footer';++export type Screen =+ | 'login'+ | 'register'+ | 'forgotPassword'+ | 'help'+ | 'contactUs'+ | 'termsOfService'+ | 'trademarks'+ | 'privacyPolicy'+ | 'dashboard';-interface GeometricPatternProps {- children: React.ReactNode;- gridSize?: number;- lineColor?: string;- backgroundColor?: string;- opacity?: number;-}--const GeometricPattern: React.FC<GeometricPatternProps> = ({- children,- gridSize = 40,- lineColor = '#333333',- backgroundColor = '#0a0a0a',- opacity = 0.4-}) => {- return (- <div- className="fixed inset-0 w-screen h-screen overflow-hidden"- style={{ backgroundColor }}- >- <svg- className="absolute inset-0 w-full h-full"- style={{ opacity }}- preserveAspectRatio="xMidYMid slice"- >- <defs>- <pattern- id="geometric-grid"- x="0"- y="0"- width={gridSize}- height={gridSize}- patternUnits="userSpaceOnUse"- >- <line- x1="0"- y1="0"- x2={gridSize}- y2={gridSize}- stroke={lineColor}- strokeWidth="1"- opacity="0.8"- />- <line- x1={gridSize}- y1="0"- x2="0"- y2={gridSize}- stroke={lineColor}- strokeWidth="1"- opacity="0.8"- />- </pattern>- </defs>- <rect width="100%" height="100%" fill="url(#geometric-grid)" />- </svg>-- <div className="relative z-10 w-full h-full">- {children}+const App: React.FC = () => {+ const { session, isLoading } = useAuth();+ const [currentScreen, setCurrentScreen] = useState<Screen>('login');++ // Auto-navigation based on authentication state+ useEffect(() => {+ console.log('App.tsx useEffect triggered:', {+ session: session?.authenticated,+ isLoading,+ currentScreen,+ userType: session?.user_type+ });++ if (!isLoading) {+ if (session?.authenticated) {+ console.log('Session is authenticated, redirecting to dashboard');+ setCurrentScreen('dashboard');+ } else {+ console.log('Session not authenticated, staying on auth screens');+ if (currentScreen === 'dashboard') {+ setCurrentScreen('login');+ }+ }+ }+ }, [session, isLoading, currentScreen]);++ // Show loading screen while checking authentication+ if (isLoading) {+ return (+ <div className="min-h-screen bg-black relative overflow-hidden flex items-center justify-center" style={{ minHeight: '100vh', height: '100%' }}>+ <BackgroundPattern />+ <div className="relative z-10 text-center">+ <div className="w-8 h-8 border-2 border-white/30 border-t-white rounded-full animate-spin mx-auto mb-4"></div>+ <p className="text-zinc-400 text-sm">Initializing Fincept Terminal...</p>+ </div></div>- </div>- );-};--const LoginForm: React.FC = () => {- const [showPassword, setShowPassword] = useState(false);- const [email, setEmail] = useState('');- const [password, setPassword] = useState('');- const [isLoading, setIsLoading] = useState(false);-- const handleLogin = async () => {- setIsLoading(true);-- // Simulate login API call- setTimeout(() => {- setIsLoading(false);- console.log('Login attempt:', { email, password });- }, 2000);+ );+ }++ // If authenticated, show dashboard without header/footer+ if (session?.authenticated && currentScreen === 'dashboard') {+ return <DashboardScreen />;+ }++ // Authentication and info screens with header/footer+ const renderCurrentScreen = () => {+ switch (currentScreen) {+ case 'login':+ return <LoginScreen onNavigate={setCurrentScreen} />;+ case 'register':+ return <RegisterScreen onNavigate={setCurrentScreen} />;+ case 'forgotPassword':+ return <ForgotPasswordScreen onNavigate={setCurrentScreen} />;+ case 'help':+ return <HelpScreen onNavigate={setCurrentScreen} />;+ case 'contactUs':+ return <ContactUsScreen onNavigate={setCurrentScreen} />;+ case 'termsOfService':+ return <TermsOfServiceScreen onNavigate={setCurrentScreen} />;+ case 'trademarks':+ return <TrademarksScreen onNavigate={setCurrentScreen} />;+ case 'privacyPolicy':+ return <PrivacyPolicyScreen onNavigate={setCurrentScreen} />;+ default:+ return <LoginScreen onNavigate={setCurrentScreen} />;+ }};return (- <div className="w-full max-w-md">- <Card className="bg-black/60 backdrop-blur-lg border-gray-700/50 shadow-2xl">- <CardHeader className="space-y-1 pb-6">- <div className="flex items-center justify-center mb-6">- <div className="flex items-center space-x-3">- <div className="p-2 bg-gradient-to-r from-blue-500 to-purple-600 rounded-lg">- <TrendingUp className="h-8 w-8 text-white" />- </div>- <div>- <h1 className="text-3xl font-bold text-white">Fincept</h1>- <p className="text-xs text-gray-400 uppercase tracking-wider">Terminal</p>- </div>- </div>- </div>- <CardTitle className="text-2xl text-center text-white font-semibold">- Welcome back- </CardTitle>- <CardDescription className="text-center text-gray-300 text-sm">- Enter your credentials to access your financial terminal- </CardDescription>- </CardHeader>-- <CardContent className="space-y-6">- <div className="space-y-2">- <Label htmlFor="email" className="text-gray-200 text-sm font-medium">- Email Address- </Label>- <Input- id="email"- type="email"- placeholder="[email protected]"- value={email}- onChange={(e) => setEmail(e.target.value)}- className="h-11 bg-gray-900/70 border-gray-600/50 text-white placeholder-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 transition-all"- />- </div>+ <div className="min-h-screen bg-black relative overflow-hidden flex flex-col" style={{ minHeight: '100vh', height: '100%' }}>+ <BackgroundPattern />+ <Header onNavigate={setCurrentScreen} />- <div className="space-y-2">- <Label htmlFor="password" className="text-gray-200 text-sm font-medium">- Password- </Label>- <div className="relative">- <Input- id="password"- type={showPassword ? "text" : "password"}- placeholder="Enter your password"- value={password}- onChange={(e) => setPassword(e.target.value)}- className="h-11 bg-gray-900/70 border-gray-600/50 text-white placeholder-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 pr-11 transition-all"- />- <Button- type="button"- onClick={() => setShowPassword(!showPassword)}- className="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-200 bg-transparent hover:bg-transparent p-0 h-auto border-0"- >- {showPassword ? <EyeOff className="h-4 w-4" /> : <Eye className="h-4 w-4" />}- </Button>- </div>- </div>-- <div className="flex items-center justify-between pt-2">- <div className="flex items-center space-x-2">- <input- type="checkbox"- id="remember"- className="w-4 h-4 rounded border-gray-600 bg-gray-900/50 text-blue-600 focus:ring-blue-500 focus:ring-1"- />- <label htmlFor="remember" className="text-sm text-gray-300 cursor-pointer">- Remember me- </label>- </div>- <Button- variant="link"- className="text-blue-400 hover:text-blue-300 p-0 h-auto text-sm font-medium"- >- Forgot password?- </Button>- </div>- </CardContent>-- <CardFooter className="flex flex-col space-y-4 pt-6">- <Button- onClick={handleLogin}- className="w-full h-11 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white font-medium transition-all duration-200 shadow-lg"- disabled={isLoading}- >- {isLoading ? (- <div className="flex items-center space-x-2">- <div className="w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"></div>- <span>Signing in...</span>- </div>- ) : (- "Sign in to Terminal"- )}- </Button>-- <div className="text-center text-sm text-gray-400">- Don't have an account?{" "}- <Button variant="link" className="text-blue-400 hover:text-blue-300 p-0 h-auto font-medium">- Sign up for free- </Button>- </div>- </CardFooter>- </Card>- </div>- );-};--const FeatureCard: React.FC<{ icon: React.ReactNode; title: string; description: string }> = ({- icon,- title,- description-}) => (- <div className="p-6 bg-black/40 backdrop-blur-sm border border-gray-700/50 rounded-lg hover:border-gray-600/50 transition-colors">- <div className="flex items-center space-x-3 mb-3">- <div className="p-2 bg-gray-800/50 rounded-lg">- {icon}+ <div className="relative z-10 flex items-center justify-center flex-1">+ {renderCurrentScreen()}</div>- <h3 className="text-white font-semibold">{title}</h3>- </div>- <p className="text-gray-400 text-sm">{description}</p>- </div>-);--const App: React.FC = () => {- return (- <GeometricPattern>- <div className="min-h-screen w-full">- {/* Desktop Layout */}- <div className="hidden lg:flex">- {/* Left Panel - Features */}- <div className="flex-1 flex items-center justify-center p-12">- <div className="max-w-lg">- <div className="mb-12">- <h2 className="text-4xl font-bold text-white mb-4">- Professional Financial Analysis- </h2>- <p className="text-gray-300 text-lg">- Advanced tools and real-time data for informed investment decisions- </p>- </div>-- <div className="space-y-6">- <FeatureCard- icon={<BarChart3 className="h-5 w-5 text-blue-400" />}- title="Market Analysis"- description="Real-time market data with advanced charting and technical indicators"- />- <FeatureCard- icon={<PieChart className="h-5 w-5 text-green-400" />}- title="Portfolio Management"- description="Track and optimize your investment portfolio with detailed analytics"- />- <FeatureCard- icon={<LineChart className="h-5 w-5 text-purple-400" />}- title="Risk Assessment"- description="Comprehensive risk analysis tools to protect your investments"- />- </div>- </div>- </div>- {/* Right Panel - Login */}- <div className="flex-1 flex items-center justify-center p-12">- <LoginForm />- </div>- </div>-- {/* Mobile/Tablet Layout */}- <div className="lg:hidden flex flex-col min-h-screen">- {/* Header */}- <div className="flex-shrink-0 p-6 text-center">- <div className="flex items-center justify-center space-x-3 mb-4">- <div className="p-2 bg-gradient-to-r from-blue-500 to-purple-600 rounded-lg">- <TrendingUp className="h-6 w-6 text-white" />- </div>- <div>- <h1 className="text-2xl font-bold text-white">Fincept Terminal</h1>- </div>- </div>- <p className="text-gray-300 text-sm">Professional Financial Analysis Platform</p>- </div>-- {/* Content */}- <div className="flex-1 flex items-center justify-center p-6">- <div className="w-full max-w-sm">- <LoginForm />- </div>- </div>-- {/* Features - Mobile */}- <div className="flex-shrink-0 p-6 space-y-4">- <div className="grid grid-cols-1 sm:grid-cols-3 gap-4">- <div className="text-center p-4 bg-black/40 backdrop-blur-sm border border-gray-700/50 rounded-lg">- <BarChart3 className="h-6 w-6 text-blue-400 mx-auto mb-2" />- <h4 className="text-white font-medium text-sm">Market Data</h4>- </div>- <div className="text-center p-4 bg-black/40 backdrop-blur-sm border border-gray-700/50 rounded-lg">- <PieChart className="h-6 w-6 text-green-400 mx-auto mb-2" />- <h4 className="text-white font-medium text-sm">Portfolio</h4>- </div>- <div className="text-center p-4 bg-black/40 backdrop-blur-sm border border-gray-700/50 rounded-lg">- <LineChart className="h-6 w-6 text-purple-400 mx-auto mb-2" />- <h4 className="text-white font-medium text-sm">Analytics</h4>- </div>- </div>- </div>- </div>- </div>- </GeometricPattern>+ <Footer onNavigate={setCurrentScreen} />+ </div>);};diff --git a/fincept-terminal-desktop/src/components/ChatApp.tsx b/fincept-terminal-desktop/src/components/ChatApp.tsxdeleted file mode 100644index 8318f4ccd..000000000--- a/fincept-terminal-desktop/src/components/ChatApp.tsx+++ /dev/null@@ -1,555 +0,0 @@-import React, { useState, useEffect, useRef } from 'react';-import { Button } from '@/components/ui/button';-import { Textarea } from '@/components/ui/textarea';-import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';-import { ScrollArea } from '@/components/ui/scroll-area';-import { Badge } from '@/components/ui/badge';-import { Progress } from '@/components/ui/progress';-import { toast } from 'sonner';-import { Toaster } from '@/components/ui/sonner';-import {- Bot, Play, Brain, Target, Search, Calculator, CheckCircle,- AlertCircle, Settings, Copy, Trash2-} from 'lucide-react';--interface AgentTask {- id: string;- goal: string;- status: 'idle' | 'planning' | 'executing' | 'completed' | 'failed';- progress: number;- thoughts: string[];- actions: Array<{- type: string;- description: string;- result: string;- timestamp: string;- }>;- result?: string;- createdAt: string;-}--const OllamaAgentSystem = () => {- const [tasks, setTasks] = useState<AgentTask[]>([]);- const [inputGoal, setInputGoal] = useState('');- const [activeTaskId, setActiveTaskId] = useState<string | null>(null);- const [isRunning, setIsRunning] = useState(false);- const [ollamaHost, setOllamaHost] = useState('http://localhost:11434');- const [model, setModel] = useState('llama3.2:3b');-- // Ollama API Integration- const callOllama = async (prompt: string, system?: string): Promise<string> => {- try {- const response = await fetch(`${ollamaHost}/api/generate`, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({- model: model,- prompt: prompt,- system: system || "You are a helpful AI assistant that can research, analyze, and provide detailed responses.",- stream: false,- options: {- temperature: 0.7,- top_k: 40,- top_p: 0.9- }- })- });-- if (!response.ok) {- throw new Error(`Ollama API error: ${response.status}`);- }-- const data = await response.json();- return data.response || '';- } catch (error) {- console.error('Ollama API call failed:', error);- throw new Error(`Failed to connect to Ollama: ${error}`);- }- };-- // Agent Tools- const searchTool = async (query: string): Promise<string> => {- const prompt = `Research and provide comprehensive information about: ${query}--Please provide:-1. Key facts and current information-2. Important statistics or data points-3. Recent developments or trends-4. Multiple perspectives if applicable-5. Reliable sources or references--Format your response as a detailed research summary.`;-- return await callOllama(prompt, "You are a research specialist. Provide comprehensive, factual information with proper analysis.");- };-- const analyzeTool = async (data: string, context: string): Promise<string> => {- const prompt = `Analyze the following information in the context of: ${context}--Data to analyze:-${data}--Please provide:-1. Key insights and patterns-2. Important conclusions-3. Implications and significance-4. Recommendations based on analysis-5. Areas requiring further investigation`;-- return await callOllama(prompt, "You are a data analyst. Provide thorough analysis with clear insights and actionable conclusions.");- };-- const planTool = async (goal: string): Promise<string> => {- const prompt = `Create a detailed execution plan for this goal: ${goal}--Provide:-1. Step-by-step breakdown of tasks-2. Required information or research needed-3. Logical sequence of actions-4. Success criteria-5. Potential challenges and solutions--Format as a clear, actionable plan.`;-- return await callOllama(prompt, "You are a strategic planner. Create comprehensive, practical plans that lead to goal achievement.");- };-- const reasonTool = async (information: string, goal: string): Promise<string> => {- const prompt = `Based on all the information gathered, provide reasoning and conclusions for: ${goal}--Available information:-${information}--Please provide:-1. Logical synthesis of all information-2. Clear conclusions and insights-3. Recommendations and next steps-4. Confidence level in conclusions-5. Final answer or solution`;-- return await callOllama(prompt, "You are a reasoning specialist. Synthesize information logically and provide clear, well-reasoned conclusions.");- };-- // Agent Execution Engine- const executeAgent = async (task: AgentTask) => {- const updateTask = (updates: Partial<AgentTask>) => {- setTasks(prev => prev.map(t => t.id === task.id ? { ...t, ...updates } : t));- };-- try {- setIsRunning(true);- updateTask({ status: 'planning', progress: 10 });-- // Step 1: Planning- const planResult = await planTool(task.goal);- updateTask({- actions: [...task.actions, {- type: 'planning',- description: 'Created execution plan',- result: planResult,- timestamp: new Date().toISOString()- }],- thoughts: [...task.thoughts, "Created detailed execution plan"],- progress: 25- });-- updateTask({ status: 'executing' });-- // Step 2: Research/Information Gathering- const searchResult = await searchTool(task.goal);- updateTask({- actions: [...task.actions, {- type: 'research',- description: 'Gathered relevant information',- result: searchResult,- timestamp: new Date().toISOString()- }],- thoughts: [...task.thoughts, "Completed information gathering phase"],- progress: 50- });-- // Step 3: Analysis- const analysisResult = await analyzeTool(searchResult, task.goal);- updateTask({- actions: [...task.actions, {- type: 'analysis',- description: 'Analyzed collected information',- result: analysisResult,- timestamp: new Date().toISOString()- }],- thoughts: [...task.thoughts, "Performed comprehensive analysis"],- progress: 75- });-- // Step 4: Final Reasoning and Conclusion- const combinedInfo = `Plan: ${planResult}\n\nResearch: ${searchResult}\n\nAnalysis: ${analysisResult}`;- const finalResult = await reasonTool(combinedInfo, task.goal);-- updateTask({- status: 'completed',- progress: 100,- result: finalResult,- actions: [...task.actions, {- type: 'conclusion',- description: 'Generated final conclusions',- result: finalResult,- timestamp: new Date().toISOString()- }],- thoughts: [...task.thoughts, "Task completed successfully"]- });-- toast.success('Agent task completed!', { duration: 5000 });-- } catch (error) {- console.error('Agent execution failed:', error);- updateTask({- status: 'failed',- thoughts: [...task.thoughts, `Error: ${error}`]- });- toast.error('Agent task failed', {- description: error instanceof Error ? error.message : 'Unknown error',- duration: 5000- });- } finally {- setIsRunning(false);- }- };-- const deployAgent = async () => {- if (!inputGoal.trim() || isRunning) return;-- const task: AgentTask = {- id: Date.now().toString(),- goal: inputGoal,- status: 'idle',- progress: 0,- thoughts: [],- actions: [],- createdAt: new Date().toISOString()- };-- setTasks(prev => [task, ...prev]);- setActiveTaskId(task.id);- setInputGoal('');-- toast.success('Agent deployed!', { description: 'Starting autonomous execution' });-- // Start execution- setTimeout(() => executeAgent(task), 1000);- };-- const deleteTask = (taskId: string) => {- setTasks(prev => prev.filter(t => t.id !== taskId));- if (activeTaskId === taskId) setActiveTaskId(null);- toast.success('Task deleted');- };-- const copyResult = (result: string) => {- navigator.clipboard.writeText(result);- toast.success('Result copied to clipboard');- };-- // Test Ollama Connection- const testConnection = async () => {- try {- toast.info('Testing Ollama connection...');- await callOllama('Hello, are you working?');- toast.success('Ollama connection successful!');- } catch (error) {- toast.error('Ollama connection failed', {- description: 'Make sure Ollama is running and the model is available'- });- }- };-- const activeTask = tasks.find(t => t.id === activeTaskId);-- return (- <div className="h-screen flex bg-black text-green-400 font-mono">- <Toaster position="top-right" theme="dark" />-- {/* Tasks Sidebar */}- <div className="w-80 border-r border-green-600/30 bg-gray-950">- <Card className="h-full bg-transparent border-none">- <CardHeader className="pb-3">- <CardTitle className="text-green-400 text-sm flex items-center gap-2">- <Bot className="w-4 h-4" />- OLLAMA AGENTS- </CardTitle>- </CardHeader>- <CardContent className="p-0">- <ScrollArea className="h-[calc(100vh-100px)]">- <div className="px-4 space-y-3">- {tasks.length === 0 ? (- <div className="text-center py-12 text-gray-500">- <Brain className="w-12 h-12 mx-auto mb-3" />- <p className="text-sm">No Agents Deployed</p>- </div>- ) : (- tasks.map((task) => (- <Card- key={task.id}- className={`cursor-pointer transition-all ${- activeTaskId === task.id ? 'bg-green-600/10 border-green-600/50' : 'bg-gray-900/50 border-gray-700/50'- }`}- onClick={() => setActiveTaskId(task.id)}- >- <CardContent className="p-3">- <div className="flex items-start justify-between mb-2">- <div className="flex-1 min-w-0">- <h3 className="text-sm font-medium text-green-400 truncate">- {task.goal}- </h3>- <Badge className={`h-5 text-xs mt-1 ${- task.status === 'completed' ? 'bg-green-600' :- task.status === 'executing' || task.status === 'planning' ? 'bg-yellow-600' :- task.status === 'failed' ? 'bg-red-600' : 'bg-gray-600'- }`}>- {task.status.toUpperCase()}- </Badge>- </div>- <Button- variant="ghost"- size="sm"- className="h-6 w-6 p-0 hover:bg-red-600/20"- onClick={(e) => {- e.stopPropagation();- deleteTask(task.id);- }}- >- <Trash2 className="w-3 h-3" />- </Button>- </div>- <Progress value={task.progress} className="h-2 bg-gray-800" />- {task.result && (- <Button- size="sm"- variant="outline"- onClick={(e) => {- e.stopPropagation();- copyResult(task.result!);- }}- className="w-full h-6 text-xs border-green-600 text-green-400 mt-2"- >- <Copy className="w-3 h-3 mr-1" />- Copy Result- </Button>- )}- </CardContent>- </Card>- ))- )}- </div>- </ScrollArea>- </CardContent>- </Card>- </div>-- {/* Main Area */}- <div className="flex-1 flex flex-col">- {/* Header */}- <div className="border-b border-green-600/30 p-4 bg-gray-950">- <div className="flex items-center justify-between">- <div className="flex items-center space-x-3">- <h1 className="text-green-400 font-bold text-lg">OLLAMA AGENT SYSTEM</h1>- <Badge variant="outline" className={`${- isRunning ? 'border-yellow-500 text-yellow-400' : 'border-green-500 text-green-400'- }`}>- <div className={`w-2 h-2 rounded-full mr-2 ${- isRunning ? 'bg-yellow-500 animate-pulse' : 'bg-green-500'- }`}></div>- {isRunning ? 'WORKING' : 'READY'}- </Badge>- </div>- <div className="text-sm text-gray-400">- Model: {model}- </div>- </div>- </div>-- {/* Content Area */}- <div className="flex-1 overflow-hidden">- <ScrollArea className="h-full">- <div className="p-4">- {activeTask ? (- <div className="space-y-4">- {/* Task Overview */}- <Card className="bg-gray-900/50 border-gray-700/50">- <CardHeader>- <CardTitle className="text-green-400 flex items-center gap-2">- <Target className="w-5 h-5" />- {activeTask.goal}- </CardTitle>- </CardHeader>- <CardContent>- <Progress value={activeTask.progress} className="h-3 bg-gray-800" />- <p className="text-xs text-gray-400 mt-2">- Progress: {activeTask.progress}% | Status: {activeTask.status}- </p>- </CardContent>- </Card>-- {/* Agent Actions */}- {activeTask.actions.map((action, index) => (- <Card key={index} className="bg-gray-900/50 border-gray-700/50">- <CardContent className="p-4">- <div className="flex items-start gap-3">- <div className="p-2 rounded-full bg-green-600/20">- {action.type === 'planning' && <Target className="w-4 h-4" />}- {action.type === 'research' && <Search className="w-4 h-4" />}- {action.type === 'analysis' && <Brain className="w-4 h-4" />}- {action.type === 'conclusion' && <CheckCircle className="w-4 h-4" />}- </div>- <div className="flex-1">- <h4 className="text-green-400 font-medium mb-2">- {action.description}- </h4>- <div className="bg-gray-800/50 p-3 rounded border border-gray-700">- <pre className="text-xs text-gray-300 whitespace-pre-wrap max-h-64 overflow-y-auto">- {action.result}- </pre>- </div>- <p className="text-xs text-gray-600 mt-2">- {new Date(action.timestamp).toLocaleString()}- </p>- </div>- </div>- </CardContent>- </Card>- ))}-- {/* Final Result */}- {activeTask.result && (- <Card className="bg-green-600/10 border-green-600/30">- <CardHeader>- <CardTitle className="text-green-400 flex items-center gap-2">- <CheckCircle className="w-5 h-5" />- Final Result- </CardTitle>- </CardHeader>- <CardContent>- <div className="bg-gray-900/50 p-4 rounded border border-gray-700 mb-3">- <pre className="text-sm text-gray-100 whitespace-pre-wrap">- {activeTask.result}- </pre>- </div>- <Button- onClick={() => copyResult(activeTask.result!)}- className="bg-green-600 hover:bg-green-700"- >- <Copy className="w-4 h-4 mr-2" />- Copy Result- </Button>- </CardContent>- </Card>- )}- </div>- ) : (- <div className="flex items-center justify-center h-full min-h-[500px]">- <div className="text-center max-w-md">- <Bot className="w-20 h-20 mx-auto mb-6 text-green-400" />- <h2 className="text-2xl font-semibold text-green-400 mb-3">- Ollama Agent System- </h2>- <p className="text-gray-400 mb-6">- Deploy autonomous agents powered by local LLM for research, analysis, and task execution- </p>- </div>- </div>- )}- </div>- </ScrollArea>- </div>-- {/* Deploy Interface */}- <div className="border-t border-green-600/30 p-4 bg-gray-950">- <div className="space-y-3">- <Textarea- value={inputGoal}- onChange={(e) => setInputGoal(e.target.value)}- placeholder="Enter agent goal: 'Research the latest trends in artificial intelligence' or 'Analyze the benefits of renewable energy'"- className="min-h-[60px] bg-gray-900 border-gray-700 text-white"- disabled={isRunning}- />- <div className="flex gap-3">- <Button- onClick={deployAgent}- disabled={isRunning || !inputGoal.trim()}- className="bg-green-600 hover:bg-green-700 flex-1"- >- {isRunning ? (- <>- <Brain className="w-4 h-4 animate-pulse mr-2" />- WORKING...- </>- ) : (- <>- <Play className="w-4 h-4 mr-2" />- DEPLOY AGENT- </>- )}- </Button>- <Button onClick={testConnection} variant="outline" className="border-green-600">- Test Connection- </Button>- </div>- </div>- </div>- </div>-- {/* Settings */}- <div className="w-72 border-l border-green-600/30 bg-gray-950 p-4">- <div className="space-y-4">- <div className="flex items-center gap-2 mb-4">- <Settings className="w-4 h-4" />- <span className="text-sm font-medium">OLLAMA CONFIG</span>- </div>-- <div className="space-y-3">- <div>- <label className="text-xs text-gray-400 block mb-1">HOST</label>- <input- type="text"- value={ollamaHost}- onChange={(e) => setOllamaHost(e.target.value)}- className="w-full px-2 py-1 bg-gray-900 border border-gray-700 rounded text-white text-xs"- placeholder="http://localhost:11434"- />- </div>-- <div>- <label className="text-xs text-gray-400 block mb-1">MODEL</label>- <input- type="text"- value={model}- onChange={(e) => setModel(e.target.value)}- className="w-full px-2 py-1 bg-gray-900 border border-gray-700 rounded text-white text-xs"- placeholder="llama3.2:3b"- />- </div>- </div>-- <div className="pt-4 border-t border-gray-800">- <h4 className="text-xs font-medium mb-2">STATUS</h4>- <div className="space-y-1 text-xs text-gray-400">- <div className="flex justify-between">- <span>Active:</span>- <span>{isRunning ? 'Yes' : 'No'}</span>- </div>- <div className="flex justify-between">- <span>Tasks:</span>- <span>{tasks.length}</span>- </div>- <div className="flex justify-between">- <span>Completed:</span>- <span className="text-green-400">{tasks.filter(t => t.status === 'completed').length}</span>- </div>- </div>- </div>- </div>- </div>- </div>- );-};--export default OllamaAgentSystem;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/auth/ForgotPasswordScreen.tsx b/fincept-terminal-desktop/src/components/auth/ForgotPasswordScreen.tsxnew file mode 100644index 000000000..2539ea234--- /dev/null+++ b/fincept-terminal-desktop/src/components/auth/ForgotPasswordScreen.tsx@@ -0,0 +1,415 @@+// File: src/components/auth/ForgotPasswordScreen.tsx+// Complete password reset flow with email submission, OTP verification, and password reset++import React, { useState } from 'react';+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";+import { ArrowLeft, Mail, Key, Eye, EyeOff } from "lucide-react";+import { Screen } from '../../App';+import { AuthApiService } from '@/services/authApi';++interface ForgotPasswordScreenProps {+ onNavigate: (screen: Screen) => void;+}++type ResetStep = 'email' | 'otp-sent' | 'reset-form' | 'success';++const ForgotPasswordScreen: React.FC<ForgotPasswordScreenProps> = ({ onNavigate }) => {+ const [step, setStep] = useState<ResetStep>('email');+ const [email, setEmail] = useState("");+ const [otp, setOtp] = useState("");+ const [newPassword, setNewPassword] = useState("");+ const [confirmPassword, setConfirmPassword] = useState("");+ const [showPassword, setShowPassword] = useState(false);+ const [isLoading, setIsLoading] = useState(false);+ const [error, setError] = useState("");++ const handleEmailSubmit = async (e: React.FormEvent) => {+ e.preventDefault();++ if (!email) {+ setError("Please enter your email address");+ return;+ }++ setIsLoading(true);+ setError("");++ try {+ console.log('Requesting password reset for:', email);++ const result = await AuthApiService.forgotPassword({ email });++ if (result.success) {+ console.log('Password reset OTP sent successfully');+ setStep('otp-sent');+ } else {+ console.log('Password reset request failed:', result.error);+ setError(result.error || 'Failed to send reset code. Please try again.');+ }+ } catch (err) {+ console.error('Password reset request error:', err);+ setError("An unexpected error occurred. Please try again.");+ } finally {+ setIsLoading(false);+ }+ };++ const handleContinueToReset = () => {+ setStep('reset-form');+ setError("");+ };++ const handlePasswordReset = async (e: React.FormEvent) => {+ e.preventDefault();++ if (!otp) {+ setError("Please enter the verification code");+ return;+ }++ if (!newPassword) {+ setError("Please enter a new password");+ return;+ }++ if (newPassword.length < 8) {+ setError("Password must be at least 8 characters long");+ return;+ }++ if (newPassword !== confirmPassword) {+ setError("Passwords do not match");+ return;+ }++ setIsLoading(true);+ setError("");++ try {+ console.log('Resetting password for:', email);++ const result = await AuthApiService.resetPassword({+ email,+ otp,+ new_password: newPassword+ });++ if (result.success) {+ console.log('Password reset successful');+ setStep('success');+ } else {+ console.log('Password reset failed:', result.error);+ setError(result.error || 'Failed to reset password. Please check your code and try again.');+ }+ } catch (err) {+ console.error('Password reset error:', err);+ setError("An unexpected error occurred. Please try again.");+ } finally {+ setIsLoading(false);+ }+ };++ const handleResendOtp = async () => {+ setIsLoading(true);+ setError("");++ try {+ const result = await AuthApiService.forgotPassword({ email });++ if (result.success) {+ setError(""); // Clear any previous errors+ // You could show a success message here if needed+ } else {+ setError(result.error || 'Failed to resend code. Please try again.');+ }+ } catch (err) {+ setError("Failed to resend code. Please try again.");+ } finally {+ setIsLoading(false);+ }+ };++ // Step 1: Email Input+ if (step === 'email') {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">+ <div className="mb-6">+ <div className="flex items-center mb-3">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Reset Password</h2>+ </div>+ <p className="text-zinc-400 text-xs leading-5">+ Enter your email address and we'll send you a verification code to reset your password.+ </p>+ </div>++ <form onSubmit={handleEmailSubmit} className="space-y-4">+ <div className="space-y-1">+ <Label htmlFor="resetEmail" className="text-white text-xs">+ Email Address+ </Label>+ <div className="relative">+ <Mail className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="resetEmail"+ type="email"+ placeholder="Enter your email"+ value={email}+ onChange={(e) => {+ setEmail(e.target.value);+ if (error) setError("");+ }}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ required+ />+ </div>+ </div>++ {error && (+ <div className="text-red-400 text-xs bg-red-900/20 border border-red-900/50 rounded p-2">+ {error}+ </div>+ )}++ <div className="flex justify-end pt-2">+ <Button+ type="submit"+ className="bg-zinc-700 hover:bg-zinc-600 text-white px-6 py-1.5 text-sm font-normal transition-colors disabled:opacity-50"+ disabled={isLoading}+ >+ {isLoading ? (+ <div className="flex items-center">+ <div className="w-3 h-3 border border-white/30 border-t-white rounded-full animate-spin mr-1.5"></div>+ Sending...+ </div>+ ) : "Send Code"}+ </Button>+ </div>+ </form>++ <div className="mt-5 pt-4 border-t border-zinc-700 text-center">+ <p className="text-zinc-400 text-xs">+ Remember your password?{" "}+ <button+ type="button"+ onClick={() => onNavigate('login')}+ className="text-blue-400 hover:text-blue-300 transition-colors"+ disabled={isLoading}+ >+ Sign In+ </button>+ </p>+ </div>+ </div>+ );+ }++ // Step 2: OTP Sent Confirmation+ if (step === 'otp-sent') {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">+ <div className="text-center mb-6">+ <div className="mb-4">+ <div className="w-12 h-12 bg-blue-600/20 rounded-full flex items-center justify-center mx-auto mb-4">+ <Mail className="w-6 h-6 text-blue-400" />+ </div>+ <h2 className="text-white text-2xl font-light mb-3">Check Your Email</h2>+ <p className="text-zinc-400 text-xs leading-5">+ We've sent a verification code to <span className="text-white">{email}</span>.+ Enter the code below to reset your password.+ </p>+ </div>+ </div>++ <div className="space-y-4">+ <Button+ onClick={handleContinueToReset}+ className="bg-zinc-700 hover:bg-zinc-600 text-white px-6 py-1.5 text-sm font-normal transition-colors w-full"+ >+ I Have the Code+ </Button>++ <div className="text-center space-y-2">+ <button+ onClick={handleResendOtp}+ className="text-blue-400 hover:text-blue-300 text-xs transition-colors"+ disabled={isLoading}+ >+ {isLoading ? "Sending..." : "Didn't receive the code? Resend"}+ </button>+ <br />+ <button+ onClick={() => setStep('email')}+ className="text-zinc-400 hover:text-zinc-300 text-xs transition-colors"+ >+ Use a different email+ </button>+ </div>+ </div>++ {error && (+ <div className="text-red-400 text-xs bg-red-900/20 border border-red-900/50 rounded p-2 mt-4">+ {error}+ </div>+ )}+ </div>+ );+ }++ // Step 3: Reset Form (OTP + New Password)+ if (step === 'reset-form') {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">+ <div className="mb-6">+ <div className="flex items-center mb-3">+ <button+ onClick={() => setStep('otp-sent')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Reset Password</h2>+ </div>+ <p className="text-zinc-400 text-xs leading-5">+ Enter the verification code and your new password.+ </p>+ </div>++ <form onSubmit={handlePasswordReset} className="space-y-4">+ <div className="space-y-1">+ <Label htmlFor="otp" className="text-white text-xs">+ Verification Code+ </Label>+ <div className="relative">+ <Key className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="otp"+ type="text"+ placeholder="Enter code from email"+ value={otp}+ onChange={(e) => {+ setOtp(e.target.value);+ if (error) setError("");+ }}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ required+ />+ </div>+ </div>++ <div className="space-y-1">+ <Label htmlFor="newPassword" className="text-white text-xs">+ New Password+ </Label>+ <div className="relative">+ <Input+ id="newPassword"+ type={showPassword ? "text" : "password"}+ placeholder="Enter new password"+ value={newPassword}+ onChange={(e) => {+ setNewPassword(e.target.value);+ if (error) setError("");+ }}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pr-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ required+ minLength={8}+ />+ <button+ type="button"+ onClick={() => setShowPassword(!showPassword)}+ className="absolute right-2.5 top-1/2 transform -translate-y-1/2 text-zinc-400 hover:text-zinc-300"+ >+ {showPassword ? <EyeOff className="h-3.5 w-3.5" /> : <Eye className="h-3.5 w-3.5" />}+ </button>+ </div>+ </div>++ <div className="space-y-1">+ <Label htmlFor="confirmPassword" className="text-white text-xs">+ Confirm Password+ </Label>+ <Input+ id="confirmPassword"+ type={showPassword ? "text" : "password"}+ placeholder="Confirm new password"+ value={confirmPassword}+ onChange={(e) => {+ setConfirmPassword(e.target.value);+ if (error) setError("");+ }}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ required+ />+ </div>++ {error && (+ <div className="text-red-400 text-xs bg-red-900/20 border border-red-900/50 rounded p-2">+ {error}+ </div>+ )}++ <div className="flex justify-end pt-2">+ <Button+ type="submit"+ className="bg-zinc-700 hover:bg-zinc-600 text-white px-6 py-1.5 text-sm font-normal transition-colors disabled:opacity-50"+ disabled={isLoading}+ >+ {isLoading ? (+ <div className="flex items-center">+ <div className="w-3 h-3 border border-white/30 border-t-white rounded-full animate-spin mr-1.5"></div>+ Resetting...+ </div>+ ) : "Reset Password"}+ </Button>+ </div>+ </form>+ </div>+ );+ }++ // Step 4: Success+ if (step === 'success') {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">+ <div className="text-center mb-6">+ <div className="mb-4">+ <div className="w-12 h-12 bg-green-600/20 rounded-full flex items-center justify-center mx-auto mb-4">+ <svg className="w-6 h-6 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />+ </svg>+ </div>+ <h2 className="text-white text-2xl font-light mb-3">Password Reset</h2>+ <p className="text-zinc-400 text-xs leading-5">+ Your password has been successfully reset. You can now sign in with your new password.+ </p>+ </div>+ </div>++ <div className="space-y-4">+ <Button+ onClick={() => onNavigate('login')}+ className="bg-zinc-700 hover:bg-zinc-600 text-white px-6 py-1.5 text-sm font-normal transition-colors w-full"+ >+ Continue to Login+ </Button>+ </div>+ </div>+ );+ }++ return null;+};++export default ForgotPasswordScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/auth/HelpScreen.tsx b/fincept-terminal-desktop/src/components/auth/HelpScreen.tsxnew file mode 100644index 000000000..3c17a3726--- /dev/null+++ b/fincept-terminal-desktop/src/components/auth/HelpScreen.tsx@@ -0,0 +1,162 @@+// File: src/components/auth/HelpScreen.tsx+// Help center screen with FAQ, quick actions, and contact information++import React from 'react';+import { Button } from "@/components/ui/button";+import { ArrowLeft, Mail, Phone } from "lucide-react";+import { Screen } from '../../App';++interface HelpScreenProps {+ onNavigate: (screen: Screen) => void;+}++const HelpScreen: React.FC<HelpScreenProps> = ({ onNavigate }) => {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-lg mx-4 shadow-2xl">+ <div className="mb-6">+ <div className="flex items-center mb-3">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Help Center</h2>+ </div>+ <p className="text-zinc-400 text-xs leading-5">+ Find answers to common questions and get support for your Fincept account.+ </p>+ </div>++ <div className="space-y-4">+ <div className="space-y-3">+ <h3 className="text-white text-sm font-medium">Frequently Asked Questions</h3>++ <div className="space-y-2">+ <details className="group">+ <summary className="text-zinc-300 text-xs cursor-pointer hover:text-white transition-colors list-none flex items-center justify-between p-2 bg-zinc-800/50 rounded">+ <span>How do I reset my password?</span>+ <svg className="w-3 h-3 group-open:rotate-180 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />+ </svg>+ </summary>+ <div className="mt-2 p-2 text-zinc-400 text-xs leading-relaxed">+ Click "Forgot Password" on the login screen, enter your email, and follow the reset link we send you.+ </div>+ </details>++ <details className="group">+ <summary className="text-zinc-300 text-xs cursor-pointer hover:text-white transition-colors list-none flex items-center justify-between p-2 bg-zinc-800/50 rounded">+ <span>What is Guest Access?</span>+ <svg className="w-3 h-3 group-open:rotate-180 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />+ </svg>+ </summary>+ <div className="mt-2 p-2 text-zinc-400 text-xs leading-relaxed">+ Guest Access allows you to explore Fincept with 50 API requests and 24-hour access without creating an account.+ </div>+ </details>++ <details className="group">+ <summary className="text-zinc-300 text-xs cursor-pointer hover:text-white transition-colors list-none flex items-center justify-between p-2 bg-zinc-800/50 rounded">+ <span>How do I contact support?</span>+ <svg className="w-3 h-3 group-open:rotate-180 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />+ </svg>+ </summary>+ <div className="mt-2 p-2 text-zinc-400 text-xs leading-relaxed">+ You can reach our support team at [email protected] or through the Contact Us link in the footer.+ </div>+ </details>++ <details className="group">+ <summary className="text-zinc-300 text-xs cursor-pointer hover:text-white transition-colors list-none flex items-center justify-between p-2 bg-zinc-800/50 rounded">+ <span>What is a B-Unit?</span>+ <svg className="w-3 h-3 group-open:rotate-180 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />+ </svg>+ </summary>+ <div className="mt-2 p-2 text-zinc-400 text-xs leading-relaxed">+ B-Unit is our biometric authentication device that provides an additional layer of security for your terminal access.+ </div>+ </details>++ <details className="group">+ <summary className="text-zinc-300 text-xs cursor-pointer hover:text-white transition-colors list-none flex items-center justify-between p-2 bg-zinc-800/50 rounded">+ <span>System Requirements</span>+ <svg className="w-3 h-3 group-open:rotate-180 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />+ </svg>+ </summary>+ <div className="mt-2 p-2 text-zinc-400 text-xs leading-relaxed">+ Fincept Terminal works on modern web browsers. We recommend Chrome, Firefox, Safari, or Edge for the best experience.+ </div>+ </details>+ </div>+ </div>++ <div className="space-y-3 pt-4 border-t border-zinc-700">+ <h3 className="text-white text-sm font-medium">Quick Actions</h3>+ <div className="grid grid-cols-2 gap-2">+ <button+ onClick={() => onNavigate('register')}+ className="bg-zinc-800 hover:bg-zinc-700 text-white p-3 rounded text-xs text-left transition-colors"+ >+ <div className="font-medium mb-1">Create Account</div>+ <div className="text-zinc-400">Get started with Fincept</div>+ </button>++ <button+ onClick={() => onNavigate('forgotPassword')}+ className="bg-zinc-800 hover:bg-zinc-700 text-white p-3 rounded text-xs text-left transition-colors"+ >+ <div className="font-medium mb-1">Reset Password</div>+ <div className="text-zinc-400">Recover your account</div>+ </button>+ </div>+ </div>++ <div className="space-y-3 pt-4 border-t border-zinc-700">+ <h3 className="text-white text-sm font-medium">Contact Information</h3>+ <div className="space-y-2 text-xs">+ <div className="flex items-center text-zinc-400">+ <Mail className="w-3 h-3 mr-2" />+ <span>[email protected]</span>+ </div>+ <div className="flex items-center text-zinc-400">+ <Phone className="w-3 h-3 mr-2" />+ <span>1-800-FINCEPT (346-2378)</span>+ </div>+ <div className="flex items-start text-zinc-400">+ <svg className="w-3 h-3 mr-2 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />+ </svg>+ <span>Support Hours: Mon-Fri 9AM-6PM EST</span>+ </div>+ </div>+ </div>+ </div>++ <div className="mt-6 pt-4 border-t border-zinc-700">+ <div className="flex justify-between">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white text-xs transition-colors flex items-center"+ >+ <ArrowLeft className="w-3 h-3 mr-1" />+ Back to Login+ </button>++ <Button+ onClick={() => alert('Opening live chat...')}+ className="bg-blue-600/20 hover:bg-blue-600/30 border border-blue-600/50 text-blue-400 px-3 py-1 text-xs font-normal transition-colors"+ >+ Live Chat+ </Button>+ </div>+ </div>+ </div>+ );+};++export default HelpScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/auth/LoginScreen.tsx b/fincept-terminal-desktop/src/components/auth/LoginScreen.tsxnew file mode 100644index 000000000..7a0b654f5--- /dev/null+++ b/fincept-terminal-desktop/src/components/auth/LoginScreen.tsx@@ -0,0 +1,227 @@+// File: src/components/auth/LoginScreen.tsx+// Login screen with username/password authentication and guest access++import React, { useState } from 'react';+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";+import { Monitor, Lock, Mail } from "lucide-react";+import { Screen } from '../../App';+import { AuthApiService } from '@/services/authApi';+import { useAuth } from '@/contexts/AuthContext';++interface LoginScreenProps {+ onNavigate: (screen: Screen) => void;+}++const LoginScreen: React.FC<LoginScreenProps> = ({ onNavigate }) => {+ const [formData, setFormData] = useState({+ email: "",+ password: ""+ });+ const [isLoading, setIsLoading] = useState(false);+ const [isGuestLoading, setIsGuestLoading] = useState(false);+ const [error, setError] = useState("");++ const { login, setupGuestAccess } = useAuth();++ const handleChange = (field: string, value: string) => {+ setFormData(prev => ({ ...prev, [field]: value }));+ if (error) setError("");+ };++ const handleSubmit = async (e: React.FormEvent) => {+ e.preventDefault();++ if (!formData.email || !formData.password) {+ setError("Please fill in all fields");+ return;+ }++ // Basic email validation+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;+ if (!emailRegex.test(formData.email)) {+ setError("Please enter a valid email address");+ return;+ }++ setIsLoading(true);+ setError("");++ try {+ console.log('Login attempt for:', formData.email);++ const result = await login(formData.email, formData.password);++ if (result.success) {+ console.log('Login successful');+ // The useAuth hook will handle navigation/state updates+ // You can add any post-login logic here if needed+ } else {+ console.log('Login failed:', result.error);+ setError(result.error || 'Login failed. Please check your credentials.');+ }+ } catch (err) {+ console.error('Login error:', err);+ setError("An unexpected error occurred. Please try again.");+ } finally {+ setIsLoading(false);+ }+ };++ const handleGuestAccess = async () => {+ setIsGuestLoading(true);+ setError("");++ try {+ console.log('Setting up guest access...');++ const result = await setupGuestAccess();++ if (result.success) {+ console.log('Guest access setup successful');+ // The useAuth hook will handle navigation/state updates+ } else {+ console.log('Guest access setup failed:', result.error);+ setError(result.error || 'Failed to setup guest access. Please try again.');+ }+ } catch (err) {+ console.error('Guest access error:', err);+ setError("An unexpected error occurred. Please try again.");+ } finally {+ setIsGuestLoading(false);+ }+ };++ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">+ <div className="mb-6">+ <h2 className="text-white text-2xl font-light mb-3">Login</h2>+ <p className="text-zinc-400 text-xs leading-5">+ This is a secure Fincept authentication service that allows you access to Fincept services from wherever you are.+ </p>+ </div>++ <form onSubmit={handleSubmit} className="space-y-4">+ <div className="space-y-1">+ <Label htmlFor="email" className="text-white text-xs">+ Email Address+ </Label>+ <div className="relative">+ <Mail className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="email"+ type="email"+ placeholder="Enter your email"+ value={formData.email}+ onChange={(e) => handleChange("email", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading || isGuestLoading}+ required+ />+ </div>+ </div>++ <div className="space-y-1">+ <div className="flex justify-between items-center">+ <Label htmlFor="password" className="text-white text-xs">+ Password+ </Label>+ <button+ type="button"+ onClick={() => onNavigate('forgotPassword')}+ className="text-blue-400 hover:text-blue-300 text-xs transition-colors"+ disabled={isLoading || isGuestLoading}+ >+ Forgot Password?+ </button>+ </div>+ <div className="relative">+ <Lock className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="password"+ type="password"+ placeholder="Enter your password"+ value={formData.password}+ onChange={(e) => handleChange("password", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading || isGuestLoading}+ required+ />+ </div>+ </div>++ <div className="pt-1">+ <p className="text-zinc-500 text-xs">+ Your account credentials are required to access Fincept services.+ </p>+ </div>++ {error && (+ <div className="text-red-400 text-xs bg-red-900/20 border border-red-900/50 rounded p-2">+ {error}+ </div>+ )}++ <div className="flex justify-end pt-2">+ <Button+ type="submit"+ className="bg-zinc-700 hover:bg-zinc-600 text-white px-6 py-1.5 text-sm font-normal transition-colors disabled:opacity-50"+ disabled={isLoading || isGuestLoading}+ >+ {isLoading ? (+ <div className="flex items-center">+ <div className="w-3 h-3 border border-white/30 border-t-white rounded-full animate-spin mr-1.5"></div>+ Signing In...+ </div>+ ) : "Sign In"}+ </Button>+ </div>+ </form>++ <div className="mt-5 pt-4 border-t border-zinc-700">+ <div className="text-center mb-3">+ <p className="text-zinc-400 text-xs mb-3">Want to explore first?</p>+ <Button+ onClick={handleGuestAccess}+ disabled={isLoading || isGuestLoading}+ className="bg-green-600/20 hover:bg-green-600/30 border border-green-600/50 text-green-400 px-4 py-1.5 text-xs font-normal transition-colors disabled:opacity-50 w-full"+ >+ {isGuestLoading ? (+ <div className="flex items-center justify-center">+ <div className="w-3 h-3 border border-green-400/30 border-t-green-400 rounded-full animate-spin mr-1.5"></div>+ Setting up Guest Access...+ </div>+ ) : (+ <div className="flex items-center justify-center">+ <svg className="w-3 h-3 mr-1.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 10V3L4 14h7v7l9-11h-7z" />+ </svg>+ Continue as Guest+ </div>+ )}+ </Button>+ <p className="text-zinc-500 text-xs mt-1.5">+ 50 API requests • 24-hour access • No signup required+ </p>+ </div>++ <div className="text-center">+ <p className="text-zinc-400 text-xs">+ Don't have an account?{" "}+ <button+ type="button"+ onClick={() => onNavigate('register')}+ className="text-blue-400 hover:text-blue-300 transition-colors"+ disabled={isLoading || isGuestLoading}+ >+ Create Account+ </button>+ </p>+ </div>+ </div>+ </div>+ );+};++export default LoginScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/auth/PricingScreen.tsx b/fincept-terminal-desktop/src/components/auth/PricingScreen.tsxnew file mode 100644index 000000000..3d171807f--- /dev/null+++ b/fincept-terminal-desktop/src/components/auth/PricingScreen.tsx@@ -0,0 +1,413 @@+// File: src/components/auth/PricingScreen.tsx+// Pricing screen for plan selection after login/signup++import React, { useState } from 'react';+import { Button } from "@/components/ui/button";+import { ArrowLeft, Check, Star, Zap, Crown, Rocket, Shield } from "lucide-react";+import { Screen } from '../../App';++interface PricingScreenProps {+ onNavigate: (screen: Screen) => void;+ onProceedToDashboard: (plan: PricingPlan) => void;+ userType?: 'new' | 'existing'; // new = after signup, existing = after login+}++interface PricingPlan {+ id: string;+ name: string;+ price: number;+ period: 'month';+ icon: React.ReactNode;+ description: string;+ features: string[];+ limits: {+ apiRequests: string;+ dataStreams: string;+ portfolios: string;+ alerts: string;+ history: string;+ };+ popular?: boolean;+ recommended?: boolean;+}++const PricingScreen: React.FC<PricingScreenProps> = ({+ onNavigate,+ onProceedToDashboard,+ userType = 'new'+}) => {+ const [selectedPlan, setSelectedPlan] = useState<string>('free');+ const [billingPeriod, setBillingPeriod] = useState<'monthly' | 'annually'>('monthly');+ const [isLoading, setIsLoading] = useState(false);++ const plans: PricingPlan[] = [+ {+ id: 'free',+ name: 'Free',+ price: 0,+ period: 'month',+ icon: <Shield className="w-5 h-5" />,+ description: 'Perfect for getting started with basic market data',+ features: [+ 'Basic market data access',+ 'Limited portfolio tracking',+ 'Standard charts and graphs',+ 'Email support',+ 'Basic alerts',+ ],+ limits: {+ apiRequests: '1,000/month',+ dataStreams: '5 concurrent',+ portfolios: '1 portfolio',+ alerts: '10 alerts',+ history: '1 year'+ }+ },+ {+ id: 'starter',+ name: 'Starter',+ price: 20,+ period: 'month',+ icon: <Star className="w-5 h-5" />,+ description: 'Ideal for individual investors and small portfolios',+ features: [+ 'Real-time market data',+ 'Advanced portfolio analytics',+ 'Custom watchlists',+ 'Priority email support',+ 'Advanced charting tools',+ 'Mobile app access',+ 'Basic API access'+ ],+ limits: {+ apiRequests: '10,000/month',+ dataStreams: '25 concurrent',+ portfolios: '5 portfolios',+ alerts: '50 alerts',+ history: '5 years'+ }+ },+ {+ id: 'professional',+ name: 'Professional',+ price: 49,+ period: 'month',+ icon: <Zap className="w-5 h-5" />,+ description: 'Advanced tools for active traders and analysts',+ popular: true,+ features: [+ 'Premium real-time data',+ 'Advanced risk analytics',+ 'Multiple portfolio management',+ 'Phone & chat support',+ 'Professional charting suite',+ 'Options & derivatives data',+ 'Extended API access',+ 'Custom indicators',+ 'Backtesting tools'+ ],+ limits: {+ apiRequests: '50,000/month',+ dataStreams: '100 concurrent',+ portfolios: '25 portfolios',+ alerts: '250 alerts',+ history: '10 years'+ }+ },+ {+ id: 'enterprise',+ name: 'Enterprise',+ price: 99,+ period: 'month',+ icon: <Crown className="w-5 h-5" />,+ description: 'Comprehensive solution for investment professionals',+ features: [+ 'Level 2 market data',+ 'Institutional-grade analytics',+ 'Unlimited portfolios',+ 'Dedicated support manager',+ 'Advanced trading tools',+ 'Alternative data sources',+ 'Full API access',+ 'Custom integrations',+ 'White-label options',+ 'Team collaboration tools'+ ],+ limits: {+ apiRequests: '200,000/month',+ dataStreams: '500 concurrent',+ portfolios: 'Unlimited',+ alerts: '1,000 alerts',+ history: '20 years'+ }+ },+ {+ id: 'institutional',+ name: 'Institutional',+ price: 199,+ period: 'month',+ icon: <Rocket className="w-5 h-5" />,+ description: 'Premium solution for large organizations and funds',+ recommended: true,+ features: [+ 'Complete market data coverage',+ 'Advanced risk management',+ 'Unlimited everything',+ '24/7 dedicated support',+ 'Custom development',+ 'On-premise deployment',+ 'Enterprise API',+ 'Advanced compliance tools',+ 'Multi-tenant architecture',+ 'Custom reporting',+ 'SLA guarantees'+ ],+ limits: {+ apiRequests: 'Unlimited',+ dataStreams: 'Unlimited',+ portfolios: 'Unlimited',+ alerts: 'Unlimited',+ history: 'Complete history'+ }+ }+ ];++ const getAnnualPrice = (monthlyPrice: number) => {+ return monthlyPrice * 10; // 2 months free when billed annually+ };++ const handleSelectPlan = async () => {+ if (!selectedPlan) return;++ setIsLoading(true);++ try {+ // TODO: Replace with actual API call to process plan selection+ setTimeout(() => {+ const plan = plans.find(p => p.id === selectedPlan);+ if (plan) {+ console.log('Plan selected:', plan);+ onProceedToDashboard(plan);+ }+ setIsLoading(false);+ }, 2000);+ } catch (err) {+ console.error('Plan selection error:', err);+ setIsLoading(false);+ }+ };++ const getPlanCard = (plan: PricingPlan) => {+ const isSelected = selectedPlan === plan.id;+ const displayPrice = billingPeriod === 'annually' && plan.price > 0+ ? getAnnualPrice(plan.price)+ : plan.price;+ const priceUnit = billingPeriod === 'annually' ? 'year' : 'month';++ return (+ <div+ key={plan.id}+ onClick={() => setSelectedPlan(plan.id)}+ className={`+ relative cursor-pointer rounded-lg border-2 p-6 transition-all duration-200 hover:scale-105+ ${isSelected+ ? 'border-blue-500 bg-blue-600/10 shadow-lg shadow-blue-500/20'+ : 'border-zinc-600 bg-zinc-800/50 hover:border-zinc-500'+ }+ `}+ >+ {plan.popular && (+ <div className="absolute -top-3 left-1/2 transform -translate-x-1/2">+ <span className="bg-blue-500 text-white text-xs font-medium px-3 py-1 rounded-full">+ Most Popular+ </span>+ </div>+ )}++ {plan.recommended && (+ <div className="absolute -top-3 left-1/2 transform -translate-x-1/2">+ <span className="bg-green-500 text-white text-xs font-medium px-3 py-1 rounded-full">+ Recommended+ </span>+ </div>+ )}++ <div className="text-center mb-4">+ <div className={`+ inline-flex items-center justify-center w-12 h-12 rounded-full mb-3+ ${isSelected ? 'bg-blue-500 text-white' : 'bg-zinc-700 text-zinc-300'}+ `}>+ {plan.icon}+ </div>++ <h3 className="text-white text-xl font-semibold mb-2">{plan.name}</h3>++ <div className="mb-2">+ {plan.price === 0 ? (+ <span className="text-3xl font-bold text-green-400">Free</span>+ ) : (+ <div className="flex items-baseline justify-center">+ <span className="text-3xl font-bold text-white">${displayPrice}</span>+ <span className="text-zinc-400 text-sm ml-1">/{priceUnit}</span>+ </div>+ )}++ {billingPeriod === 'annually' && plan.price > 0 && (+ <div className="text-green-400 text-xs mt-1">+ Save ${plan.price * 2}/year+ </div>+ )}+ </div>++ <p className="text-zinc-400 text-xs leading-relaxed">{plan.description}</p>+ </div>++ <div className="space-y-3 mb-6">+ <div className="text-white text-sm font-medium">Usage Limits:</div>+ <div className="grid grid-cols-2 gap-2 text-xs">+ <div className="bg-zinc-800/50 p-2 rounded">+ <div className="text-zinc-400">API Requests</div>+ <div className="text-white font-medium">{plan.limits.apiRequests}</div>+ </div>+ <div className="bg-zinc-800/50 p-2 rounded">+ <div className="text-zinc-400">Data Streams</div>+ <div className="text-white font-medium">{plan.limits.dataStreams}</div>+ </div>+ <div className="bg-zinc-800/50 p-2 rounded">+ <div className="text-zinc-400">Portfolios</div>+ <div className="text-white font-medium">{plan.limits.portfolios}</div>+ </div>+ <div className="bg-zinc-800/50 p-2 rounded">+ <div className="text-zinc-400">History</div>+ <div className="text-white font-medium">{plan.limits.history}</div>+ </div>+ </div>+ </div>++ <div className="space-y-2">+ <div className="text-white text-sm font-medium">Features:</div>+ <ul className="space-y-1">+ {plan.features.map((feature, index) => (+ <li key={index} className="flex items-start text-xs text-zinc-300">+ <Check className="w-3 h-3 text-green-400 mr-2 mt-0.5 flex-shrink-0" />+ <span>{feature}</span>+ </li>+ ))}+ </ul>+ </div>+ </div>+ );+ };++ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-7xl mx-4 shadow-2xl max-h-[90vh] overflow-y-auto">+ <div className="mb-6">+ <div className="flex items-center justify-between mb-3">+ <div className="flex items-center">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Choose Your Plan</h2>+ </div>++ <div className="flex items-center bg-zinc-800 rounded-lg p-1">+ <button+ onClick={() => setBillingPeriod('monthly')}+ className={`px-3 py-1 text-xs rounded transition-colors ${+ billingPeriod === 'monthly'+ ? 'bg-zinc-600 text-white'+ : 'text-zinc-400 hover:text-white'+ }`}+ >+ Monthly+ </button>+ <button+ onClick={() => setBillingPeriod('annually')}+ className={`px-3 py-1 text-xs rounded transition-colors ${+ billingPeriod === 'annually'+ ? 'bg-zinc-600 text-white'+ : 'text-zinc-400 hover:text-white'+ }`}+ >+ Annual <span className="text-green-400 text-xs">(Save 17%)</span>+ </button>+ </div>+ </div>++ <p className="text-zinc-400 text-sm leading-5">+ {userType === 'new'+ ? 'Welcome to Fincept! Select a plan that fits your needs to get started with professional financial analytics.'+ : 'Upgrade your plan to unlock more features and higher limits for your financial analysis.'+ }+ </p>+ </div>++ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-6 mb-8">+ {plans.map(getPlanCard)}+ </div>++ <div className="border-t border-zinc-700 pt-6">+ <div className="flex flex-col sm:flex-row items-center justify-between gap-4">+ <div className="text-center sm:text-left">+ <div className="text-white text-sm font-medium mb-1">+ Selected: {plans.find(p => p.id === selectedPlan)?.name || 'None'}+ </div>+ <div className="text-zinc-400 text-xs">+ {selectedPlan === 'free'+ ? 'Start exploring with our free plan - no credit card required'+ : 'You can change or cancel your plan anytime'+ }+ </div>+ </div>++ <div className="flex gap-3">+ {selectedPlan !== 'free' && (+ <Button+ onClick={() => setSelectedPlan('free')}+ className="bg-zinc-700 hover:bg-zinc-600 text-white px-6 py-2 text-sm font-normal transition-colors"+ disabled={isLoading}+ >+ Try Free Plan+ </Button>+ )}++ <Button+ onClick={handleSelectPlan}+ disabled={!selectedPlan || isLoading}+ className={`px-8 py-2 text-sm font-normal transition-colors disabled:opacity-50 ${+ selectedPlan === 'free'+ ? 'bg-green-600 hover:bg-green-500 text-white'+ : 'bg-blue-600 hover:bg-blue-500 text-white'+ }`}+ >+ {isLoading ? (+ <div className="flex items-center">+ <div className="w-4 h-4 border border-white/30 border-t-white rounded-full animate-spin mr-2"></div>+ Processing...+ </div>+ ) : (+ selectedPlan === 'free'+ ? 'Start with Free Plan'+ : `Continue with ${plans.find(p => p.id === selectedPlan)?.name || 'Selected'} Plan`+ )}+ </Button>+ </div>+ </div>++ <div className="mt-4 text-center">+ <div className="text-zinc-500 text-xs space-y-1">+ <p>• All plans include 14-day free trial (except Free plan)</p>+ <p>• No setup fees or long-term contracts</p>+ <p>• Enterprise support available for all paid plans</p>+ <p>• Cancel or upgrade anytime</p>+ </div>+ </div>+ </div>+ </div>+ );+};++export default PricingScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx b/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsxnew file mode 100644index 000000000..348d93306--- /dev/null+++ b/fincept-terminal-desktop/src/components/auth/RegisterScreen.tsx@@ -0,0 +1,244 @@+// File: src/components/auth/RegisterScreen.tsx+// User registration screen with complete form validation++import React, { useState } from 'react';+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";+import { ArrowLeft, User, Mail, Phone, Building, Lock } from "lucide-react";+import { Screen } from '../../App';++interface RegisterScreenProps {+ onNavigate: (screen: Screen) => void;+}++const RegisterScreen: React.FC<RegisterScreenProps> = ({ onNavigate }) => {+ const [formData, setFormData] = useState({+ firstName: "",+ lastName: "",+ email: "",+ phone: "",+ company: "",+ password: "",+ confirmPassword: ""+ });+ const [isLoading, setIsLoading] = useState(false);+ const [error, setError] = useState("");++ const handleChange = (field: string, value: string) => {+ setFormData(prev => ({ ...prev, [field]: value }));+ if (error) setError("");+ };++ const handleSubmit = async (e: React.FormEvent) => {+ e.preventDefault();++ if (!formData.firstName || !formData.lastName || !formData.email || !formData.password || !formData.confirmPassword) {+ setError("Please fill in all required fields");+ return;+ }++ if (formData.password !== formData.confirmPassword) {+ setError("Passwords do not match");+ return;+ }++ setIsLoading(true);+ setError("");++ try {+ // TODO: Replace with actual API call+ setTimeout(() => {+ console.log('Registration attempt:', formData);+ // Handle successful registration here+ setIsLoading(false);+ }, 2000);+ } catch (err) {+ setError("An unexpected error occurred");+ setIsLoading(false);+ }+ };++ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-sm mx-4 shadow-2xl">+ <div className="mb-6">+ <div className="flex items-center mb-3">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Create Account</h2>+ </div>+ <p className="text-zinc-400 text-xs leading-5">+ Join Fincept to access professional financial terminal and analytics platform.+ </p>+ </div>++ <form onSubmit={handleSubmit} className="space-y-4">+ <div className="grid grid-cols-2 gap-3">+ <div className="space-y-1">+ <Label htmlFor="firstName" className="text-white text-xs">+ First Name *+ </Label>+ <div className="relative">+ <User className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="firstName"+ type="text"+ placeholder="First name"+ value={formData.firstName}+ onChange={(e) => handleChange("firstName", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ />+ </div>+ </div>++ <div className="space-y-1">+ <Label htmlFor="lastName" className="text-white text-xs">+ Last Name *+ </Label>+ <Input+ id="lastName"+ type="text"+ placeholder="Last name"+ value={formData.lastName}+ onChange={(e) => handleChange("lastName", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ />+ </div>+ </div>++ <div className="space-y-1">+ <Label htmlFor="email" className="text-white text-xs">+ Email Address *+ </Label>+ <div className="relative">+ <Mail className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="email"+ type="email"+ placeholder="Enter your email"+ value={formData.email}+ onChange={(e) => handleChange("email", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ />+ </div>+ </div>++ <div className="space-y-1">+ <Label htmlFor="phone" className="text-white text-xs">+ Phone Number+ </Label>+ <div className="relative">+ <Phone className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="phone"+ type="tel"+ placeholder="Phone number (optional)"+ value={formData.phone}+ onChange={(e) => handleChange("phone", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ />+ </div>+ </div>++ <div className="space-y-1">+ <Label htmlFor="company" className="text-white text-xs">+ Company+ </Label>+ <div className="relative">+ <Building className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="company"+ type="text"+ placeholder="Company name (optional)"+ value={formData.company}+ onChange={(e) => handleChange("company", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ />+ </div>+ </div>++ <div className="space-y-1">+ <Label htmlFor="password" className="text-white text-xs">+ Password *+ </Label>+ <div className="relative">+ <Lock className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="password"+ type="password"+ placeholder="Create password"+ value={formData.password}+ onChange={(e) => handleChange("password", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ />+ </div>+ </div>++ <div className="space-y-1">+ <Label htmlFor="confirmPassword" className="text-white text-xs">+ Confirm Password *+ </Label>+ <div className="relative">+ <Lock className="absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-zinc-400" />+ <Input+ id="confirmPassword"+ type="password"+ placeholder="Confirm password"+ value={formData.confirmPassword}+ onChange={(e) => handleChange("confirmPassword", e.target.value)}+ className="bg-zinc-800 border-zinc-600 text-white placeholder-zinc-500 pl-9 py-2 h-9 text-sm focus:border-zinc-500 focus:ring-1 focus:ring-zinc-500"+ disabled={isLoading}+ />+ </div>+ </div>++ {error && (+ <div className="text-red-400 text-xs bg-red-900/20 border border-red-900/50 rounded p-2">+ {error}+ </div>+ )}++ <div className="flex justify-end pt-2">+ <Button+ type="submit"+ className="bg-zinc-700 hover:bg-zinc-600 text-white px-6 py-1.5 text-sm font-normal transition-colors disabled:opacity-50"+ disabled={isLoading}+ >+ {isLoading ? (+ <div className="flex items-center">+ <div className="w-3 h-3 border border-white/30 border-t-white rounded-full animate-spin mr-1.5"></div>+ Creating...+ </div>+ ) : "Create Account"}+ </Button>+ </div>+ </form>++ <div className="mt-5 pt-4 border-t border-zinc-700 text-center">+ <p className="text-zinc-400 text-xs">+ Already have an account?{" "}+ <button+ type="button"+ onClick={() => onNavigate('login')}+ className="text-blue-400 hover:text-blue-300 transition-colors"+ disabled={isLoading}+ >+ Sign In+ </button>+ </p>+ </div>+ </div>+ );+};++export default RegisterScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/common/BackgroundPattern.tsx b/fincept-terminal-desktop/src/components/common/BackgroundPattern.tsxnew file mode 100644index 000000000..5481fb288--- /dev/null+++ b/fincept-terminal-desktop/src/components/common/BackgroundPattern.tsx@@ -0,0 +1,61 @@+// File: src/components/common/BackgroundPattern.tsx+// Geometric crosshatch background pattern component++import React from 'react';++const BackgroundPattern: React.FC = () => {+ return (+ <div+ className="fixed inset-0 w-full h-full"+ style={{+ top: '-10vh',+ left: '-10vw',+ right: '-10vw',+ bottom: '-10vh',+ width: '120vw',+ height: '120vh'+ }}+ >+ <div className="w-full h-full bg-black">+ <svg+ className="w-full h-full"+ viewBox="0 0 1600 1200"+ preserveAspectRatio="none"+ >+ <defs>+ <pattern+ id="geometric-grid"+ x="0"+ y="0"+ width="60"+ height="60"+ patternUnits="userSpaceOnUse"+ >+ <line+ x1="0"+ y1="0"+ x2="60"+ y2="60"+ stroke="#333333"+ strokeWidth="0.8"+ opacity="0.8"+ />+ <line+ x1="60"+ y1="0"+ x2="0"+ y2="60"+ stroke="#333333"+ strokeWidth="0.8"+ opacity="0.8"+ />+ </pattern>+ </defs>+ <rect width="100%" height="100%" fill="url(#geometric-grid)" opacity="0.6" />+ </svg>+ </div>+ </div>+ );+};++export default BackgroundPattern;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/common/Footer.tsx b/fincept-terminal-desktop/src/components/common/Footer.tsxnew file mode 100644index 000000000..19fb17930--- /dev/null+++ b/fincept-terminal-desktop/src/components/common/Footer.tsx@@ -0,0 +1,51 @@+// File: src/components/common/Footer.tsx+// Application footer with copyright and navigation links++import React from 'react';+import { Screen } from '../../App';++interface FooterProps {+ onNavigate: (screen: Screen) => void;+}++const Footer: React.FC<FooterProps> = ({ onNavigate }) => {+ return (+ <div className="relative z-10 p-4 text-xs text-zinc-500 flex justify-between items-center mt-auto border-t border-zinc-800">+ <div>© 2025 Fincept LP All rights reserved.</div>+ <div className="flex space-x-4">+ <button+ onClick={() => onNavigate('contactUs')}+ className="hover:text-zinc-400 transition-colors"+ >+ Contact Us+ </button>+ <button+ onClick={() => onNavigate('termsOfService')}+ className="hover:text-zinc-400 transition-colors"+ >+ Terms of Service+ </button>+ <button+ onClick={() => onNavigate('trademarks')}+ className="hover:text-zinc-400 transition-colors"+ >+ Trademarks+ </button>+ <button+ onClick={() => onNavigate('privacyPolicy')}+ className="hover:text-zinc-400 transition-colors"+ >+ Privacy Policy+ </button>+ <button+ onClick={() => onNavigate('help')}+ className="hover:text-zinc-400 transition-colors"+ >+ Help Center+ </button>+ </div>+ </div>+ );+};++export default Footer;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/common/Header.tsx b/fincept-terminal-desktop/src/components/common/Header.tsxnew file mode 100644index 000000000..25095306a--- /dev/null+++ b/fincept-terminal-desktop/src/components/common/Header.tsx@@ -0,0 +1,34 @@+// File: src/components/common/Header.tsx+// Application header with logo and help button++import React from 'react';+import { Screen } from '../../App';++interface HeaderProps {+ onNavigate: (screen: Screen) => void;+}++const Header: React.FC<HeaderProps> = ({ onNavigate }) => {+ return (+ <div className="relative z-10 p-8 flex justify-between items-center">+ <button+ onClick={() => onNavigate('login')}+ className="text-white text-2xl font-bold hover:text-zinc-300 transition-colors"+ >+ Fincept+ </button>++ <button+ onClick={() => onNavigate('help')}+ className="text-zinc-400 hover:text-white transition-colors text-sm flex items-center gap-2"+ >+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />+ </svg>+ Help+ </button>+ </div>+ );+};++export default Header;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsxnew file mode 100644index 000000000..08e0b9e6a--- /dev/null+++ b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx@@ -0,0 +1,366 @@+import React, { useState, useEffect } from 'react';+import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';+import { Button } from '@/components/ui/button';+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow+} from '@/components/ui/table';++const DashboardScreen = () => {+ const [currentTime, setCurrentTime] = useState(new Date());++ useEffect(() => {+ const timer = setInterval(() => {+ setCurrentTime(new Date());+ }, 1000);+ return () => clearInterval(timer);+ }, []);++ // Custom Bloomberg Terminal Styling+ const terminalStyles = `+ .terminal-bg {+ background: #000000 !important;+ border: 1px solid #FF6600 !important;+ border-radius: 0 !important;+ }+ .terminal-header {+ background: #FF6600 !important;+ color: #000000 !important;+ border-radius: 0 !important;+ font-family: 'Courier New', monospace !important;+ font-weight: bold !important;+ padding: 2px 4px !important;+ margin: 0 !important;+ }+ .terminal-text {+ font-family: 'Courier New', monospace !important;+ font-size: 11px !important;+ line-height: 1.2 !important;+ color: #FFFFFF !important;+ }+ .terminal-orange { color: #FF6600 !important; }+ .terminal-green { color: #00FF00 !important; }+ .terminal-red { color: #FF0000 !important; }+ .terminal-yellow { color: #FFFF00 !important; }+ .terminal-cyan { color: #00FFFF !important; }+ .terminal-gray { color: #808080 !important; }+ .terminal-table {+ border-collapse: collapse !important;+ width: 100% !important;+ font-family: 'Courier New', monospace !important;+ font-size: 10px !important;+ }+ .terminal-table th {+ background: #333333 !important;+ color: #FFFF00 !important;+ border: 1px solid #808080 !important;+ padding: 2px 4px !important;+ text-align: left !important;+ }+ .terminal-table td {+ border: 1px solid #333333 !important;+ padding: 1px 4px !important;+ color: #FFFFFF !important;+ }+ .terminal-button {+ background: #000000 !important;+ border: 1px solid #FFFF00 !important;+ color: #FFFF00 !important;+ border-radius: 0 !important;+ font-family: 'Courier New', monospace !important;+ font-size: 9px !important;+ padding: 1px 6px !important;+ margin: 1px !important;+ height: auto !important;+ }+ .terminal-button:hover {+ background: #FFFF00 !important;+ color: #000000 !important;+ }+ .india-border {+ border: 2px solid #00FF00 !important;+ background: #000000 !important;+ }+ .india-header {+ background: #00FF00 !important;+ color: #000000 !important;+ text-align: center !important;+ }+ `;++ const countries = {+ "India": { gdp_trillion: 3.9, military_budget_billion: 83.6, political_stability: 6.8, current_risk: "Medium", market_influence: 7.8 },+ "United States": { gdp_trillion: 27.4, military_budget_billion: 842, political_stability: 7.0, current_risk: "Low", market_influence: 9.5 },+ "China": { gdp_trillion: 18.2, military_budget_billion: 296, political_stability: 6.5, current_risk: "Medium", market_influence: 8.9 },+ "Russia": { gdp_trillion: 2.0, military_budget_billion: 109, political_stability: 4.0, current_risk: "High", market_influence: 6.2 }+ };++ const intelligenceFeeds = [+ { time: "16:15", priority: "HIGH", source: "HUMINT", classification: "SECRET", event: "India-China border talks scheduled; infrastructure buildout accelerating" },+ { time: "16:02", priority: "CRITICAL", source: "ECONINT", classification: "TOP SECRET", event: "Significant FDI inflows to India's semiconductor sector detected" },+ { time: "15:48", priority: "MEDIUM", source: "OSINT", classification: "CONFIDENTIAL", event: "India-Middle East-Europe Corridor gaining momentum among traders" }+ ];++ const marketData = [+ { asset: "India Nifty 50", impact: +0.95, reason: "FDI Strong" },+ { asset: "S&P 500", impact: -1.8, reason: "Geopolitical Risk" },+ { asset: "Energy Sector", impact: +3.8, reason: "Supply Risk" },+ { asset: "Tech Stocks", impact: -2.9, reason: "US-China Tension" },+ { asset: "Gold", impact: +2.1, reason: "Safe Haven" }+ ];++ return (+ <>+ <style>{terminalStyles}</style>+ <div className="min-h-screen bg-black text-white p-2 terminal-text">++ {/* Bloomberg Header */}+ <Card className="terminal-bg mb-2">+ <CardHeader className="terminal-header p-2">+ <div className="text-sm font-bold">+ ████████ BLOOMBERG TERMINAL ████████ GEOPOLITICAL INTELLIGENCE SYSTEM ████████+ </div>+ </CardHeader>+ <CardContent className="p-2">+ <div className="terminal-text text-xs">+ <span className="terminal-orange">GLOBAL RISK: </span>+ <span className="terminal-red">7.2/10 </span>+ <span className="terminal-gray">| </span>+ <span className="terminal-orange">CONFLICTS: </span>+ <span className="terminal-red">15 </span>+ <span className="terminal-gray">| </span>+ <span className="terminal-orange">SANCTIONS: </span>+ <span className="terminal-yellow">3124 </span>+ <span className="terminal-gray">| </span>+ <span className="terminal-white">{currentTime.toLocaleString()}</span>+ </div>+ <div className="terminal-text text-xs mt-1">+ <span className="terminal-gray">INDIA NIFTY: </span>+ <span className="terminal-green">24,850 </span>+ <span className="terminal-gray">| INR/USD: </span>+ <span className="terminal-cyan">83.12 </span>+ <span className="terminal-gray">| OIL: </span>+ <span className="terminal-green">$82.30 </span>+ <span className="terminal-gray">| ALERTS: </span>+ <span className="terminal-red">52 ACTIVE</span>+ </div>+ </CardContent>+ </Card>++ {/* Function Keys */}+ <div className="mb-2 flex gap-1 flex-wrap">+ {["F1:INDIA", "F2:CHINA", "F3:PAKISTAN", "F4:USA", "F5:RUSSIA", "F6:LAC", "F7:QUAD", "F8:BRICS"].map(key => (+ <Button key={key} className="terminal-button">+ {key}+ </Button>+ ))}+ </div>++ {/* Main Dashboard Grid */}+ <div className="grid grid-cols-3 gap-2 mb-4">++ {/* Intelligence Alerts */}+ <Card className="terminal-bg">+ <CardHeader className="terminal-header p-1">+ <CardTitle className="text-xs">■ REAL-TIME INTELLIGENCE ALERTS ■</CardTitle>+ </CardHeader>+ <CardContent className="p-2">+ {intelligenceFeeds.map((alert, idx) => (+ <div key={idx} className="mb-3 text-xs terminal-text">+ <div className="flex gap-2">+ <span className="terminal-gray">{alert.time}</span>+ <span className={alert.priority === 'CRITICAL' ? 'terminal-red' : alert.priority === 'HIGH' ? 'terminal-orange' : 'terminal-yellow'}>+ [{alert.priority}]+ </span>+ <span className="terminal-cyan">[{alert.source}]</span>+ </div>+ <div className="mt-1">{alert.event}</div>+ <div className="terminal-yellow text-xs">CLASSIFICATION: {alert.classification}</div>+ <div className="border-b border-gray-600 mt-1"></div>+ </div>+ ))}+ </CardContent>+ </Card>++ {/* Country Risk Matrix */}+ <Card className="terminal-bg">+ <CardHeader className="terminal-header p-1">+ <CardTitle className="text-xs">■ COUNTRY RISK MATRIX ■</CardTitle>+ </CardHeader>+ <CardContent className="p-2">+ <Table className="terminal-table">+ <TableHeader>+ <TableRow>+ <TableHead className="text-xs">COUNTRY</TableHead>+ <TableHead className="text-xs">RISK</TableHead>+ <TableHead className="text-xs">STAB</TableHead>+ <TableHead className="text-xs">MIL($B)</TableHead>+ <TableHead className="text-xs">GDP</TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {Object.entries(countries).map(([country, data]) => (+ <TableRow key={country}>+ <TableCell className="text-xs">{country.substring(0,8)}</TableCell>+ <TableCell className={`text-xs ${+ data.current_risk === 'Low' ? 'terminal-green' :+ data.current_risk === 'Medium' ? 'terminal-yellow' : 'terminal-red'+ }`}>+ {data.current_risk.substring(0,3).toUpperCase()}+ </TableCell>+ <TableCell className="text-xs terminal-cyan">{data.political_stability}</TableCell>+ <TableCell className="text-xs terminal-red">${data.military_budget_billion}</TableCell>+ <TableCell className="text-xs terminal-green">${data.gdp_trillion}T</TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </CardContent>+ </Card>++ {/* Market Impact */}+ <Card className="terminal-bg">+ <CardHeader className="terminal-header p-1">+ <CardTitle className="text-xs">■ MARKET IMPACT SUMMARY ■</CardTitle>+ </CardHeader>+ <CardContent className="p-2">+ <Table className="terminal-table">+ <TableHeader>+ <TableRow>+ <TableHead className="text-xs">ASSET</TableHead>+ <TableHead className="text-xs">IMPACT</TableHead>+ <TableHead className="text-xs">REASON</TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {marketData.map((item, idx) => (+ <TableRow key={idx}>+ <TableCell className="text-xs">{item.asset.substring(0,12)}</TableCell>+ <TableCell className={`text-xs ${item.impact > 0 ? 'terminal-green' : 'terminal-red'}`}>+ {item.impact > 0 ? '+' : ''}{item.impact}%+ </TableCell>+ <TableCell className="text-xs terminal-gray">{item.reason}</TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </CardContent>+ </Card>+ </div>++ {/* India-Specific Dashboard */}+ <Card className="india-border mb-4">+ <CardHeader className="india-header p-2">+ <CardTitle className="text-sm font-bold">+ ████ INDIA GEOPOLITICAL DASHBOARD - REAL-TIME ANALYSIS ████+ </CardTitle>+ </CardHeader>+ <CardContent className="p-2">+ <div className="grid grid-cols-4 gap-2">++ <Card className="terminal-bg">+ <CardHeader className="p-1">+ <CardTitle className="text-xs terminal-yellow">INDIA: KEY METRICS</CardTitle>+ </CardHeader>+ <CardContent className="p-2">+ <Table className="terminal-table">+ <TableBody>+ <TableRow>+ <TableCell className="text-xs">GDP:</TableCell>+ <TableCell className="text-xs terminal-green">$3.9T</TableCell>+ </TableRow>+ <TableRow>+ <TableCell className="text-xs">Population:</TableCell>+ <TableCell className="text-xs terminal-cyan">1428M</TableCell>+ </TableRow>+ <TableRow>+ <TableCell className="text-xs">Military:</TableCell>+ <TableCell className="text-xs terminal-red">$83.6B</TableCell>+ </TableRow>+ <TableRow>+ <TableCell className="text-xs">Risk Level:</TableCell>+ <TableCell className="text-xs terminal-yellow">MEDIUM</TableCell>+ </TableRow>+ </TableBody>+ </Table>+ </CardContent>+ </Card>++ <Card className="terminal-bg">+ <CardHeader className="p-1">+ <CardTitle className="text-xs terminal-yellow">STRATEGIC DEVELOPMENTS</CardTitle>+ </CardHeader>+ <CardContent className="p-2 text-xs">+ <div className="terminal-green">✓ G20 Presidency Success</div>+ <div className="terminal-green">✓ Quad Alliance Active</div>+ <div className="terminal-green">✓ Digital India Growth</div>+ <div className="terminal-orange">⚠ LAC Border Tensions</div>+ <div className="terminal-orange">⚠ Pakistan Relations</div>+ <div className="terminal-green">✓ Manufacturing Hub</div>+ </CardContent>+ </Card>++ <Card className="terminal-bg">+ <CardHeader className="p-1">+ <CardTitle className="text-xs terminal-yellow">THREAT ASSESSMENT</CardTitle>+ </CardHeader>+ <CardContent className="p-2">+ <Table className="terminal-table">+ <TableBody>+ {[+ {threat: "China Border", level: 7.8, category: "HIGH"},+ {threat: "Pakistan Terror", level: 6.9, category: "MEDIUM"},+ {threat: "Cyber Threats", level: 6.5, category: "MEDIUM"},+ {threat: "Energy Security", level: 5.8, category: "MEDIUM"}+ ].map((item, idx) => (+ <TableRow key={idx}>+ <TableCell className="text-xs">{item.threat.substring(0,10)}:</TableCell>+ <TableCell className={`text-xs ${item.level >= 7.0 ? 'terminal-orange' : 'terminal-yellow'}`}>+ {item.level}+ </TableCell>+ <TableCell className={`text-xs ${item.level >= 7.0 ? 'terminal-orange' : 'terminal-yellow'}`}>+ [{item.category.substring(0,3)}]+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </CardContent>+ </Card>++ <Card className="terminal-bg">+ <CardHeader className="p-1">+ <CardTitle className="text-xs terminal-yellow">STRATEGIC OPPORTUNITIES</CardTitle>+ </CardHeader>+ <CardContent className="p-2 text-xs terminal-green">+ <div>• Global Manufacturing Hub</div>+ <div>• Semiconductor Production</div>+ <div>• Renewable Energy Leader</div>+ <div>• Defense Exports Growth</div>+ <div>• IMEC Trade Corridor</div>+ <div>• Digital Economy Expansion</div>+ </CardContent>+ </Card>+ </div>+ </CardContent>+ </Card>++ {/* Status Bar */}+ <Card className="terminal-bg">+ <CardContent className="p-2 terminal-header">+ <div className="flex justify-between text-xs font-bold">+ <div>SYSTEM STATUS: OPERATIONAL | DATA FEEDS: ACTIVE | INTEL PROCESSING: REAL-TIME</div>+ <div>Last Update: {currentTime.toLocaleTimeString()} | Classification: CONFIDENTIAL</div>+ </div>+ </CardContent>+ </Card>+ </div>+ </>+ );+};++export default DashboardScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/info/ContactUsScreen.tsx b/fincept-terminal-desktop/src/components/info/ContactUsScreen.tsxnew file mode 100644index 000000000..6091cc9bd--- /dev/null+++ b/fincept-terminal-desktop/src/components/info/ContactUsScreen.tsx@@ -0,0 +1,164 @@+// File: src/components/info/ContactUsScreen.tsx+// Contact us screen with contact information and support options++import React from 'react';+import { Button } from "@/components/ui/button";+import { ArrowLeft, Mail, Phone, MapPin, Clock } from "lucide-react";+import { Screen } from '../../App';++interface ContactUsScreenProps {+ onNavigate: (screen: Screen) => void;+}++const ContactUsScreen: React.FC<ContactUsScreenProps> = ({ onNavigate }) => {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-lg mx-4 shadow-2xl">+ <div className="mb-6">+ <div className="flex items-center mb-3">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Contact Us</h2>+ </div>+ <p className="text-zinc-400 text-xs leading-5">+ Get in touch with our support team for assistance with your Fincept account.+ </p>+ </div>++ <div className="space-y-6">+ <div className="space-y-4">+ <h3 className="text-white text-sm font-medium">Contact Information</h3>++ <div className="space-y-3">+ <div className="flex items-start p-3 bg-zinc-800/50 rounded">+ <Mail className="w-4 h-4 text-zinc-400 mr-3 mt-0.5" />+ <div>+ <div className="text-white text-sm font-medium">Email Support</div>+ <div className="text-zinc-400 text-xs mt-1">[email protected]</div>+ <div className="text-zinc-500 text-xs mt-1">Average response time: 4-6 hours</div>+ </div>+ </div>++ <div className="flex items-start p-3 bg-zinc-800/50 rounded">+ <Phone className="w-4 h-4 text-zinc-400 mr-3 mt-0.5" />+ <div>+ <div className="text-white text-sm font-medium">Phone Support</div>+ <div className="text-zinc-400 text-xs mt-1">1-800-FINCEPT (346-2378)</div>+ <div className="text-zinc-500 text-xs mt-1">For urgent technical issues</div>+ </div>+ </div>++ <div className="flex items-start p-3 bg-zinc-800/50 rounded">+ <Clock className="w-4 h-4 text-zinc-400 mr-3 mt-0.5" />+ <div>+ <div className="text-white text-sm font-medium">Support Hours</div>+ <div className="text-zinc-400 text-xs mt-1">Monday - Friday: 9:00 AM - 6:00 PM EST</div>+ <div className="text-zinc-400 text-xs">Saturday: 10:00 AM - 4:00 PM EST</div>+ <div className="text-zinc-500 text-xs mt-1">Emergency support available 24/7</div>+ </div>+ </div>++ <div className="flex items-start p-3 bg-zinc-800/50 rounded">+ <MapPin className="w-4 h-4 text-zinc-400 mr-3 mt-0.5" />+ <div>+ <div className="text-white text-sm font-medium">Office Address</div>+ <div className="text-zinc-400 text-xs mt-1">+ Fincept LP<br />+ 123 Financial District<br />+ New York, NY 10004<br />+ United States+ </div>+ </div>+ </div>+ </div>+ </div>++ <div className="space-y-4 pt-4 border-t border-zinc-700">+ <h3 className="text-white text-sm font-medium">Quick Actions</h3>++ <div className="grid grid-cols-1 gap-2">+ <Button+ onClick={() => alert('Opening live chat...')}+ className="bg-green-600/20 hover:bg-green-600/30 border border-green-600/50 text-green-400 p-3 font-normal transition-colors justify-start"+ >+ <svg className="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-3.582 8-8 8a8.014 8.014 0 01-2.215-.31l-5.297 2.67c-.346.174-.735-.002-.735-.394V17.7a8 8 0 113.467-13.876" />+ </svg>+ <div className="text-left">+ <div className="text-sm">Start Live Chat</div>+ <div className="text-xs text-green-300">Usually responds in minutes</div>+ </div>+ </Button>++ <Button+ onClick={() => window.open('mailto:[email protected]', '_blank')}+ className="bg-blue-600/20 hover:bg-blue-600/30 border border-blue-600/50 text-blue-400 p-3 font-normal transition-colors justify-start"+ >+ <Mail className="w-4 h-4 mr-2" />+ <div className="text-left">+ <div className="text-sm">Send Email</div>+ <div className="text-xs text-blue-300">For detailed inquiries</div>+ </div>+ </Button>++ <Button+ onClick={() => window.open('tel:1-800-346-2378', '_blank')}+ className="bg-orange-600/20 hover:bg-orange-600/30 border border-orange-600/50 text-orange-400 p-3 font-normal transition-colors justify-start"+ >+ <Phone className="w-4 h-4 mr-2" />+ <div className="text-left">+ <div className="text-sm">Call Support</div>+ <div className="text-xs text-orange-300">For urgent issues</div>+ </div>+ </Button>+ </div>+ </div>++ <div className="space-y-4 pt-4 border-t border-zinc-700">+ <h3 className="text-white text-sm font-medium">Common Issues</h3>++ <div className="space-y-2">+ <button+ onClick={() => onNavigate('help')}+ className="w-full text-left p-2 bg-zinc-800/30 hover:bg-zinc-800/50 rounded text-xs transition-colors"+ >+ <div className="text-zinc-300">Account login problems</div>+ <div className="text-zinc-500 mt-1">Password reset, account lockouts, 2FA issues</div>+ </button>++ <button+ onClick={() => onNavigate('help')}+ className="w-full text-left p-2 bg-zinc-800/30 hover:bg-zinc-800/50 rounded text-xs transition-colors"+ >+ <div className="text-zinc-300">Technical difficulties</div>+ <div className="text-zinc-500 mt-1">Platform errors, connectivity, performance</div>+ </button>++ <button+ onClick={() => onNavigate('help')}+ className="w-full text-left p-2 bg-zinc-800/30 hover:bg-zinc-800/50 rounded text-xs transition-colors"+ >+ <div className="text-zinc-300">Billing inquiries</div>+ <div className="text-zinc-500 mt-1">Subscription, payments, invoices</div>+ </button>+ </div>+ </div>+ </div>++ <div className="mt-6 pt-4 border-t border-zinc-700">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white text-xs transition-colors flex items-center"+ >+ <ArrowLeft className="w-3 h-3 mr-1" />+ Back to Login+ </button>+ </div>+ </div>+ );+};++export default ContactUsScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/info/PrivacyPolicyScreen.tsx b/fincept-terminal-desktop/src/components/info/PrivacyPolicyScreen.tsxnew file mode 100644index 000000000..ca294f80a--- /dev/null+++ b/fincept-terminal-desktop/src/components/info/PrivacyPolicyScreen.tsx@@ -0,0 +1,272 @@+// File: src/components/info/PrivacyPolicyScreen.tsx+// Privacy policy screen with data protection and usage information++import React from 'react';+import { ArrowLeft, Shield, Eye, Lock, Share } from "lucide-react";+import { Screen } from '../../App';++interface PrivacyPolicyScreenProps {+ onNavigate: (screen: Screen) => void;+}++const PrivacyPolicyScreen: React.FC<PrivacyPolicyScreenProps> = ({ onNavigate }) => {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-2xl mx-4 shadow-2xl max-h-[80vh] overflow-y-auto">+ <div className="mb-6">+ <div className="flex items-center mb-3">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Privacy Policy</h2>+ </div>+ <p className="text-zinc-400 text-xs leading-5">+ Learn how we collect, use, and protect your personal information.+ </p>+ </div>++ <div className="space-y-6 text-sm">+ <div>+ <p className="text-zinc-500 text-xs mb-4">Last updated: January 1, 2025</p>+ </div>++ <section>+ <h3 className="text-white text-lg font-medium mb-3 flex items-center">+ <Shield className="w-4 h-4 mr-2" />+ Our Commitment to Privacy+ </h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ At Fincept, we are committed to protecting your privacy and ensuring the security of your personal information. This Privacy Policy explains how we collect, use, and safeguard your data when you use our services.+ </p>+ <p>+ We believe in transparency and will never sell, rent, or trade your personal information to third parties for marketing purposes.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3 flex items-center">+ <Eye className="w-4 h-4 mr-2" />+ Information We Collect+ </h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-3">+ <div>+ <h4 className="text-white text-sm font-medium mb-2">Personal Information</h4>+ <ul className="list-disc list-inside ml-4 space-y-1 text-zinc-400">+ <li>Name, email address, and phone number</li>+ <li>Company information and job title</li>+ <li>Account credentials and authentication data</li>+ <li>Billing and payment information</li>+ <li>Communication preferences</li>+ </ul>+ </div>++ <div>+ <h4 className="text-white text-sm font-medium mb-2">Usage Information</h4>+ <ul className="list-disc list-inside ml-4 space-y-1 text-zinc-400">+ <li>Terminal usage patterns and feature interactions</li>+ <li>Search queries and data requests</li>+ <li>Session duration and frequency of use</li>+ <li>Device information and browser type</li>+ <li>IP address and location data</li>+ </ul>+ </div>++ <div>+ <h4 className="text-white text-sm font-medium mb-2">Financial Data</h4>+ <ul className="list-disc list-inside ml-4 space-y-1 text-zinc-400">+ <li>Portfolio compositions and holdings</li>+ <li>Trading preferences and strategies</li>+ <li>Watchlists and saved analyses</li>+ <li>Custom dashboard configurations</li>+ </ul>+ </div>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3 flex items-center">+ <Lock className="w-4 h-4 mr-2" />+ How We Use Your Information+ </h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-3">+ <p>We use your information to:</p>++ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">+ <div className="bg-zinc-800/50 p-3 rounded">+ <h4 className="text-white text-sm font-medium mb-2">Service Delivery</h4>+ <ul className="text-zinc-400 text-xs space-y-1">+ <li>• Provide terminal access and functionality</li>+ <li>• Personalize your user experience</li>+ <li>• Process transactions and billing</li>+ <li>• Deliver customer support</li>+ </ul>+ </div>++ <div className="bg-zinc-800/50 p-3 rounded">+ <h4 className="text-white text-sm font-medium mb-2">Security & Compliance</h4>+ <ul className="text-zinc-400 text-xs space-y-1">+ <li>• Verify identity and prevent fraud</li>+ <li>• Comply with regulatory requirements</li>+ <li>• Monitor for suspicious activity</li>+ <li>• Maintain audit trails</li>+ </ul>+ </div>++ <div className="bg-zinc-800/50 p-3 rounded">+ <h4 className="text-white text-sm font-medium mb-2">Communication</h4>+ <ul className="text-zinc-400 text-xs space-y-1">+ <li>• Send service notifications</li>+ <li>• Provide technical updates</li>+ <li>• Share relevant market insights</li>+ <li>• Respond to inquiries</li>+ </ul>+ </div>++ <div className="bg-zinc-800/50 p-3 rounded">+ <h4 className="text-white text-sm font-medium mb-2">Improvement</h4>+ <ul className="text-zinc-400 text-xs space-y-1">+ <li>• Analyze usage patterns</li>+ <li>• Improve platform performance</li>+ <li>• Develop new features</li>+ <li>• Enhance security measures</li>+ </ul>+ </div>+ </div>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3 flex items-center">+ <Share className="w-4 h-4 mr-2" />+ Information Sharing+ </h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>We may share your information in the following circumstances:</p>++ <div className="space-y-2">+ <div className="bg-zinc-800/30 p-2 rounded">+ <span className="text-white font-medium">Service Providers:</span>+ <span className="text-zinc-400 ml-2">With trusted third parties who help deliver our services</span>+ </div>++ <div className="bg-zinc-800/30 p-2 rounded">+ <span className="text-white font-medium">Legal Requirements:</span>+ <span className="text-zinc-400 ml-2">When required by law, regulation, or legal process</span>+ </div>++ <div className="bg-zinc-800/30 p-2 rounded">+ <span className="text-white font-medium">Business Transfer:</span>+ <span className="text-zinc-400 ml-2">In connection with a merger, acquisition, or sale of assets</span>+ </div>++ <div className="bg-zinc-800/30 p-2 rounded">+ <span className="text-white font-medium">Consent:</span>+ <span className="text-zinc-400 ml-2">When you explicitly consent to sharing</span>+ </div>+ </div>++ <p className="mt-3 text-zinc-400">+ We never sell personal information to data brokers or advertising companies.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Data Security</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>We implement industry-standard security measures to protect your data:</p>++ <div className="bg-zinc-800/50 p-3 rounded space-y-1 text-zinc-400 text-xs">+ <p>• End-to-end encryption for data transmission</p>+ <p>• AES-256 encryption for data storage</p>+ <p>• Multi-factor authentication requirements</p>+ <p>• Regular security audits and penetration testing</p>+ <p>• SOC 2 Type II compliance</p>+ <p>• 24/7 security monitoring</p>+ </div>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Your Rights</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>You have the following rights regarding your personal data:</p>++ <div className="space-y-2">+ <div className="flex items-start">+ <span className="text-green-400 mr-2">•</span>+ <span><strong>Access:</strong> Request a copy of your personal data</span>+ </div>+ <div className="flex items-start">+ <span className="text-green-400 mr-2">•</span>+ <span><strong>Correction:</strong> Update inaccurate or incomplete information</span>+ </div>+ <div className="flex items-start">+ <span className="text-green-400 mr-2">•</span>+ <span><strong>Deletion:</strong> Request deletion of your personal data</span>+ </div>+ <div className="flex items-start">+ <span className="text-green-400 mr-2">•</span>+ <span><strong>Portability:</strong> Receive your data in a machine-readable format</span>+ </div>+ <div className="flex items-start">+ <span className="text-green-400 mr-2">•</span>+ <span><strong>Opt-out:</strong> Withdraw consent for data processing</span>+ </div>+ </div>++ <p className="mt-3">+ To exercise these rights, contact us at [email protected] or through your account settings.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Contact Us</h3>+ <div className="text-zinc-300 text-xs leading-relaxed">+ <p className="mb-3">+ If you have questions about this Privacy Policy or our data practices:+ </p>+ <div className="bg-zinc-800/50 p-3 rounded">+ <p><strong>Privacy Officer</strong></p>+ <p>Email: [email protected]</p>+ <p>Phone: 1-800-FINCEPT (346-2378)</p>+ <p>Address: Fincept LP, 123 Financial District, New York, NY 10004</p>+ </div>+ </div>+ </section>+ </div>++ <div className="mt-8 pt-4 border-t border-zinc-700 flex justify-between items-center">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white text-xs transition-colors flex items-center"+ >+ <ArrowLeft className="w-3 h-3 mr-1" />+ Back to Login+ </button>++ <div className="flex space-x-4">+ <button+ onClick={() => onNavigate('termsOfService')}+ className="text-blue-400 hover:text-blue-300 text-xs transition-colors"+ >+ Terms of Service+ </button>+ <button+ onClick={() => onNavigate('contactUs')}+ className="text-blue-400 hover:text-blue-300 text-xs transition-colors"+ >+ Contact Us+ </button>+ </div>+ </div>+ </div>+ );+};++export default PrivacyPolicyScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/info/TermsOfServiceScreen.tsx b/fincept-terminal-desktop/src/components/info/TermsOfServiceScreen.tsxnew file mode 100644index 000000000..1735fbbfb--- /dev/null+++ b/fincept-terminal-desktop/src/components/info/TermsOfServiceScreen.tsx@@ -0,0 +1,197 @@+// File: src/components/info/TermsOfServiceScreen.tsx+// Terms of service screen with legal information and navigation++import React from 'react';+import { ArrowLeft } from "lucide-react";+import { Screen } from '../../App';++interface TermsOfServiceScreenProps {+ onNavigate: (screen: Screen) => void;+}++const TermsOfServiceScreen: React.FC<TermsOfServiceScreenProps> = ({ onNavigate }) => {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-2xl mx-4 shadow-2xl max-h-[80vh] overflow-y-auto">+ <div className="mb-6">+ <div className="flex items-center mb-3">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Terms of Service</h2>+ </div>+ <p className="text-zinc-400 text-xs leading-5">+ Please read these terms carefully before using Fincept services.+ </p>+ </div>++ <div className="space-y-6 text-sm">+ <div>+ <p className="text-zinc-500 text-xs mb-4">Last updated: January 1, 2025</p>+ </div>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">1. Acceptance of Terms</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ By accessing and using Fincept Terminal ("Service"), you accept and agree to be bound by the terms and provision of this agreement.+ </p>+ <p>+ If you do not agree to abide by the above, please do not use this service.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">2. Description of Service</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ Fincept Terminal is a professional financial analytics and data platform that provides real-time market data, financial analysis tools, and portfolio management capabilities.+ </p>+ <p>+ The Service includes both free guest access with limited features and paid subscription tiers with enhanced functionality.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">3. User Accounts and Registration</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ To access certain features of the Service, you must register for an account. You agree to provide accurate, current, and complete information during the registration process.+ </p>+ <p>+ You are responsible for safeguarding the password and all activities that occur under your account.+ </p>+ <p>+ You must notify us immediately of any unauthorized use of your account.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">4. Acceptable Use Policy</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>You agree not to use the Service to:</p>+ <ul className="list-disc list-inside ml-4 space-y-1 text-zinc-400">+ <li>Violate any applicable laws or regulations</li>+ <li>Transmit any harmful, offensive, or disruptive content</li>+ <li>Attempt to gain unauthorized access to our systems</li>+ <li>Use automated scripts or bots without permission</li>+ <li>Redistribute or resell our data without authorization</li>+ </ul>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">5. Data and Privacy</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ Your privacy is important to us. Our data collection and usage practices are detailed in our Privacy Policy, which forms part of these Terms.+ </p>+ <p>+ Market data provided through the Service is sourced from third-party providers and is subject to their respective terms and conditions.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">6. Subscription and Billing</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ Paid subscriptions are billed in advance on a monthly or annual basis. All fees are non-refundable except as required by law.+ </p>+ <p>+ We reserve the right to change our pricing with 30 days' notice to existing subscribers.+ </p>+ <p>+ Your subscription will automatically renew unless cancelled before the renewal date.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">7. Disclaimers and Limitations</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ The Service is provided "as is" without any warranties, express or implied. We do not guarantee the accuracy, completeness, or timeliness of market data.+ </p>+ <p>+ Investment decisions should not be based solely on information provided by our Service. Always consult with qualified financial advisors.+ </p>+ <p>+ Our liability is limited to the amount paid for the Service in the preceding 12 months.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">8. Termination</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ We may terminate or suspend your account immediately, without prior notice, for conduct that we believe violates these Terms or is harmful to other users, us, or third parties.+ </p>+ <p>+ You may terminate your account at any time by contacting our support team.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">9. Changes to Terms</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ We reserve the right to modify these Terms at any time. We will notify users of significant changes via email or through the Service.+ </p>+ <p>+ Continued use of the Service after changes constitutes acceptance of the new Terms.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">10. Contact Information</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ If you have questions about these Terms, please contact us at:+ </p>+ <div className="bg-zinc-800/50 p-3 rounded mt-2">+ <p>Email: [email protected]</p>+ <p>Phone: 1-800-FINCEPT (346-2378)</p>+ <p>Address: Fincept LP, 123 Financial District, New York, NY 10004</p>+ </div>+ </div>+ </section>+ </div>++ <div className="mt-8 pt-4 border-t border-zinc-700 flex justify-between items-center">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white text-xs transition-colors flex items-center"+ >+ <ArrowLeft className="w-3 h-3 mr-1" />+ Back to Login+ </button>++ <div className="flex space-x-4">+ <button+ onClick={() => onNavigate('privacyPolicy')}+ className="text-blue-400 hover:text-blue-300 text-xs transition-colors"+ >+ Privacy Policy+ </button>+ <button+ onClick={() => onNavigate('contactUs')}+ className="text-blue-400 hover:text-blue-300 text-xs transition-colors"+ >+ Contact Us+ </button>+ </div>+ </div>+ </div>+ );+};++export default TermsOfServiceScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/info/TrademarksScreen.tsx b/fincept-terminal-desktop/src/components/info/TrademarksScreen.tsxnew file mode 100644index 000000000..22583aad3--- /dev/null+++ b/fincept-terminal-desktop/src/components/info/TrademarksScreen.tsx@@ -0,0 +1,213 @@+// File: src/components/info/TrademarksScreen.tsx+// Trademarks screen with intellectual property information++import React from 'react';+import { ArrowLeft } from "lucide-react";+import { Screen } from '../../App';++interface TrademarksScreenProps {+ onNavigate: (screen: Screen) => void;+}++const TrademarksScreen: React.FC<TrademarksScreenProps> = ({ onNavigate }) => {+ return (+ <div className="bg-zinc-900/90 backdrop-blur-sm border border-zinc-700 rounded-lg p-6 w-full max-w-2xl mx-4 shadow-2xl max-h-[80vh] overflow-y-auto">+ <div className="mb-6">+ <div className="flex items-center mb-3">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white transition-colors mr-3"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ <h2 className="text-white text-2xl font-light">Trademarks</h2>+ </div>+ <p className="text-zinc-400 text-xs leading-5">+ Information about trademarks and intellectual property rights.+ </p>+ </div>++ <div className="space-y-6 text-sm">+ <div>+ <p className="text-zinc-500 text-xs mb-4">Last updated: January 1, 2025</p>+ </div>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Fincept Trademarks</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-3">+ <p>+ The following marks are trademarks or registered trademarks of Fincept LP in the United States and other countries:+ </p>++ <div className="bg-zinc-800/50 p-4 rounded space-y-2">+ <div className="flex justify-between">+ <span className="font-medium text-white">FINCEPT®</span>+ <span className="text-zinc-400">Registered Trademark</span>+ </div>+ <div className="flex justify-between">+ <span className="font-medium text-white">FINCEPT TERMINAL™</span>+ <span className="text-zinc-400">Trademark</span>+ </div>+ <div className="flex justify-between">+ <span className="font-medium text-white">B-UNIT™</span>+ <span className="text-zinc-400">Trademark</span>+ </div>+ <div className="flex justify-between">+ <span className="font-medium text-white">FINCEPT ANALYTICS™</span>+ <span className="text-zinc-400">Trademark</span>+ </div>+ </div>++ <p>+ All rights in these trademarks are reserved. Unauthorized use is strictly prohibited.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Third-Party Trademarks</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-3">+ <p>+ The following are trademarks or registered trademarks of their respective owners:+ </p>++ <div className="space-y-2 text-zinc-400">+ <div className="flex justify-between">+ <span>Bloomberg Terminal®</span>+ <span>Bloomberg Finance L.P.</span>+ </div>+ <div className="flex justify-between">+ <span>Reuters®</span>+ <span>Thomson Reuters Corporation</span>+ </div>+ <div className="flex justify-between">+ <span>S&P 500®</span>+ <span>S&P Global Inc.</span>+ </div>+ <div className="flex justify-between">+ <span>NASDAQ®</span>+ <span>NASDAQ, Inc.</span>+ </div>+ <div className="flex justify-between">+ <span>NYSE®</span>+ <span>NYSE Group, Inc.</span>+ </div>+ <div className="flex justify-between">+ <span>FTSE®</span>+ <span>FTSE International Limited</span>+ </div>+ </div>++ <p>+ All third-party trademarks mentioned are the property of their respective owners. Use of these marks does not imply endorsement by or affiliation with Fincept.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Trademark Guidelines</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-3">+ <p>+ If you wish to use any Fincept trademark, please follow these guidelines:+ </p>++ <div className="space-y-2">+ <h4 className="text-white text-sm font-medium">Permitted Uses:</h4>+ <ul className="list-disc list-inside ml-4 space-y-1 text-zinc-400">+ <li>Referential use to identify Fincept products or services</li>+ <li>Academic or journalistic references with proper attribution</li>+ <li>Use in comparative advertising when truthful and not misleading</li>+ </ul>++ <h4 className="text-white text-sm font-medium mt-4">Prohibited Uses:</h4>+ <ul className="list-disc list-inside ml-4 space-y-1 text-zinc-400">+ <li>Use as part of your own trademark or business name</li>+ <li>Use that implies sponsorship, endorsement, or affiliation</li>+ <li>Modification, alteration, or combination with other marks</li>+ <li>Use in a way that disparages or damages Fincept's reputation</li>+ </ul>+ </div>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Copyright Notice</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ © 2025 Fincept LP. All rights reserved.+ </p>+ <p>+ The content, features, and functionality of Fincept Terminal are protected by copyright, trademark, patent, and other intellectual property laws.+ </p>+ <p>+ Reproduction, modification, or distribution of any content without written permission is strictly prohibited.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Data Provider Acknowledgments</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-3">+ <p>+ Market data and financial information are provided by various third-party sources. Each data provider retains all rights to their content:+ </p>++ <div className="bg-zinc-800/50 p-3 rounded text-zinc-400 text-xs space-y-1">+ <p>• Market data © respective exchanges and data providers</p>+ <p>• Financial data © FactSet Research Systems Inc.</p>+ <p>• News content © respective news organizations</p>+ <p>• Economic indicators © government statistical agencies</p>+ <p>• Corporate information © respective companies and filing authorities</p>+ </div>++ <p>+ Users must comply with all third-party data provider terms and conditions.+ </p>+ </div>+ </section>++ <section>+ <h3 className="text-white text-lg font-medium mb-3">Reporting Trademark Infringement</h3>+ <div className="text-zinc-300 text-xs leading-relaxed space-y-2">+ <p>+ If you believe your trademark rights have been infringed, or if you discover unauthorized use of Fincept trademarks, please contact us:+ </p>+ <div className="bg-zinc-800/50 p-3 rounded mt-2">+ <p><strong>Legal Department</strong></p>+ <p>Email: [email protected]</p>+ <p>Phone: 1-800-FINCEPT (346-2378)</p>+ <p>Address: Fincept LP, 123 Financial District, New York, NY 10004</p>+ </div>+ </div>+ </section>+ </div>++ <div className="mt-8 pt-4 border-t border-zinc-700 flex justify-between items-center">+ <button+ onClick={() => onNavigate('login')}+ className="text-zinc-400 hover:text-white text-xs transition-colors flex items-center"+ >+ <ArrowLeft className="w-3 h-3 mr-1" />+ Back to Login+ </button>++ <div className="flex space-x-4">+ <button+ onClick={() => onNavigate('termsOfService')}+ className="text-blue-400 hover:text-blue-300 text-xs transition-colors"+ >+ Terms of Service+ </button>+ <button+ onClick={() => onNavigate('privacyPolicy')}+ className="text-blue-400 hover:text-blue-300 text-xs transition-colors"+ >+ Privacy Policy+ </button>+ </div>+ </div>+ </div>+ );+};++export default TrademarksScreen;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/ui/table.tsx b/fincept-terminal-desktop/src/components/ui/table.tsxnew file mode 100644index 000000000..51b74dd52--- /dev/null+++ b/fincept-terminal-desktop/src/components/ui/table.tsx@@ -0,0 +1,116 @@+"use client"++import * as React from "react"++import { cn } from "@/lib/utils"++function Table({ className, ...props }: React.ComponentProps<"table">) {+ return (+ <div+ data-slot="table-container"+ className="relative w-full overflow-x-auto"+ >+ <table+ data-slot="table"+ className={cn("w-full caption-bottom text-sm", className)}+ {...props}+ />+ </div>+ )+}++function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {+ return (+ <thead+ data-slot="table-header"+ className={cn("[&_tr]:border-b", className)}+ {...props}+ />+ )+}++function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {+ return (+ <tbody+ data-slot="table-body"+ className={cn("[&_tr:last-child]:border-0", className)}+ {...props}+ />+ )+}++function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {+ return (+ <tfoot+ data-slot="table-footer"+ className={cn(+ "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",+ className+ )}+ {...props}+ />+ )+}++function TableRow({ className, ...props }: React.ComponentProps<"tr">) {+ return (+ <tr+ data-slot="table-row"+ className={cn(+ "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",+ className+ )}+ {...props}+ />+ )+}++function TableHead({ className, ...props }: React.ComponentProps<"th">) {+ return (+ <th+ data-slot="table-head"+ className={cn(+ "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",+ className+ )}+ {...props}+ />+ )+}++function TableCell({ className, ...props }: React.ComponentProps<"td">) {+ return (+ <td+ data-slot="table-cell"+ className={cn(+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",+ className+ )}+ {...props}+ />+ )+}++function TableCaption({+ className,+ ...props+}: React.ComponentProps<"caption">) {+ return (+ <caption+ data-slot="table-caption"+ className={cn("text-muted-foreground mt-4 text-sm", className)}+ {...props}+ />+ )+}++export {+ Table,+ TableHeader,+ TableBody,+ TableFooter,+ TableHead,+ TableRow,+ TableCell,+ TableCaption,+}diff --git a/fincept-terminal-desktop/src/contexts/AuthContext.tsx b/fincept-terminal-desktop/src/contexts/AuthContext.tsxnew file mode 100644index 000000000..c6e1712f3--- /dev/null+++ b/fincept-terminal-desktop/src/contexts/AuthContext.tsx@@ -0,0 +1,523 @@+// File: src/contexts/AuthContext.tsx+// Authentication context for managing user state and backend API integration++import React, { createContext, useContext, useState, useEffect, ReactNode } from 'react';+import { AuthApiService } from '@/services/authApi';++// Types based on your Python API client+interface SessionData {+ authenticated: boolean;+ user_type: 'guest' | 'registered' | null;+ api_key: string | null;+ device_id: string;+ user_info?: {+ username?: string;+ email?: string;+ credit_balance?: number;+ };+ expires_at?: string;+ daily_limit?: number;+ requests_today?: number;+}++interface AuthContextType {+ session: SessionData | null;+ isLoading: boolean;+ isFirstTimeUser: boolean;+ login: (email: string, password: string) => Promise<{ success: boolean; error?: string }>;+ signup: (username: string, email: string, password: string) => Promise<{ success: boolean; error?: string }>;+ verifyOtp: (email: string, otp: string) => Promise<{ success: boolean; error?: string }>;+ setupGuestAccess: () => Promise<{ success: boolean; error?: string }>;+ logout: () => Promise<void>;+ checkApiConnectivity: () => Promise<boolean>;+ forgotPassword: (email: string) => Promise<{ success: boolean; error?: string }>;+ resetPassword: (email: string, otp: string, newPassword: string) => Promise<{ success: boolean; error?: string }>;+}++const AuthContext = createContext<AuthContextType | undefined>(undefined);++// Device ID generation+const generateDeviceId = (): string => {+ const getNavigatorInfo = () => {+ return {+ platform: navigator.platform,+ userAgent: navigator.userAgent,+ language: navigator.language,+ cookieEnabled: navigator.cookieEnabled,+ onLine: navigator.onLine+ };+ };++ const info = getNavigatorInfo();+ const infoString = JSON.stringify(info);++ let hash = 0;+ for (let i = 0; i < infoString.length; i++) {+ const char = infoString.charCodeAt(i);+ hash = ((hash << 5) - hash) + char;+ hash = hash & hash;+ }++ return `desktop_${Math.abs(hash).toString(16)}`;+};++// Session storage utilities+const STORAGE_KEY = 'fincept_session';++const saveSession = (session: SessionData) => {+ try {+ localStorage.setItem(STORAGE_KEY, JSON.stringify({+ ...session,+ saved_at: new Date().toISOString()+ }));+ } catch (error) {+ console.error('Failed to save session:', error);+ }+};++const loadSession = (): SessionData | null => {+ try {+ const stored = localStorage.getItem(STORAGE_KEY);+ if (!stored) return null;++ const session = JSON.parse(stored);+ if (session.user_type === 'guest' && session.expires_at) {+ if (new Date() > new Date(session.expires_at)) {+ clearSession();+ return null;+ }+ }++ return session;+ } catch (error) {+ console.error('Failed to load session:', error);+ clearSession();+ return null;+ }+};++const clearSession = () => {+ try {+ localStorage.removeItem(STORAGE_KEY);+ } catch (error) {+ console.error('Failed to clear session:', error);+ }+};++const checkIsFirstTimeUser = (): boolean => {+ return !localStorage.getItem(STORAGE_KEY);+};++interface AuthProviderProps {+ children: ReactNode;+}++export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {+ const [session, setSession] = useState<SessionData | null>(null);+ const [isLoading, setIsLoading] = useState(true);+ const [isFirstTimeUser, setIsFirstTimeUser] = useState(false);++ // Validate session with API+ const validateSession = async (sessionData: SessionData): Promise<SessionData | null> => {+ if (!sessionData.api_key) return null;++ const headers: Record<string, string> = {};+ if (sessionData.api_key) {+ headers['X-API-Key'] = sessionData.api_key;+ }+ if (sessionData.device_id) {+ headers['X-Device-ID'] = sessionData.device_id;+ }++ const result = await AuthApiService.getAuthStatus(sessionData.api_key, sessionData.device_id);++ if (result.success && result.data?.authenticated) {+ const apiData = result.data;+ return {+ authenticated: true,+ user_type: apiData.user_type,+ api_key: sessionData.api_key,+ device_id: sessionData.device_id,+ user_info: apiData.user_type === 'registered' ? apiData.user : undefined,+ expires_at: apiData.user_type === 'guest' ? apiData.guest?.expires_at : undefined,+ daily_limit: apiData.user_type === 'guest' ? apiData.guest?.daily_limit : undefined,+ requests_today: apiData.user_type === 'guest' ? apiData.guest?.requests_today : undefined+ };+ }++ return null;+ };++ // Initialize session on app load+ useEffect(() => {+ const initializeSession = async () => {+ console.log('AuthContext: Initializing session...');++ try {+ setIsFirstTimeUser(checkIsFirstTimeUser());++ const savedSession = loadSession();+ console.log('AuthContext: Saved session:', savedSession ? 'Found' : 'Not found');++ if (savedSession) {+ console.log('AuthContext: Validating session with API...');+ // For development, skip API validation to avoid CORS issues+ if (import.meta.env.DEV) {+ console.log('AuthContext: Development mode - using saved session without validation');+ setSession(savedSession);+ } else {+ const validatedSession = await validateSession(savedSession);+ if (validatedSession) {+ console.log('AuthContext: Session validated successfully');+ setSession(validatedSession);+ saveSession(validatedSession);+ } else {+ console.log('AuthContext: Session validation failed, clearing...');+ clearSession();+ }+ }+ }++ } catch (error) {+ console.error('AuthContext: Initialization error:', error);+ } finally {+ console.log('AuthContext: Initialization complete');+ setIsLoading(false);+ }+ };++ initializeSession();+ }, []);++ // Check API connectivity+ const checkApiConnectivity = async (): Promise<boolean> => {+ try {+ console.log('Checking API connectivity...');++ const isConnected = await AuthApiService.checkHealth();++ console.log('API connectivity result:', isConnected);+ return isConnected;+ } catch (error) {+ console.error('API connectivity check failed:', error);+ return false;+ }+ };++ // Login function+ const login = async (email: string, password: string): Promise<{ success: boolean; error?: string }> => {+ try {+ console.log('AuthContext: Attempting login for:', email);++ const result = await AuthApiService.login({ email, password });++ if (result.success && result.data?.success) {+ const apiData = result.data.data;+ const newSession: SessionData = {+ authenticated: true,+ user_type: 'registered',+ api_key: apiData.api_key,+ device_id: generateDeviceId(),+ user_info: {+ username: apiData.username,+ email: apiData.email,+ credit_balance: apiData.credit_balance+ }+ };++ setSession(newSession);+ saveSession(newSession);+ setIsFirstTimeUser(checkIsFirstTimeUser());++ console.log('AuthContext: Login successful');+ return { success: true };+ } else {+ console.log('AuthContext: Login failed:', result.data?.message || result.error);+ return {+ success: false,+ error: result.data?.message || result.error || 'Login failed'+ };+ }+ } catch (error) {+ console.error('AuthContext: Login error:', error);+ return {+ success: false,+ error: error instanceof Error ? error.message : 'Login failed'+ };+ }+ };++ // Signup function+ const signup = async (username: string, email: string, password: string): Promise<{ success: boolean; error?: string }> => {+ try {+ console.log('AuthContext: Attempting signup for:', username, email);++ const result = await AuthApiService.register({+ username,+ email,+ password+ });++ if (result.success && result.data?.success) {+ console.log('AuthContext: Signup successful, OTP sent');+ return { success: true };+ } else {+ console.log('AuthContext: Signup failed:', result.data?.message || result.error);+ return {+ success: false,+ error: result.data?.message || result.error || 'Registration failed'+ };+ }+ } catch (error) {+ console.error('AuthContext: Signup error:', error);+ return {+ success: false,+ error: error instanceof Error ? error.message : 'Registration failed'+ };+ }+ };++ // OTP verification+ const verifyOtp = async (email: string, otp: string): Promise<{ success: boolean; error?: string }> => {+ try {+ console.log('AuthContext: Verifying OTP for:', email);++ const result = await AuthApiService.verifyOtp({ email, otp });++ if (result.success && result.data?.success) {+ const apiData = result.data.data;+ const newSession: SessionData = {+ authenticated: true,+ user_type: 'registered',+ api_key: apiData.api_key,+ device_id: generateDeviceId(),+ user_info: {+ username: apiData.username,+ email: apiData.email,+ credit_balance: apiData.credit_balance+ }+ };++ setSession(newSession);+ saveSession(newSession);+ setIsFirstTimeUser(checkIsFirstTimeUser());++ console.log('AuthContext: OTP verification successful');+ return { success: true };+ } else {+ console.log('AuthContext: OTP verification failed:', result.data?.message || result.error);+ return {+ success: false,+ error: result.data?.message || result.error || 'Verification failed'+ };+ }+ } catch (error) {+ console.error('AuthContext: OTP verification error:', error);+ return {+ success: false,+ error: error instanceof Error ? error.message : 'Verification failed'+ };+ }+ };++ // Forgot password function+ const forgotPassword = async (email: string): Promise<{ success: boolean; error?: string }> => {+ try {+ console.log('AuthContext: Requesting password reset for:', email);++ const result = await AuthApiService.forgotPassword({ email });++ if (result.success && result.data?.success) {+ console.log('AuthContext: Password reset OTP sent successfully');+ return { success: true };+ } else {+ console.log('AuthContext: Password reset request failed:', result.data?.message || result.error);+ return {+ success: false,+ error: result.data?.message || result.error || 'Failed to send reset email'+ };+ }+ } catch (error) {+ console.error('AuthContext: Forgot password error:', error);+ return {+ success: false,+ error: error instanceof Error ? error.message : 'Failed to send reset email'+ };+ }+ };++ // Reset password function+ const resetPassword = async (email: string, otp: string, newPassword: string): Promise<{ success: boolean; error?: string }> => {+ try {+ console.log('AuthContext: Attempting password reset for:', email);++ const result = await AuthApiService.resetPassword({+ email,+ otp,+ new_password: newPassword+ });++ if (result.success && result.data?.success) {+ console.log('AuthContext: Password reset successful');+ return { success: true };+ } else {+ console.log('AuthContext: Password reset failed:', result.data?.message || result.error);+ return {+ success: false,+ error: result.data?.message || result.error || 'Password reset failed'+ };+ }+ } catch (error) {+ console.error('AuthContext: Reset password error:', error);+ return {+ success: false,+ error: error instanceof Error ? error.message : 'Password reset failed'+ };+ }+ };++ // Guest access setup+ const setupGuestAccess = async (): Promise<{ success: boolean; error?: string }> => {+ try {+ console.log('AuthContext: Setting up guest access...');++ // For development, create a mock guest session+ if (import.meta.env.DEV) {+ console.log('AuthContext: Development mode - creating mock guest session');++ const mockGuestSession: SessionData = {+ authenticated: true,+ user_type: 'guest',+ api_key: 'mock_guest_api_key_' + Date.now(),+ device_id: generateDeviceId(),+ expires_at: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(), // 24 hours+ daily_limit: 50,+ requests_today: 0+ };++ setSession(mockGuestSession);+ saveSession(mockGuestSession);+ setIsFirstTimeUser(checkIsFirstTimeUser());++ console.log('AuthContext: Mock guest session created');+ return { success: true };+ }++ const deviceId = generateDeviceId();++ const result = await AuthApiService.registerDevice({+ device_id: deviceId,+ device_name: `Fincept Terminal - ${navigator.platform}`,+ platform: 'desktop',+ hardware_info: {+ platform: navigator.platform,+ user_agent: navigator.userAgent,+ language: navigator.language+ }+ });++ if (result.success && result.data?.success) {+ const apiData = result.data.data;+ const guestSession: SessionData = {+ authenticated: true,+ user_type: 'guest',+ api_key: apiData.api_key || apiData.temp_api_key,+ device_id: deviceId,+ expires_at: apiData.expires_at,+ daily_limit: apiData.daily_limit || 50,+ requests_today: apiData.requests_today || 0+ };++ setSession(guestSession);+ saveSession(guestSession);+ setIsFirstTimeUser(checkIsFirstTimeUser());++ console.log('AuthContext: Guest access setup successful');+ return { success: true };+ } else if (result.status_code === 409) {+ console.log('AuthContext: Device exists, getting existing session...');++ const statusResult = await AuthApiService.getGuestStatus(deviceId);++ if (statusResult.success && statusResult.data?.success) {+ const statusData = statusResult.data.data;+ const existingSession: SessionData = {+ authenticated: true,+ user_type: 'guest',+ api_key: statusData.api_key,+ device_id: deviceId,+ expires_at: statusData.expires_at,+ daily_limit: statusData.daily_limit || 50,+ requests_today: statusData.requests_today || 0+ };++ setSession(existingSession);+ saveSession(existingSession);+ setIsFirstTimeUser(checkIsFirstTimeUser());++ console.log('AuthContext: Existing guest session retrieved');+ return { success: true };+ }+ }++ console.log('AuthContext: Guest setup failed:', result.data?.message || result.error);+ return {+ success: false,+ error: result.data?.message || result.error || 'Failed to setup guest access'+ };+ } catch (error) {+ console.error('AuthContext: Guest setup error:', error);+ return {+ success: false,+ error: error instanceof Error ? error.message : 'Failed to setup guest access'+ };+ }+ };++ // Logout function+ const logout = async (): Promise<void> => {+ console.log('AuthContext: Logging out...');++ if (session?.api_key) {+ try {+ await AuthApiService.logout(session.api_key);+ } catch (error) {+ console.error('Logout API call failed:', error);+ }+ }++ setSession(null);+ clearSession();+ setIsFirstTimeUser(checkIsFirstTimeUser());++ console.log('AuthContext: Logout complete');+ };++ const value: AuthContextType = {+ session,+ isLoading,+ isFirstTimeUser,+ login,+ signup,+ verifyOtp,+ setupGuestAccess,+ logout,+ checkApiConnectivity,+ forgotPassword,+ resetPassword+ };++ return (+ <AuthContext.Provider value={value}>+ {children}+ </AuthContext.Provider>+ );+};++export const useAuth = (): AuthContextType => {+ const context = useContext(AuthContext);+ if (context === undefined) {+ throw new Error('useAuth must be used within an AuthProvider');+ }+ return context;+};\ No newline at end of filediff --git a/fincept-terminal-desktop/src/main.tsx b/fincept-terminal-desktop/src/main.tsxindex 887079a26..b5ea38edd 100644--- a/fincept-terminal-desktop/src/main.tsx+++ b/fincept-terminal-desktop/src/main.tsx@@ -1,10 +1,13 @@import React from 'react'import ReactDOM from 'react-dom/client'import App from './App'+import { AuthProvider } from './contexts/AuthContext'import './app.css' // Make sure this line existsReactDOM.createRoot(document.getElementById('root')!).render(<React.StrictMode>- <App />+ <AuthProvider>+ <App />+ </AuthProvider></React.StrictMode>,)\ No newline at end of filediff --git a/fincept-terminal-desktop/src/services/authApi.tsx b/fincept-terminal-desktop/src/services/authApi.tsxnew file mode 100644index 000000000..9aab60ccd--- /dev/null+++ b/fincept-terminal-desktop/src/services/authApi.tsx@@ -0,0 +1,274 @@+// File: src/services/authApi.ts+// Authentication API service for handling all auth-related API calls++import { SessionData } from '@/contexts/AuthContext';++// API Configuration+const API_CONFIG = {+ BASE_URL: import.meta.env.DEV ? '/api' : 'https://finceptbackend.share.zrok.io',+ API_VERSION: 'v1',+ CONNECTION_TIMEOUT: 10000,+ REQUEST_TIMEOUT: 30000+};++const getApiEndpoint = (path: string) => `${API_CONFIG.BASE_URL}${path}`;++// API Response Types+interface ApiResponse<T = any> {+ success: boolean;+ data?: T;+ message?: string;+ error?: string;+ status_code?: number;+}++// Request Types+interface LoginRequest {+ email: string;+ password: string;+}++interface RegisterRequest {+ username: string;+ email: string;+ password: string;+}++interface VerifyOtpRequest {+ email: string;+ otp: string;+}++interface ForgotPasswordRequest {+ email: string;+}++interface ResetPasswordRequest {+ email: string;+ otp: string;+ new_password: string;+}++interface DeviceRegisterRequest {+ device_id: string;+ device_name: string;+ platform: string;+ hardware_info: {+ platform: string;+ user_agent: string;+ language: string;+ };+}++// Response Types+interface LoginResponse {+ api_key: string;+ username: string;+ email: string;+ credit_balance: number;+}++interface AuthStatusResponse {+ authenticated: boolean;+ user_type: 'guest' | 'registered';+ user?: {+ username: string;+ email: string;+ credit_balance: number;+ };+ guest?: {+ expires_at: string;+ daily_limit: number;+ requests_today: number;+ };+}++interface DeviceRegisterResponse {+ api_key?: string;+ temp_api_key?: string;+ expires_at?: string;+ daily_limit?: number;+ requests_today?: number;+}++// Generic API request function+const makeApiRequest = async <T = any>(+ method: string,+ endpoint: string,+ data?: any,+ headers?: Record<string, string>+): Promise<ApiResponse<T>> => {+ try {+ const defaultHeaders = {+ 'Content-Type': 'application/json',+ 'skip_zrok_interstitial': '1',+ ...headers+ };++ const url = getApiEndpoint(endpoint);+ console.log('🚀 Making request:', {+ method,+ url,+ endpoint,+ data,+ headers: defaultHeaders+ });++ const config: RequestInit = {+ method,+ headers: defaultHeaders,+ mode: 'cors',+ };++ if (data && (method === 'POST' || method === 'PUT')) {+ config.body = JSON.stringify(data);+ }++ const response = await fetch(url, config);++ console.log('📡 Response received:', {+ status: response.status,+ statusText: response.statusText,+ headers: Object.fromEntries(response.headers.entries()),+ url: response.url+ });++ const responseText = await response.text();+ console.log('📝 Raw response text:', responseText.substring(0, 200));++ let responseData;+ try {+ responseData = JSON.parse(responseText);+ console.log('✅ Parsed JSON:', responseData);+ } catch (parseError) {+ console.error('❌ JSON parse failed:', parseError);+ console.log('📄 Full response text:', responseText);++ return {+ success: false,+ error: `Invalid JSON response: ${responseText.substring(0, 100)}...`,+ status_code: response.status+ };+ }++ return {+ success: response.ok,+ data: responseData,+ status_code: response.status,+ error: response.ok ? undefined : responseData.message || `HTTP ${response.status}`+ };++ } catch (error) {+ console.error('💥 Request failed completely:', error);++ if (error instanceof TypeError && error.message.includes('Failed to fetch')) {+ return {+ success: false,+ error: 'Network error: Unable to connect to server. Please check your internet connection or try again later.'+ };+ }++ return {+ success: false,+ error: error instanceof Error ? error.message : 'Network error'+ };+ }+};++// Auth API Service Class+export class AuthApiService {+ // Health check+ static async checkHealth(): Promise<boolean> {+ try {+ const result = await makeApiRequest('GET', '/health');+ return result.success;+ } catch (error) {+ console.error('Health check failed:', error);+ return false;+ }+ }++ // Login user+ static async login(request: LoginRequest): Promise<ApiResponse<LoginResponse>> {+ return makeApiRequest<LoginResponse>('POST', '/auth/login', request);+ }++ // Register user+ static async register(request: RegisterRequest): Promise<ApiResponse> {+ return makeApiRequest('POST', '/auth/register', request);+ }++ // Verify OTP+ static async verifyOtp(request: VerifyOtpRequest): Promise<ApiResponse<LoginResponse>> {+ return makeApiRequest<LoginResponse>('POST', '/auth/verify-otp', request);+ }++ // Forgot password+ static async forgotPassword(request: ForgotPasswordRequest): Promise<ApiResponse> {+ return makeApiRequest('POST', '/auth/forgot-password', request);+ }++ // Reset password+ static async resetPassword(request: ResetPasswordRequest): Promise<ApiResponse> {+ return makeApiRequest('POST', '/auth/reset-password', request);+ }++ // Logout user+ static async logout(apiKey: string): Promise<ApiResponse> {+ return makeApiRequest('POST', '/auth/logout', undefined, {+ 'X-API-Key': apiKey+ });+ }++ // Get auth status+ static async getAuthStatus(apiKey: string, deviceId: string): Promise<ApiResponse<AuthStatusResponse>> {+ const headers: Record<string, string> = {};+ if (apiKey) {+ headers['X-API-Key'] = apiKey;+ }+ if (deviceId) {+ headers['X-Device-ID'] = deviceId;+ }++ return makeApiRequest<AuthStatusResponse>('GET', '/auth/status', undefined, headers);+ }++ // Register device for guest access+ static async registerDevice(request: DeviceRegisterRequest): Promise<ApiResponse<DeviceRegisterResponse>> {+ return makeApiRequest<DeviceRegisterResponse>('POST', '/device/register', request);+ }++ // Get guest status+ static async getGuestStatus(deviceId: string): Promise<ApiResponse<DeviceRegisterResponse>> {+ return makeApiRequest<DeviceRegisterResponse>('GET', '/guest/status', undefined, {+ 'X-Device-ID': deviceId+ });+ }+}++// Utility function to generate device ID+export const generateDeviceId = (): string => {+ const getNavigatorInfo = () => {+ return {+ platform: navigator.platform,+ userAgent: navigator.userAgent,+ language: navigator.language,+ cookieEnabled: navigator.cookieEnabled,+ onLine: navigator.onLine+ };+ };++ const info = getNavigatorInfo();+ const infoString = JSON.stringify(info);++ let hash = 0;+ for (let i = 0; i < infoString.length; i++) {+ const char = infoString.charCodeAt(i);+ hash = ((hash << 5) - hash) + char;+ hash = hash & hash;+ }++ return `desktop_${Math.abs(hash).toString(16)}`;+};++export default AuthApiService;\ No newline at end of filediff --git a/fincept-terminal-desktop/vite.config.ts b/fincept-terminal-desktop/vite.config.tsindex e4aa9ffee..346572ffb 100644--- a/fincept-terminal-desktop/vite.config.ts+++ b/fincept-terminal-desktop/vite.config.ts@@ -14,6 +14,20 @@ export default defineConfig({server: {port: 1420,strictPort: true,+ proxy: {+ '/api': {+ target: 'https://finceptbackend.share.zrok.io',+ changeOrigin: true,+ rewrite: (path) => path.replace(/^\/api/, ''),+ configure: (proxy, options) => {+ proxy.on('proxyReq', (proxyReq, req, res) => {+ // Add the skip_zrok_interstitial header+ proxyReq.setHeader('skip_zrok_interstitial', '1');+ console.log('Proxying request:', req.method, req.url, '-> https://finceptbackend.share.zrok.io' + req.url.replace('/api', ''));+ });+ }+ }+ }},envPrefix: ['VITE_', 'TAURI_'],})\ No newline at end of file