Spaces:
Running
Running
Commit History
-
<!DOCTYPE html>
Verified signature<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Msonjo Trade - Live Market Analysis</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> :root { --primary-color: #0c1b33; --secondary-color: #152642; --accent-color: #1e3a5f; --highlight-color: #2a4a7a; --text-color: #e6e6e6; --bullish-color: #00c805; --very-bullish-color: #008a05; --bearish-color: #ff3b30; --very-bearish-color: #c62828; --neutral-color: #757575; --update-color: #4db8ff; --forex-color: #4db8ff; --commodity-color: #ffa726; --index-color: #66bb6a; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Seg…0076ebc
-
name: CI - Build & Push Docker Images
Verified signatureon: push: branches: [ main, master ] jobs: build-and-push: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up QEMU (for cross-platform) uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push backend uses: docker/build-push-action@v5 with: context: ./backend push: true tags: | dockerhub_user/realtime-dashboard-backend:latest dockerhub_user/realtime-dashboard-backend:${{ github.sha }} - name: Build and push frontend uses: docker/build-push-action@v5 with: context: ./frontend push: true tags: | dock…c6438be -
name: CI - Build & Push Docker Images
Verified signatureon: push: branches: [ main, master ] jobs: build-and-push: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up QEMU (for cross-platform) uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push backend uses: docker/build-push-action@v5 with: context: ./backend push: true tags: | dockerhub_user/realtime-dashboard-backend:latest dockerhub_user/realtime-dashboard-backend:${{ github.sha }} - name: Build and push frontend uses: docker/build-push-action@v5 with: context: ./frontend push: true tags: | dock…7ed726e -
Deploy this stack to a server (DigitalOcean / Render) and attach a live URL.
Verified signature10a7b6d -
copy this website
Verified signature0ee2a9d -
// backend/dataSources.js
Verified signature// Fetches/combines data from CoinGecko (crypto), AlphaVantage (FX optional), // TradingEconomics (macro indicators, optional), and CFTC (COT) public archives. // Exports baseMockRows() and enrichRowsWithLiveData(rows) used by server.js. const axios = require('axios'); const AdmZip = require('adm-zip'); const { JSDOM } = require('jsdom'); const fs = require('fs'); const path = require('path'); const os = require('os'); const COINGECKO_SIMPLE_PRICE = 'https://api.coingecko.com/api/v3/simple/price'; const ALPHA_BASE = 'https://www.alphavantage.co/query'; const TE_BASE = 'https://api.tradingeconomics.com'; const CFTC_INDEX = 'https://www.cftc.gov/MarketReports/CommitmentsofTraders/HistoricalCompressed/index.htm'; // instruments (example set — expand to match your screenshot) const DEFAULT_ASSETS = [ { asset: "USOIL", type: "commodity", teSymbol: "oil" }, { asset: "BITCOIN", type: "crypto", cgId: "bitcoin" }, { asset: "COPPER", type: "commodity" }, { asset: "USDZAR", type: "fx",…46b6a38 -
ready-to-deploy code
Verified signature928d2d1 -
create a fundamental bias macro seasonality and trend
Verified signature94f3c8e -
copy the disgn only create with logo msonjo trade
Verified signaturef57176a -
fundamental bias
Verified signature1c21608 -
create for me website with real time data
Verified signature9465963 -
Upload 1 image(s)
Verified signatureab8a848 -
Upload 1 image(s)
Verified signature2b16697 -
Upload 1 image(s)
Verified signature351f243 -
import { useEffect, useState } from 'react';
Verified signatureimport axios from 'axios'; import Heatmap from './Heatmap'; import Charts from './Charts'; import { Transition } from '@headlessui/react'; export default function Dashboard() { const [data, setData] = useState([]); const [prevData, setPrevData] = useState([]); const [lastUpdated, setLastUpdated] = useState(new Date()); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { const fetchData = async () => { try { setLoading(true); setError(null); const res = await axios.get(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/data`); setPrevData(data); // Save previous data for animation setData(res.data); setLastUpdated(new Date()); } catch (err) { console.error("Failed to fetch data:", err); setError("Failed to load data. Please try again."); } finally { setLoading(false); } }; fetchData(); const interval = setInterval(…2a30b67 -
# Msonjo Trade - Fundamental Bias Dashboard (Full Package)
Verified signatureThis repository contains a full-stack example project for a real-time fundamental bias dashboard. It includes: - `backend/`: Node.js/Express server that fetches market data and computes bias scores. - `frontend/`: Next.js + Tailwind frontend that visualizes the scores (heatmap, charts, table). - `deploy.sh`: helper script for deploying the frontend (Vercel) and guidance for backend deploy. ## Quickstart (Local) ### Backend 1. Copy `backend/.env.example` to `backend/.env` and fill your API keys. 2. Install and start: ``` cd backend npm install npm start ``` Backend will run on `http://localhost:3001` by default. ### Frontend 1. Configure frontend to point to backend: ``` cp frontend/.env.local.example frontend/.env.local # Edit NEXT_PUBLIC_API_BASE_URL if backend is not on localhost ``` 2. Install and run the frontend: ``` cd frontend npm install npm run dev ``` Frontend will run on `http://localhost:3000`. ## Deployment - Backend: Dep…3137d1b -
import { useEffect, useState } from 'react';
Verified signatureimport axios from 'axios'; import Heatmap from './Heatmap'; import Charts from './Charts'; export default function Dashboard() { const [data, setData] = useState([]); useEffect(() => { const fetchData = async () => { const res = await axios.get(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/data`); setData(res.data); }; fetchData(); const interval = setInterval(fetchData, 60000); return () => clearInterval(interval); }, []); return ( <div className="p-4 bg-gray-100 min-h-screen"> <header className="flex justify-between items-center bg-gray-800 text-white p-4 shadow-md"> <h1 className="text-2xl font-bold">Msonjo Trade</h1> <span>Last Updated: {new Date().toLocaleTimeString()}</span> </header> <Heatmap data={data} /> <Charts data={data} /> <table className="min-w-full mt-4 bg-white rounded shadow"> <thead className="bg-gray-200"> <tr> <th className="py-2 px-4">Asset<…2b98dbb -
Features of this Full Website
Verified signatureAll major & minor Forex pairs + commodities + indices Macro, micro fundamentals, seasonality, COT, options market integrated Single-page dashboard Color-coded heatmap for fast visual bias assessment Interactive chart for bias scores Real-time auto-refresh every 60s Fully deployable (Vercel frontend + Render/Railway backend)503a6a5 -
Perfect! Let’s combine everything into a complete live website that provides real-time fundamental bias scores for Forex, Commodities, and Indices, integrating:
Verified signatureMacro fundamentals (GDP, CPI, Interest Rates) Micro fundamentals (volume, market cap, sentiment) Seasonality (historical returns) COT report (CFTC data) Options market (implied volatility, open interest75139ed -
const fetchCOTData = async (symbol) => {
Verified signatureconst response = await fetch(`https://www.cftc.gov/dea/newcot/FinFutWk.txt`); const data = await response.text(); // Parse the data to extract relevant information // Calculate net positions and determine market sentiment // Return the COT score }; const calculateOverallScore = async (symbol) => { const macroScore = await getMacroScore(symbol); const microScore = await getMicroScore(symbol); const seasonalityScore = await getSeasonalityScore(symbol); const cotScore = await fetchCOTData(symbol); const overallScore = (macroScore + microScore + seasonalityScore + cotScore) / 4; return overallScore; };16169d9 -
const express = require("express");
Verified signatureconst fetch = require("node-fetch"); const NodeCache = require("node-cache"); const router = express.Router(); const cache = new NodeCache({ stdTTL: 600 }); const TE_KEY = process.env.TE_API_KEY; const CFTC_KEY = process.env.CFTC_API_KEY; const OPTIONS_KEY = process.env.OPTIONS_API_KEY; // Helpers function normalize(value,min,max){ if(value==null) return 50; if(value<=min) return 0; if(value>=max) return 100; return Math.round((value-min)/(max-min)*100); } function normalizeEdge(score){return Math.round((score/100-0.5)*18);} // Macro async function getMacro(country){ const cached = cache.get(`macro:${country}`); if(cached) return cached; try{ const base="https://api.tradingeconomics.com"; const [irR,cpiR,gdpR] = await Promise.all([ fetch(`${base}/country/${country}/interest-rate?c=${TE_KEY}`), fetch(`${base}/country/${country}/consumer-price-index?c=${TE_KEY}`), fetch(`${base}/country/${country}/gdp?c=${TE_KEY}`) ]); const [irJ,cpiJ,gd…a75e49f -
const express = require("express");
Verified signatureconst fetch = require("node-fetch"); const NodeCache = require("node-cache"); const router = express.Router(); const cache = new NodeCache({ stdTTL: 600 }); const TE_KEY = process.env.TE_API_KEY; const CFTC_KEY = process.env.CFTC_API_KEY; const OPTIONS_KEY = process.env.OPTIONS_API_KEY; // Helpers function normalize(value,min,max){ if(value==null) return 50; if(value<=min) return 0; if(value>=max) return 100; return Math.round((value-min)/(max-min)*100); } function normalizeEdge(score){return Math.round((score/100-0.5)*18);} // Macro async function getMacro(country){ const cached = cache.get(`macro:${country}`); if(cached) return cached; try{ const base="https://api.tradingeconomics.com"; const [irR,cpiR,gdpR] = await Promise.all([ fetch(`${base}/country/${country}/interest-rate?c=${TE_KEY}`), fetch(`${base}/country/${country}/consumer-price-index?c=${TE_KEY}`), fetch(`${base}/country/${country}/gdp?c=${TE_KEY}`) ]); const [irJ,cpiJ,gd…0d83122 -
creat for me fundamental bias with seasonality cot report bias with score and real time data
Verified signature8ad5353 -
initial commit
Verified signature613c077