A full-stack application for searching and viewing scientific articles from PubMed using natural language queries.
- 🔍 Natural language search for PubMed articles
- 🤖 AI-powered brief summaries (using OpenAI GPT-3.5)
- 📄 Full article abstracts
- 📑 Section identification in articles
- 🎨 Modern, responsive UI
- Backend: NestJS (Node.js)
- Frontend: Vue 3 with Vite
- API: PubMed E-utilities API
- AI: OpenAI GPT-3.5 Turbo (optional, with fallback)
pubmed-helper/
├── backend/ # NestJS backend
│ ├── src/
│ │ ├── ai/ # AI service for generating summaries
│ │ ├── pubmed/ # PubMed API service
│ │ ├── search/ # Search controller and service
│ │ └── main.ts # Application entry point
│ └── package.json
│
└── frontend/ # Vue 3 frontend
├── src/
│ ├── components/ # Vue components
│ ├── services/ # API service
│ └── App.vue # Main app component
└── package.json
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install-
(Optional) Set up OpenAI API key for AI summaries:
- Get your API key from OpenAI Platform
- Set it as an environment variable:
export OPENAI_API_KEY=your_api_key_here- Or create a
.envfile in the backend directory:
OPENAI_API_KEY=your_api_key_here- Note: If no API key is provided, the app will use intelligent fallback summaries based on the abstract.
-
Start the development server:
npm run start:devThe backend will run on http://localhost:3000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will run on http://localhost:5173
- Start both the backend and frontend servers
- Open your browser to
http://localhost:5173 - Enter a natural language query (e.g., "diabetes treatment", "cancer research")
- View the AI-generated brief summaries, full abstracts, and article sections
Search for articles using natural language.
Query Parameters:
q(required): Search querylimit(optional): Maximum number of results (default: 5, max: 20)
Example:
GET http://localhost:3000/search?q=diabetes%20treatment&limit=5
MIT