Modernized glass-style daily AI/ML papers app using a Vite/React client and an Express API proxy to arXiv.
- Frontend: React 18 + Vite, custom CSS.
- Backend: Express +
fast-xml-parser, JSON file store for user interests/history. - Deploy: works on Render/Railway (backend) + GitHub Pages/Vercel (frontend).
Prereqs: Node 18+ and npm.
-
Start the API (uses PORT, defaults to 5050 to avoid macOS 5000 conflict):
cd server npm install PORT=5050 npm startRuns on
http://localhost:5050by default. -
Start the client (separate terminal):
cd client npm install # point to your API; for local server on 5050: VITE_API_BASE=http://localhost:5050/api npm run dev -- --host
Vite dev server:
http://localhost:5173. If you prefer the proxy, start the client withAPI_PORT=5050 npm run dev -- --hostand use/apiin the client.
GET /api/health— simple health check.GET /api/papers?interests=comma,separated&preferFresh=true|falseinterests: optional, comma-separated keywords. Up to 12 kept.preferFresh:trueto sort by submission date, otherwise last-updated. Returns{ source: "live" | "fallback", papers: [...], lastUpdated }.
- Interests and history are persisted in
localStorage(gp_interests,gp_history). - Buttons disable during fetches; fallbacks show if the API call fails.
- Set
VITE_API_BASEto point at a remote API; setVITE_BASEto your repo base when building for GitHub Pages (e.g.,/your-repo-name/). Defaults are/apifor dev and/base for builds.
Backend (Render/Railway):
- Build:
npm install - Start:
npm start - Env:
PORT=5050(or your choice). Copy the public URL, e.g.,https://your-app.onrender.com/api.
Frontend (GitHub Pages via workflow in .github/workflows/deploy-gh-pages.yml):
- Set repo secret
VITE_API_BASEto your backend URL (include/api). - Workflow sets
VITE_BASE=/<repo-name>/for Pages. - On push to
main, the action buildsclient/distand publishes togh-pages. Ensure Pages source is set togh-pages.
Frontend (Vercel):
- Root:
client - Build:
npm run build - Output:
dist - Env:
VITE_API_BASE=https://your-app.onrender.com/api - Optional:
VITE_BASE=/
- Abstracts escape HTML, render
\emph{}/\textit{}, inline$...$and simple\frac{a}{b}, and map common Greek tokens (e.g.,\varepsilon->ε). - History pills link directly to the arXiv paper URLs.