A modern, interactive web-based English Dictionary platform with advanced search capabilities, word statistics tracking, and beautiful UI/UX.
- Advanced Word Search: Real-time search suggestions with autocomplete
- Full-Text Search: Search through 66,000+ words and definitions
- Random Word Discovery: Explore new words randomly to expand vocabulary
- Word Statistics: Track how many times each word has been searched
- Search History: Keep track of recently searched words
- Favorites System: Save your favorite words for quick access
- Total words in database
- Total searches performed
- Today's search count
- Personal favorites count
- Modern, gradient-based UI design
- Responsive layout (mobile-friendly)
- Smooth animations and transitions
- Real-time search suggestions
- Text-to-speech pronunciation
- Share words functionality
- Session-based favorites
- PHP backend with MySQL database
- AJAX-powered API endpoints
- Automatic database initialization
- Indexed database tables for fast queries
- Full-text search support
- Session management
- Statistics tracking with timestamps
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Python 3.7+ (for importing data)
- Web server (Apache/Nginx) or PHP built-in server
- Update the
.envfile with your MySQL credentials:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=english_dictionary
DB_PORT=3306
- Install Python dependencies:
pip install mysql-connector-python python-dotenv- Run the import script:
python import_dictionary.pyThis will:
- Create the database if it doesn't exist
- Create all necessary tables with proper indexes
- Import all words from dictionary.csv
- Set up the statistics tracking tables
Option A: Using PHP Built-in Server
cd website
php -S localhost:8000Then open your browser and go to: http://localhost:8000
Option B: Using Apache/Nginx
- Configure your web server to point to the
websitedirectory - Ensure PHP is enabled
- Access through your configured domain/localhost
-
words
id(PRIMARY KEY)word(VARCHAR, INDEXED)definition(TEXT, FULLTEXT INDEXED)created_at(TIMESTAMP)
-
search_stats
id(PRIMARY KEY)word_id(FOREIGN KEY)search_count(INT)last_searched(TIMESTAMP)
-
search_history
id(PRIMARY KEY)word_id(FOREIGN KEY)searched_at(TIMESTAMP)ip_address(VARCHAR)
-
favorites
id(PRIMARY KEY)word_id(FOREIGN KEY)session_id(VARCHAR)created_at(TIMESTAMP)
English-dictionary/
βββ .env # Database configuration
βββ dictionary.csv # Source dictionary data
βββ import_dictionary.py # Python import script
βββ README.md # This file
βββ website/
βββ config.php # Database connection & initialization
βββ index.php # Main application page
βββ api.php # REST API endpoints
βββ styles.css # Beautiful CSS styling
βββ script.js # Interactive JavaScript
All endpoints are accessed via api.php?action=<action_name>
search- Get word suggestions (param:q)getWord- Get word details (param:word)randomWord- Get a random wordrandomWords- Get multiple random words (param:count)recentSearches- Get recent searchesstats- Get statistics dashboard datacheckFavorite- Check if word is favorited (param:wordId)
addFavorite- Add word to favorites (param:wordId)removeFavorite- Remove word from favorites (param:wordId)getFavorites- Get all favorites
- Type in the search box to see suggestions
- Click a suggestion or press Enter to view full definition
- Use the random button (π) for surprise discoveries
- β€οΈ Favorite: Save words you want to remember
- π Speak: Hear the pronunciation
- π€ Share: Share words with others
- Popular Words: See most searched words
- Recent Searches: Your search history
- Favorites: Your saved words
- Random Discovery: Explore new vocabulary
- Database indexes on frequently queried columns
- Full-text search indexes for fast word lookup
- AJAX requests with debouncing (300ms delay)
- Efficient batch inserts during data import
- Session-based favorites (no user account required)
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers (iOS Safari, Chrome Mobile)
- Prepared SQL statements (prevents SQL injection)
- Input sanitization and escaping
- Session-based authentication
- IP address logging for analytics
Edit CSS variables in website/styles.css:
:root {
--primary-color: #4F46E5;
--secondary-color: #EC4899;
/* ... more variables */
}Update .env file with your preferences
- Edit
website/api.phpfor new API endpoints - Modify
website/script.jsfor client-side features - Update
website/index.phpfor UI changes
- Verify MySQL is running
- Check
.envcredentials - Ensure MySQL user has proper permissions
- Install required Python packages:
pip install mysql-connector-python python-dotenv - Check file encoding (should be UTF-8)
- Verify dictionary.csv exists in root directory
- Ensure import script completed successfully
- Check if words table is populated:
SELECT COUNT(*) FROM words; - Verify full-text indexes were created
Dictionary data contains 66,000+ English words with comprehensive definitions.
Built with modern web technologies:
- PHP for backend processing
- MySQL for data storage
- Vanilla JavaScript for interactivity
- CSS3 for beautiful styling
This project is open source and available for educational purposes.
For issues or questions, please check the troubleshooting section or review the code comments for detailed implementation notes.
Happy Learning! πβ¨