Electron + React desktop focus tracker with a Vercel API that settles using Solana.
From repo root:
npm install
cd desktop && npm installCopy .env.example to .env in repo root and fill in:
SOLANA_RPC_URL– Solana RPC (e.g.https://api.devnet.solana.com)SOL_TREASURY_SECRET– full JSON array for a devnet wallet secret keyMOCK_SOL_PRICE_USD– optional, default100
Copy desktop/.env.example to desktop/.env:
- Local dev:
VITE_BACKEND_URL=http://localhost:3000 - Production:
VITE_BACKEND_URL=https://focusfee.vercel.app(or your Vercel URL)
From the project root, run:
npm run devThis now starts:
- API server (port 3000)
- Electron desktop app (with Vite dev server)
If you want browser-only mode instead, run:
npm run dev:browserThen open http://localhost:5173 in your browser.
Alternative (two terminals): Run npm run dev:api in one terminal, then npm run dev:web in another. Open http://localhost:5173.
If port 3000 is in use: $env:PORT=3001; npm run dev and the app will proxy to 3001.
Terminal 2 – Desktop app:
npm run dev:desktopEnsure desktop/.env has VITE_BACKEND_URL=http://localhost:3000 for local API.
When ready to deploy the API:
npm run deployOr vercel for preview, vercel --prod for production.
Set env vars in Vercel dashboard (Settings → Environment Variables): SOLANA_RPC_URL, SOL_TREASURY_SECRET, MOCK_SOL_PRICE_USD.
Then update desktop/.env to use your Vercel URL for production builds.
From repo root:
npm run build:desktopSettlement endpoint is:
POST /api/invest
Body:
{
"usdCents": 125,
"toAddress": "<solana-public-key>"
}