https://github.com/dmunasingha/wikipedia-clone
This project is a simple Wikipedia-like application that leverages the Wikipedia API to allow users to search for articles and retrieve content dynamically. The frontend is built using React, and the backend is powered by Node.js and Express.
https://github.com/dmunasingha/wikipedia-clone
clone expressjs javascript react wikipedia-api
Last synced: about 2 months ago
JSON representation
This project is a simple Wikipedia-like application that leverages the Wikipedia API to allow users to search for articles and retrieve content dynamically. The frontend is built using React, and the backend is powered by Node.js and Express.
- Host: GitHub
- URL: https://github.com/dmunasingha/wikipedia-clone
- Owner: dmunasingha
- Created: 2024-10-31T13:53:07.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-31T13:58:28.000Z (over 1 year ago)
- Last Synced: 2025-01-29T14:09:54.698Z (over 1 year ago)
- Topics: clone, expressjs, javascript, react, wikipedia-api
- Language: JavaScript
- Homepage:
- Size: 177 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wikipedia Clone




## 📖 Description
This project is a simple Wikipedia-like application that leverages the [Wikipedia API](https://www.mediawiki.org/wiki/API:Main_page) to allow users to search for articles and retrieve content dynamically. The frontend is built using **React**, and the backend is powered by **Node.js** and **Express**.
## 🚀 Features
- Search for articles using keywords.
- Retrieve detailed content from selected articles.
- Modular design for easy scalability and maintainability.
- Responsive UI built with React.
## 📦 Installation
### Prerequisites
Make sure you have **Node.js** installed on your machine. You can download it from [Node.js Official Site](https://nodejs.org/).
### Clone the Repository
```bash
git clone https://github.com/dmunasingha/wikipedia-clone.git
cd wikipedia-clone
```
### Install Backend Dependencies
Navigate to the backend folder and install the dependencies:
```bash
cd backend
npm install
```
### Install Frontend Dependencies
Navigate to the frontend folder and install the dependencies:
```bash
cd frontend
npm install
```
## 🔧 Usage
### Running the Server
To start the backend server, run the following command in the `backend` directory:
```bash
cd backend
node index.js
```
The backend server will run at `http://localhost:5000`.
### Running the Frontend
To start the frontend application, run the following command in the `frontend` directory:
```bash
cd frontend
npm start
```
The frontend application will run at `http://localhost:3000`.
### API Endpoints
#### 1. Search Articles
- **Endpoint:** `GET /api/search?query={search_query}`
- **Description:** Search for articles related to the specified query.
- **Example Request:**
```bash
curl 'http://localhost:5000/api/search?query=JavaScript'
```
- **Response:**
```json
[
{
"pageid": 12345,
"ns": 0,
"title": "JavaScript",
"snippet": "JavaScript is a programming language..."
},
...
]
```
#### 2. Get Article Content
- **Endpoint:** `GET /api/article?title={article_title}`
- **Description:** Retrieve the content of the specified article.
- **Example Request:**
```bash
curl 'http://localhost:5000/api/article?title=JavaScript'
```
- **Response:**
```json
{
"pageid": 12345,
"title": "JavaScript",
"extract": "JavaScript is a programming language..."
}
```
## 📖 License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
## 🙏 Acknowledgements
- [Wikipedia API Documentation](https://www.mediawiki.org/wiki/API:Main_page)
- [Express.js](https://expressjs.com/)
- [Axios](https://axios-http.com/)
- [React](https://reactjs.org/)
## 📫 Contact
For any inquiries, feel free to reach out:
- **Your Name**: [munasingha.dunith@gmail.com](mailto:munasingha.dunith@gmail.com)
- **GitHub**: [dmunasingha](https://github.com/dmunasingha)