-
Notifications
You must be signed in to change notification settings - Fork 0
Home
prashant edited this page May 11, 2026
·
1 revision
AI-powered research discovery platform.
Live: https://journal-lens.vercel.app/
cd backend
npm install
npm startBackend entry: backend/index.js
cd frontend
npm install
npm run devRequired by backend code:
PORT=8080
# OpenAlex
OPENALEX_BASE_URL=https://api.openalex.org
OPENALEX_API_KEY=your_openalex_api_key
# CORS (used in backend/configs/corsOptions.js)
FRONTEND_URL=http://localhost:5173
# Groq (used in backend/routes/chat.js)
GROQ_API_KEY=your_groq_api_key
# Clerk (used by @clerk/express middleware)
CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key(Referenced in repository README)
VITE_BACKEND_BASE_URL=http://localhost:8080/api
VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
VITE_LOGO_DEV_PUBLIC_KEY=your_logo_dev_public_keyBackend uses Clerk:
- Global middleware:
clerkMiddleware()inbackend/index.js - All API routers also enforce auth:
router.use(requireAuth) -
requireAuthchecksgetAuth(req).userIdand returns 401 if missing.
So, these endpoints require a valid Clerk-authenticated request.
Base server mounts (from backend/index.js):
/api/chat/api/researchpapers/api/author/api/providers
-
POST /api/chat/ingest-text- body:
{ "journalId": "...", "text": "..." } - stores chunks in an in-memory
pdfStoreobject (not persistent)
- body:
-
POST /api/chat/ask- body:
{ "journalId": "...", "question": "...", "chatHistory": [] } - returns:
{ "answer": "..." } - if not ingested: 404
"PDF not ingested yet."
- body:
-
GET /api/researchpapers?field=...&pageNum=...&authorId=...-
fieldandpageNumare required (else 400) - uses OpenAlex
/workswith filter:type:article,open_access.is_oa:true - if
authorIdprovided: addsauthor.id:${authorId}
-
-
GET /api/author/id?author=...-
authorrequired (else 400) - queries OpenAlex
/authors - returns first match’s
display_name+ids
-
-
GET /api/providers?page=1&per_page=25- lists publishers (OpenAlex
/publishers)
- lists publishers (OpenAlex
-
GET /api/providers/sources/:providerId- lists sources/journals for provider (OpenAlex
/sources)
- lists sources/journals for provider (OpenAlex
-
GET /api/providers/:providerId- single publisher detail (OpenAlex
/publishers/{providerId})
- single publisher detail (OpenAlex
- express
- cors
- dotenv
- @clerk/express
- axios
- groq-sdk
- pdf-parse
- node-fetch
- mongoose (installed; not used in the shown backend entry/routes)