{"id":44609412,"url":"https://github.com/rupesh-dev30/vertx_ecommerce","last_synced_at":"2026-02-14T11:42:18.229Z","repository":{"id":333911231,"uuid":"1138551037","full_name":"rupesh-dev30/vertx_ecommerce","owner":"rupesh-dev30","description":"Vertx + Kafka + Solr + Docker + Java","archived":false,"fork":false,"pushed_at":"2026-01-21T20:27:33.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-22T06:44:55.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rupesh-dev30.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-20T20:23:23.000Z","updated_at":"2026-01-21T20:27:37.000Z","dependencies_parsed_at":"2026-01-22T07:03:55.159Z","dependency_job_id":null,"html_url":"https://github.com/rupesh-dev30/vertx_ecommerce","commit_stats":null,"previous_names":["rupesh-dev30/vertx_ecommerce"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/rupesh-dev30/vertx_ecommerce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupesh-dev30%2Fvertx_ecommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupesh-dev30%2Fvertx_ecommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupesh-dev30%2Fvertx_ecommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupesh-dev30%2Fvertx_ecommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rupesh-dev30","download_url":"https://codeload.github.com/rupesh-dev30/vertx_ecommerce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupesh-dev30%2Fvertx_ecommerce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29443453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T10:51:12.367Z","status":"ssl_error","status_checked_at":"2026-02-14T10:50:52.088Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-14T11:42:15.585Z","updated_at":"2026-02-14T11:42:18.214Z","avatar_url":"https://github.com/rupesh-dev30.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# E-Commerce Search Service\n\nA high-performance, event-driven search engine built with **Java (Vert.x)**, **Apache Kafka**, and **Apache Solr**. This service consumes product updates from Kafka and provides a rich REST API for full-text search, filtering, and faceted navigation.\n\n## 🚀 Quick Start (From Scratch)\n\n### Prerequisites\n\n* Docker \u0026 Docker Compose\n* Java 17+\n* Maven 3.8+\n\n### 1. Clean \u0026 Reset Environment\n\nEnsure a fresh state by removing old containers and persistent Solr data:\n\n```bash\ndocker compose down -v\nrm -rf solr/product-core/data\n\n```\n\n### 2. Build the Service\n\nCompile the Java application into a shadow (fat) JAR:\n\n```bash\ncd search-service\nmvn clean package -DskipTests\ncd ../docker\n\n```\n\n### 3. Launch Infrastructure\n\nStart the middleware components and wait ~30s for Solr to initialize:\n\n```bash\ndocker compose up -d zookeeper kafka solr\n\n```\n\n### 4. Start Search Service \u0026 Create Topic\n\nOnce infra is healthy, start the application and initialize the Kafka topic:\n\n```bash\n# Start Service\ndocker compose up -d search-service\n\n# Create Topic\ndocker exec -it ecommerce-kafka kafka-topics \\\n  --bootstrap-server ecommerce-kafka:29092 \\\n  --create --topic product-search-events --partitions 1 --replication-factor 1\n\n```\n\n---\n\n## 🏗 System Architecture\n\nThe system follows a reactive, event-driven pattern:\n\n1. **Ingestion:** Products are pushed to the `product-search-events` Kafka topic.\n2. **Indexing:** The `KafkaConsumerVerticle` consumes events and indexes them into **Apache Solr** in real-time.\n3. **Serving:** The **Vert.x Web** API handles complex search queries using Solr’s DisMax parser.\n\n---\n\n## 📥 Data Ingestion (Example)\n\nStream data into the system using the Kafka console producer:\n\n```bash\nDO THIS INSIDE THE SEARCH_SERVICE\n\n# Create a dummy products.jsonl file\necho '{\"id\":\"p0001\",\"name\":\"iPhone 15\",\"description\":\"Apple smartphone\",\"brand\":\"apple\",\"category\":\"mobile\",\"price\":79999,\"created_at\":\"2026-01-21T10:00:00Z\"}' \u003e products.jsonl\n\n# Feed to Kafka\ndocker exec -i ecommerce-kafka kafka-console-producer \\\n  --bootstrap-server ecommerce-kafka:29092 \\\n  --topic product-search-events \u003c products.jsonl\n\n```\n\n---\n\n## 🔍 API Reference\n\n**Base URL:** `http://localhost:8888`\n\n### Search Products\n\n`GET /api/search`\n\n| Parameter | Type | Description |\n| --- | --- | --- |\n| `q` | String | Keyword search (Full-text) |\n| `category` | String | Filter by category |\n| `brand` | String | Filter by brand |\n| `minPrice` | Number | Minimum price filter |\n| `sort` | String | `price_asc`, `price_desc`, `newest` |\n\n#### Example Requests:\n\n* **Basic Search:** `curl \"http://localhost:8888/api/search?q=apple\"`\n* **Complex Filter:** `curl \"http://localhost:8888/api/search?q=phone\u0026brand=samsung\u0026minPrice=50000\u0026sort=price_desc\"`\n* **Faceted Results:** All responses include a `facets` object for dynamic sidebar navigation.\n\n---\n\n## 🛠 Troubleshooting \u0026 Verification\n\n* **Check Solr Index Count:**\n  `curl \"http://localhost:8983/solr/product/select?q=*:*\u0026rows=0\"`\n* **View Application Logs:**\n  `docker logs -f ecommerce-search-service`\n* **Verify Kafka Consumer:**\n  `docker exec -it ecommerce-kafka kafka-consumer-groups --bootstrap-server ecommerce-kafka:29092 --group search-service-group --describe`\n\n---\n\n\n---\n\n# Example:\n\n## 🔍 1. BASIC FULL-TEXT SEARCH\n\n### Search by keyword\n\n```bash\ncurl \"http://localhost:8888/api/search?q=iphone\"\n```\n\n### Search in description\n\n```bash\ncurl \"http://localhost:8888/api/search?q=smartphone\"\n```\n\n### Partial keyword (tokenized)\n\n```bash\ncurl \"http://localhost:8888/api/search?q=galaxy\"\n```\n\n---\n\n## 🎯 2. RELEVANCE \u0026 BOOSTING TESTS\n\n### Name boosted over description\n\n```bash\ncurl \"http://localhost:8888/api/search?q=apple\"\n```\n\n👉 Products with **apple in name** should rank above description-only matches.\n\n---\n\n### Recency boost\n\n```bash\ncurl \"http://localhost:8888/api/search?q=mobile\u0026sort=newest\"\n```\n\n👉 Newer products appear first.\n\n---\n\n## 🧩 3. CATEGORY FILTERING\n\n### Single category\n\n```bash\ncurl \"http://localhost:8888/api/search?q=apple\u0026category=mobile\"\n```\n\n### Different category\n\n```bash\ncurl \"http://localhost:8888/api/search?q=apple\u0026category=wearable\"\n```\n\n---\n\n## 🏷️ 4. BRAND FILTERING\n\n### Filter by brand\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026brand=apple\"\n```\n\n### Brand + category\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026brand=samsung\u0026category=mobile\"\n```\n\n---\n\n## 💰 5. PRICE RANGE FILTERING (VERY IMPORTANT)\n\n### Min price only\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026minPrice=30000\"\n```\n\n## Max price only\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026maxPrice=60000\"\n```\n\n### Price range\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026minPrice=30000\u0026maxPrice=80000\"\n```\n\n---\n\n## 🔀 6. SORTING\n\n### Price ascending\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026sort=price_asc\"\n```\n\n### Price descending\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026sort=price_desc\"\n```\n\n### Newest first\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026sort=newest\"\n```\n\n---\n\n## 📄 7. PAGINATION\n\n## First page (default)\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026page=0\u0026size=5\"\n```\n\n## Second page\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026page=1\u0026size=5\"\n```\n\n## Larger page size\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026page=0\u0026size=20\"\n```\n\n---\n\n## 🧠 8. COMBINED REAL-WORLD QUERIES\n\n## ECommerce-style query\n\n```bash\ncurl \"http://localhost:8888/api/search?q=apple\u0026category=mobile\u0026brand=apple\u0026minPrice=50000\u0026sort=price_desc\"\n```\n\n## Amazon-style browsing\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026category=mobile\u0026sort=price_asc\"\n```\n\n## Wearable discovery\n\n```bash\ncurl \"http://localhost:8888/api/search?q=watch\u0026category=wearable\"\n```\n\n---\n\n## 📊 9. FACET VALIDATION (VERY IMPORTANT)\n\nRun:\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\"\n```\n\nVerify response contains:\n\n```json\n\"facets\": {\n  \"brand\": {\n    \"apple\": 10,\n    \"samsung\": 6\n  },\n  \"category\": {\n    \"mobile\": 14,\n    \"wearable\": 2\n  }\n}\n```\n\n👉 Counts must match filtered result set.\n\n---\n\n## 10. NEGATIVE \u0026 EDGE CASES (PRODUCTION CHECK)\n\n### No results\n\n```bash\ncurl \"http://localhost:8888/api/search?q=nonexistingproduct\"\n```\n\nExpected:\n\n```json\n\"items\": []\n```\n\n---\n\n## Invalid filter\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026category=unknown\"\n```\n\nExpected:\n\n* No crash\n* Empty result\n\n---\n\n## Extreme price\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\u0026minPrice=1000000\"\n```\n\n---\n\n## 🧪 11. REBUILD TEST (CRITICAL)\n\n1️⃣ Stop search service\n2️⃣ Delete Solr index\n3️⃣ Replay Kafka events\n\nThen run:\n\n```bash\ncurl \"http://localhost:8888/api/search?q=phone\"\n```\n\n👉 Results should be back.\n\n---\n\n## 🧠 Key Features Validated\n\n* [x] **Schema-on-Read:** Structured JSON ingestion.\n* [x] **Faceted Search:** Dynamic counts for Brand and Category.\n* [x] **Relevancy:** Boosting applied to product names over descriptions.\n* [x] **Resilience:** Index can be rebuilt by replaying Kafka topics.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupesh-dev30%2Fvertx_ecommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frupesh-dev30%2Fvertx_ecommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupesh-dev30%2Fvertx_ecommerce/lists"}