Today’s Development Highlights: Database, API & Elasticsearch Updates
What developments have taken place today?
Today’s commits focused on database schema enhancements, API improvements, frontend styling, and Elasticsearch integration. Key changes include:
- Database Schema Updates: Added a
brands
table with brand aliases and implemented a unique constraint on brand names to prevent duplicates. Also added indexes for faster queries based onbrand_id
. - API Product Search Endpoint: Introduced a new
/api/v1/products/search
endpoint to allow clients to search for products by various criteria (text, category, brand, price range). This includes pagination and filtering logic. - Homepage Enhancements: Updated the homepage to display featured categories and discounted products from Elasticsearch, significantly improving the user experience. This involved creating new view models and updating the controller logic to fetch data from Elasticsearch.
- Product Detail Page Redesign: Improved the product detail page with a more modern layout, including styling for fonts, colors, images, and discounts. The code now dynamically displays discount information alongside original prices.
- Elasticsearch Integration Improvements: Enhanced integration with Elasticsearch by adding a
ProductESRepository
interface to manage data synchronization between the database and Elasticsearch. This included updating queries to utilize Elasticsearch efficiently and handle errors gracefully. - CSV Import Enhancements: Added support for importing products from XML files into the database staging table, handling data source management and including error logging.
In summary, these changes collectively improve product discovery, presentation, and data management within the application – enhancing both the user experience and backend functionality.