mirror of
https://github.com/caty21/forex-dashboard.git
synced 2026-08-09 18:50:57 +00:00
feat: banques centrales (vote+dot plot+previsions), calendrier elargi, fix InvestingLive, M3 auto
Central bank governance (nouvel onglet Banques centrales) : - lib/centralBankGovernance.ts + app/api/central-bank-sources : scraping live du vote de la derniere reunion, dot plot Fed (SEP), et desormais les previsions macro (PIB + inflation) publiees par chaque BC elle-meme (Fed SEP, Eurosystem staff projections, BoJ Outlook Report PDF, SNB conditional forecast, BoC MPR, RBA SMP). GBP/NZD laisses honnetement vides quand aucune source chiffree fiable n'est accessible (RBNZ bloque par Cloudflare). - components/CentralBankSourcesTab.tsx : nouvel onglet avec cards par banque. Taux directeurs + Money Supply M3 : - data/rate_decisions.json corrige (JPY, EUR, NZD etc. etaient perimes d'1-2 decisions) et desormais auto-maintenu : .github/workflows/update-rate-decisions.yml (horaire) detecte les changements de taux via Trading Economics et fait glisser current -> prev sans perte de donnee. - data/money-supply-m3.json (nouveau) + .github/workflows/fetch-money-supply.yml (hebdo) : M3 par devise (proxy M2 pour l'USD, la Fed ne publiant plus M3 depuis 2006), affiche dans CurrencyCard. Calendrier economique elargi : - lib/calendar-countries.ts, lib/calendar-taxonomy.ts, lib/fxstreetCalendar.ts : couverture pays elargie + classification des evenements + source FXStreet. Fix InvestingLive : - lib/investinglive.ts : l'ancienne API WordPress (wp-json) renvoyait 404 depuis leur migration Nuxt.js -> reecrit vers api.investinglive.com/api/homepage/articles, + fix crash silencieux (Tldr pas toujours un tableau). Divers : - .vercel/ ajoute au .gitignore (ne doit jamais etre commite, cf. son propre README). - scripts/ (lancement PWA, push env Vercel), captures d'ecran, cache InvestingLive. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
' Lance le dashboard Forex en PWA : demarre "npm run dev" si besoin (silencieux,
|
||||
' attend que le serveur reponde), puis ouvre l'app Chrome installee.
|
||||
' Cible ce script depuis le raccourci Bureau / Menu Demarrer a la place de
|
||||
' chrome_proxy.exe directement, pour ne plus tomber sur une page blanche
|
||||
' quand le serveur de dev n'est pas deja lance.
|
||||
|
||||
projectDir = "C:\Users\capug\Documents\Private\Investissements\Trading\Code\forex-dashboard"
|
||||
logDir = projectDir & "\logs"
|
||||
serverUrl = "http://localhost:3000/"
|
||||
chromeExe = "C:\Program Files\Google\Chrome\Application\chrome_proxy.exe"
|
||||
chromeArgs = " --profile-directory=""Profile 4"" --app-id=hbblfifohofgngfbjbiimbbcimepbdcb"
|
||||
maxWaitSec = 30
|
||||
|
||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
|
||||
If Not fso.FolderExists(logDir) Then fso.CreateFolder(logDir)
|
||||
|
||||
Function IsServerUp(url)
|
||||
On Error Resume Next
|
||||
Dim http
|
||||
IsServerUp = False
|
||||
Set http = CreateObject("MSXML2.XMLHTTP")
|
||||
http.Open "GET", url, False
|
||||
http.Send
|
||||
If Err.Number = 0 And http.Status >= 200 And http.Status < 500 Then
|
||||
IsServerUp = True
|
||||
End If
|
||||
Err.Clear
|
||||
On Error Goto 0
|
||||
End Function
|
||||
|
||||
If Not IsServerUp(serverUrl) Then
|
||||
WshShell.CurrentDirectory = projectDir
|
||||
cmd = "cmd /c npm run dev >> """ & logDir & "\dashboard.log"" 2>&1"
|
||||
WshShell.Run cmd, 0, False
|
||||
|
||||
waited = 0
|
||||
Do While waited < maxWaitSec
|
||||
WScript.Sleep 1000
|
||||
waited = waited + 1
|
||||
If IsServerUp(serverUrl) Then Exit Do
|
||||
Loop
|
||||
End If
|
||||
|
||||
WshShell.Run """" & chromeExe & """" & chromeArgs, 1, False
|
||||
@@ -0,0 +1,57 @@
|
||||
import { readFileSync } from "fs";
|
||||
import { join, dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const envFile = join(__dirname, "../.env.local");
|
||||
const TOKEN = process.env.VERCEL_TOKEN;
|
||||
const PROJECT_ID = process.env.VERCEL_PROJECT_ID;
|
||||
const TEAM_ID = process.env.VERCEL_TEAM_ID;
|
||||
|
||||
if (!TOKEN || !PROJECT_ID || !TEAM_ID) {
|
||||
console.error("Missing VERCEL_TOKEN, VERCEL_PROJECT_ID or VERCEL_TEAM_ID");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const lines = readFileSync(envFile, "utf8").split("\n");
|
||||
const envVars = [];
|
||||
for (const line of lines) {
|
||||
const trimmed = line.trim();
|
||||
if (!trimmed || trimmed.startsWith("#")) continue;
|
||||
const idx = trimmed.indexOf("=");
|
||||
if (idx < 0) continue;
|
||||
const key = trimmed.slice(0, idx).trim();
|
||||
const value = trimmed.slice(idx + 1).trim();
|
||||
if (key) envVars.push({ key, value });
|
||||
}
|
||||
|
||||
console.log(`Found ${envVars.length} variables to push...`);
|
||||
|
||||
for (const { key, value } of envVars) {
|
||||
const res = await fetch(
|
||||
`https://api.vercel.com/v10/projects/${PROJECT_ID}/env?teamId=${TEAM_ID}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: `Bearer ${TOKEN}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
key,
|
||||
value,
|
||||
type: "encrypted",
|
||||
target: ["production", "preview"],
|
||||
}),
|
||||
}
|
||||
);
|
||||
const data = await res.json();
|
||||
if (data.key) {
|
||||
console.log(` ✓ ${key}`);
|
||||
} else if (data.error?.code === "ENV_ALREADY_EXISTS") {
|
||||
console.log(` ~ ${key} (already exists, skipping)`);
|
||||
} else {
|
||||
console.log(` ✗ ${key}: ${data.error?.message ?? JSON.stringify(data)}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("\nDone. Now deploying to production...");
|
||||
@@ -0,0 +1,13 @@
|
||||
' Lance le dashboard Forex (npm run dev) en arriere-plan, sans fenetre visible.
|
||||
' Copie de ce fichier dans le dossier Demarrage de Windows (shell:startup)
|
||||
' pour un lancement automatique a chaque connexion.
|
||||
projectDir = "C:\Users\capug\Documents\Private\Investissements\Trading\Code\forex-dashboard"
|
||||
logDir = projectDir & "\logs"
|
||||
|
||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
If Not fso.FolderExists(logDir) Then fso.CreateFolder(logDir)
|
||||
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
WshShell.CurrentDirectory = projectDir
|
||||
cmd = "cmd /c npm run dev >> """ & logDir & "\dashboard.log"" 2>&1"
|
||||
WshShell.Run cmd, 0, False
|
||||
Reference in New Issue
Block a user