Project Overview
IndicLex helps users manage dictionaries, upload dictionary data, search entries, and browse dictionary information in a simple web interface.
-
Dictionary catalog and entry management
-
File upload for dictionary imports
-
Search interface with match modes
-
REST API search endpoint
-
Autocomplete search on the public search page
-
User login and admin dashboard
-
Export support for dictionary data
-
Theme and preference support
-
GET /api/search -
Support for:
q— search termdict— dictionary ID filtermode—exact,prefix,suffix,substring
-
Proper JSON responses
-
HTTP status codes:
200— success400— bad request404— no results500— server error
-
Public search page autocomplete using jQuery AJAX
-
Word Length Matching link to an external puzzle resource
-
Clean API routing with
.htaccess
- Clone the repository.
- Import the SQL schema from the
sql/folder into your database. - Update database credentials in the project DB connection file.
- Place the project in your web server root.
- Make sure Apache rewrite support is enabled.
- Open the project in your browser.
This main directory is for the public-facing webpages on the website, such as index.php, search.php, etc.
The API directory holds files used for API endpoints.
This directory holds helper php pages, like the header, navbar, footer, and database connection.
This directory should not contain any files, and is used for uploading .xlsx files into the database. This folder should be created automatically if it is not present upon uploading. Files in this folder are deleted when they are successfully added to the database.
This directory contains code used by the PHPSpreadsheet library, and is necessary to upload dictionaries using the upload.php page.
Files can be uploaded via the upload.php page, visible in the navbar. It accepts .xlsx files, in the following format:
| Lang 1 | Lang 2 | Lang 3(optional) |
|---|
Along with the .xslx file, the user can specify the name, description, and the 2 or 3 languages of the dicitonary.
When signed in as an Admin, the dashboard page is available. From here, you can validate and compare dictionaries, and edit or delete them.
The project uses a MySQL database with tables such as:
dictionariesdictionary_entriesuserspreferences
The exact schema is stored in the sql/ folder.
GET /api/search
q— required search termdict— optional dictionary ID filtermode— optional search modelimit— optional max results, default20, max50
exactprefixsuffixsubstring
/api/search?q=test
/api/search?q=ab&mode=prefix
/api/search?q=word&dict=1&mode=substring
/api/search?q=abc&dict=2&mode=exact&limit=10
{
"status": "success",
"query": "test",
"dict": 0,
"mode": "exact",
"count": 2,
"results": [
{
"entry_id": 1,
"dict_id": 3,
"dict_name": "English-Hausa Dictionary",
"dict_identifier": "eng-hau",
"lang_1": "test",
"lang_2": "aji",
"lang_3": null
}
]
}{
"status": "error",
"message": "Query parameter 'q' is required."
}{
"status": "error",
"message": "No results found for 'test' in 'exact' mode."
}The public search page supports:
- Search input
- Dictionary filter
- Search modes
- Live autocomplete suggestions
- Result table rendering from AJAX calls
The search page includes a button that links to the external Telugupuzzles word-length matching tool.
The .htaccess file maps clean requests like:
/api/search?q=test
to the PHP API handler.
- If the API returns
500, check database credentials and PHP errors. - If clean URLs do not work, confirm
mod_rewriteis enabled. - If autocomplete does not show, check browser console and network requests.
- If results are missing, verify that the requested dictionary ID exists.