Skip to content

DevEvil-Universe/DevEvil-Search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevEvil Search Logo

DevEvil Search

DevEvil Search is a fast, simple, open-source search engine powered by public APIs. It delivers web, image, video, and news search results using the Brave Search API, enriched with instant summaries from Wikipedia and definitions from Free Dictionary API. It also supports dynamic background images via the Pexels API.


Table of Contents


✨ Features

  • πŸ”Ž Multi-type search: Web, Images, Videos, News
  • πŸ“– Instant Wikipedia summaries (when relevant)
  • πŸ“š Instant word definitions from Free Dictionary API
  • πŸ–ΌοΈ Dynamic high-quality random background images (Pexels)
  • 🌍 Country-specific results (region biasing)
  • πŸŒ— Dark / Light mode support
  • πŸ›‘οΈ SafeSearch filtering (on/off)

πŸ“Έ Screenshots

DevEvil Search Homepage DevEvil Search Result Page


βš™οΈ Requirements

You need:

  • Node.js 18+

  • A VPS (for backend API server)

  • A web host (for frontend)

  • Nginx (or Apache reverse proxy)

  • API Keys:

    • Brave Search API
    • Pexels API

πŸ”‘ How To Get API Keys

1️⃣ Brave Search API

  1. Go to Brave Search API dashboard (Brave Search Developer Portal).
  2. Create an account.
  3. Subscribe to a plan (Free tier available with limited requests).
  4. Generate your API key.
  5. Copy the key.

You will use it as:

BRAVE_API_KEY=your_brave_api_key_here

2️⃣ Pexels API

  1. Go to Pexels developer page.
  2. Create an account.
  3. Generate a free API key.
  4. Copy the key.

You will use it as:

PEXELS_API_KEY=your_pexels_api_key_here

πŸ›  Installation

1️⃣ Clone the Repository

git clone https://github.com/DevEvil-Universe/DevEvil-Search
cd devevil-search

2️⃣ Install Dependencies

npm install

3️⃣ Create Environment File

Rename .env.example file to .env and add your API keys to it:

BRAVE_API_KEY=your_brave_api_key
PEXELS_API_KEY=your_pexels_api_key

πŸ§ͺ Local Development

You can run DevEvil Search locally on your computer without a VPS by using:

  • XAMPP (recommended for Windows)
  • WAMP
  • MAMP (Mac)
  • OR any normal PHP local server

This allows you to test the backend API (Node.js) and the frontend (PHP) together before deploying.


βœ”οΈ 1. Start Your Node.js Backend (API)

First, run the backend:

node server.js

Your API is available at:

http://localhost:5000

Keep this terminal window open.


βœ”οΈ 2. Install XAMPP (Windows / macOS / Linux)

Download XAMPP:

https://www.apachefriends.org/

Then:

  1. Install XAMPP.
  2. Start Apache from XAMPP Control Panel.

βœ”οΈ 3. Move the Frontend to XAMPP’s htdocs

Place all frontend files here:

C:\xampp\htdocs\devevil-search\

Now open:

http://localhost/devevil-search/

βœ”οΈ 4. Optional: Use PHP Built-in Server (No XAMPP Required)

If you have PHP installed:

php -S localhost:8000

Place your frontend files in the current folder.

Then visit:

http://localhost:8000

Backend remains at:

http://localhost:5000

βœ”οΈ 5. Optional: Use WAMP or MAMP

WAMP (Windows)

  • Install WAMP from wampserver.com
  • Put your frontend in:
C:\wamp64\www\devevil-search\

Visit:

http://localhost/devevil-search/

MAMP (macOS)

  • Install MAMP
  • Place frontend in:
/Applications/MAMP/htdocs/devevil-search/

Visit:

http://localhost:8888/devevil-search/

βœ”οΈ 6. Full Local Example


🌐 Production Deployment Guide (IMPORTANT)

You need:

  • VPS β†’ Backend (Node.js API)
  • Shared Hosting / Server β†’ Frontend (PHP)
  • Reverse Proxy β†’ Connect frontend to backend securely

πŸ–₯ Backend Deployment (VPS)

Step 1 β€” Install Node.js

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs

Step 2 β€” Install PM2 (Process Manager)

npm install -g pm2

Start your server:

pm2 start server.js --name devevil-search
pm2 save
pm2 startup

🌍 Configure Nginx Reverse Proxy

Install nginx:

sudo apt install nginx

Create config file:

sudo nano /etc/nginx/sites-available/devevil-search

Example configuration:

server {
    server_name api.yourdomain.com;

    location / {
        proxy_pass http://localhost:5000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Enable it:

sudo ln -s /etc/nginx/sites-available/devevil-search /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Now your backend API will be available at:

https://api.yourdomain.com/api/search

Replace all the api urls in the js folder with your own API URL.


πŸ–₯ Frontend Setup

Upload frontend files to your hosting, such as cPanel.

Things to Customize

πŸ”Ή index.php

  • Website name
  • Meta description
  • Logo
  • Title tags

πŸ”Ή search.php

  • Search result layout
  • Page title format
  • SEO tags

πŸ”Ή navbar.php

  • Brand name
  • Links

🎨 Customization

Change Colors

Edit:

/css/style.css
/css/result.css

Modify CSS variables or color values.


πŸ–Ό Images

  1. Create folder:
/img
  1. Upload your images

  2. Replace image paths inside:

    • index.php
    • search.php

πŸ” CORS Configuration

By default, backend allows:

const allowedOrigins = ['http://localhost'];

Change this to your real frontend domain:

const allowedOrigins = ['https://yourdomain.com'];

πŸ“‘ API Documentation


πŸ”Ž Search Endpoint

GET /api/search

Query Parameters

Parameter Description
q Search query (required)
type web, images, news, videos
safe active / off
cr countryUS, countryGB, countryDE, etc
start pagination index

πŸ“Œ Example Requests

Web Search

curl "http://localhost:5000/api/search?q=elon+musk&type=web"

Image Search

curl "http://localhost:5000/api/search?q=mountains&type=images"

With Country & Safe Search

curl "http://localhost:5000/api/search?q=ai&type=web&safe=active&cr=countryUS"

πŸ“¦ Example Response Structure

{
  "search": {
    "items": [
      {
        "title": "Example Title",
        "link": "https://example.com",
        "displayLink": "example.com",
        "snippet": "Example description..."
      }
    ],
    "searchInformation": {
      "totalResults": "100"
    }
  },
  "searchInformation": {
    "totalResults": "100"
  },
  "wikipedia": {
    "title": "Artificial intelligence",
    "extract": "Artificial intelligence (AI) is...",
    "image": "https://upload.wikimedia.org/...",
    "url": "https://en.wikipedia.org/wiki/Artificial_intelligence"
  },
  "definition": {
    "word": "intelligence",
    "partOfSpeech": "noun",
    "definition": "The ability to acquire knowledge..."
  }
}

πŸ”Ž Response Breakdown

  • search.items[] β†’ Search results
  • wikipedia β†’ Instant summary (if available)
  • definition β†’ Dictionary result (if available)

πŸ–Ό Background Endpoint

GET /api/background

Example:

curl "http://localhost:5000/api/background"

Example Response:

{
  "imageUrl": "https://images.pexels.com/...",
  "photographer": "John Doe",
  "profileUrl": "https://pexels.com/@johndoe",
  "category": "nature"
}

🀝 Contributing

Contributions are welcome!
Feel free to open issues or submit pull requests.

Give the repo a ⭐ if you find it useful!

About

DevEvil Search is a fast, simple, open-source search engine powered by public APIs. It delivers web, image, video, and news search results using the Brave Search API, enriched with instant summaries from Wikipedia and definitions from Free Dictionary API.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors