Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tharunoptimus/search-engine

Search Engine 🔍 to search for sites and images.
https://github.com/tharunoptimus/search-engine

api expressjs mongodb pug

Last synced: 18 days ago
JSON representation

Search Engine 🔍 to search for sites and images.

Awesome Lists containing this project

README

        

# Search Engine

## Config
Add Environment Variable MONGO_URL in a .env file or as an environment variable on your hosting platform.

## Add data to the database - Crawler
- Clone this repository Crawler Bot to another directory and run it
- Access the /crawl page in the above app to crawl for the data

## Install
`npm install` to install all the dependencies

## Run
`npm start` to start the app in dev server

Enjoy

## General Details

### Packages Used
- Express to create the server and manage routes
- Pug to render the html pages
- Mongoose to connect to the database
- Mongo Sanitize to sanitize the text field before searching

### API
- Crawler Bot uses a REST API to crawl the data.
- API uses `node-fetch` and `cheerio` to crawl for data

### Text search
- Uses mongoDB text search to search for the data
- The fields are indexed while creating the collection schema in the database

### View Engine - Pug
- HTML is generated using the Pug template engine

### PWA
- The app is served using the service worker while offline
- Passes the lighthouse audit 100%