athena-x-ai-headless-proxyless
v3.2.32
Published
Athena X-AI Front-End No Proxy
Downloads
309
Readme
About The Project
The general idea is to build a custom script to implement Athena Search without too much issues on all possible platforms and frameworks.
Main features:
- Autocomplete and First Click
- Search,Category and Visual Similarity Search Page
- Infinite Scroll and Pagination
- Filters , Sorters and Number of shown results on search page, and on Autocomplete
- Configuration for all built in functionalities
For more information about the project requirements check the original documentation.
The script is not entirely independent and in order to use it, websites will need some slight changes.
Built With
- Programing language: JavaScript
- Package Manager: npm
- Proxy Language: Node.js
- Docker
Third-party libraries:
We are trying not to use a lot of third-party libraries, but there are some libraries installed in order to get a cleaner smaller, and well-organized code. However, we should keep this list short.
- Cropper.js - Used for cropping images for visual similarity search
- OMRangeSlider.js - Used for price range slider
- heicToAny.js - Used to change image format from heic and heif to jpeg
Getting Started
Follow the next sections to learn how to install and use the script.
Requirements
- Node.js version 20.10.0
- Docker - Not required if using auth version 1
- Docker Compose - Not required if using auth version 1
Installation
- Download the package from our npm repository
- Copy the project from node_modules to your project
- Rename .env.example to .env
- Populate all .env variables with your from Athena Dashboard
- Run
docker compose up -d --build
- Remove existing files inside example folder
*.athena-x-ai.js files
- Run
npm install && npm run build
- Place newly generated
*.athena-x-ai.js files
inside example directory - Extract files inside example folder to desired place inside your project
- Enjoy searching with us.
Usage/Examples
All available configurations for AthenaXAi are:
//Placement of the price range
priceRangePlacement: 'before',
//Price Range Unit of Price
priceRangeUnit: '$',
//On how many decimals we want to round
decimals: '',
//What we want decimal point to be
decimalPoint: '',
//What we want separator to be
separator: '',
//Voice Search Language
voiceSearchLang: 'en-US',
//Voice Search Status
voiceSearchStatus: true,
//Visual Similarity Search Status
visualSimilaritySearchStatus: true,
// Pager status
pagerStatus: false,
//Check if Infinite Scroll is Activated on Dashboard
InfiniteScrollStatus: true,
//Camera Capture Status
cameraCaptureStatus: false,
//Layout Type
layoutType: 'athena-l3', //You can change between 'athena-l3', 'athena-list', 'athena-grid'
//Bottom Observed Element
bottomObservedElement: null,
//Check on how many elements search on filters appear
filterSearchAppearOnElements: 10,
//Filter Search Enable
filterSearchEnable: true,
//Form URL
formUrl: '/athena.html'
Contributing
- Always create a feature branch from the master
- We should always wait for a review before merging into the master
- Keep the PR clean without
console.log
Documentation
- Main folder that holds all the javascript code is src/
- Subdirectories include:
A) autocomplete B) category C) global D) search
A) Autocomplete folder contains all the logic that is needed to instantiate our autocomplete section. It also includes number of subfolders that are:
- ajax - Where all ajax request are made.
- features - Where we build our new features in separate files.
- helper - Where all helper global autocomplete functions are placed.
- renderer - Where all elements are rendered.
B) Category folder contains all the logic that is needed to instantiate our category section. It also includes number of subfolders that are.
C) Global folder contains all the logic that is needed to instantiate our global functions. It also includes number of subfolders that are:
- analytics - Where all analytics functions are stored.
- cropper - Where cropper logic is stored.
- heic-converter - Where converter logic is stored.
- helpers - Where all global helpers are stored.
- indexed-db - Where indexed-db logic is stored.
- om-range-slider - Where slider logic is stored.
- packages - Where all packages are stored.
D) Search folder contains all the logic that is needed to instantiate our Search functions. It also includes number of subfolders that are:
- ajax - Where all ajax request are made.
- helper - Where all helper global search functions are placed.
- infinite-scroll - Where infinite-scroll logic is placed.
- renderer - Where all elements are rendered.