Commit Graph

60 Commits

Author SHA1 Message Date
Victor Noguera
31cf992e77 refactor: rename findLatestStalkerRunItemIdByAsin to findLatestRunItemIdByAsin and update references 2026-05-25 16:02:07 -04:00
Victor Noguera
506e2344b7 feat: implement reanalyze and distributor discovery endpoints for Stalker products by ASIN 2026-05-25 15:57:24 -04:00
Victor Noguera
313677692b feat: add distributor research functionality with detailed candidate information and outreach options 2026-05-25 15:30:41 -04:00
Victor Noguera
9b45546476 feat: enhance distributor candidate research with additional fields and improved prompt for API request 2026-05-25 15:01:22 -04:00
Victor Noguera
35087a5b2f feat: add product distributor research table and integrate distributor analysis in Stalker product workflow 2026-05-25 14:51:57 -04:00
Victor Noguera
5dbff33032 fix: correct ASIN query syntax and update script path in sellable analysis 2026-05-25 13:55:04 -04:00
Victor Noguera
517833413e feat: enhance Keepa API integration with additional query parameters and improve test coverage 2026-05-25 13:27:26 -04:00
Victor Noguera
b8280ef1a0 Merge branch 'postgres' 2026-05-25 12:49:25 -04:00
Victor Noguera
685cb3b2ed fix: set initial loading state to true and adjust effect dependencies in RunDetails component 2026-05-25 12:49:14 -04:00
Victor Noguera
55e3aef1e4 feat: update usage instructions and improve input/output handling in CLI 2026-05-25 12:42:20 -04:00
Victor Noguera
f512f1d3d5 Add initial journal file for PostgreSQL dialect version 7
- Created a new JSON file `_journal.json` to track changes and entries.
- Included metadata such as version, dialect, and a sample entry with breakpoints enabled.
2026-05-25 12:33:14 -04:00
Victor Noguera
923ebbaec5 Refactor supplier analysis and product handling
- Updated `SupplierAnalysisResult` to include a `product` field and modified related tests.
- Refactored `addRowsSheet` to accommodate changes in the product structure.
- Enhanced UPC file analysis to utilize a new `toSupplierInputRecord` function for cleaner record creation.
- Introduced new types for supplier input records and product observations.
- Updated frontend components to handle new product details and analysis history.
- Improved database writing functions to streamline run completion and error handling.
- Added new API endpoints for product details and adjusted routing in the frontend.
2026-05-25 12:27:41 -04:00
Victor Noguera
c006d87c54 feat: add supplier scoring and UPC file analysis functionality
- Implemented supplier scoring logic in `supplier-scoring.ts` with functions to compute demand score, competition penalty, and overall supplier product score.
- Created unit tests for supplier scoring in `supplier-scoring.test.ts` to validate scoring logic against various scenarios.
- Developed UPC file analysis tool in `upc-file-analysis.ts` to process UPCs in batches, fetch product data from Keepa and SP-API, and generate supplier results.
- Added UPC input reading functionality in `upc-file-reader.ts` to handle XLSX and XLS files, including validation for UPC formats.
- Introduced a command-line tool in `upc-lookup.ts` for looking up UPCs and displaying detailed results or mappings to ASINs.
- Enhanced error handling and logging throughout the new modules for better traceability and user feedback.
2026-05-25 00:53:47 -04:00
Victor Noguera
b982edd160 Refactor database interactions to use Drizzle ORM
- Replaced direct SQLite database calls with Drizzle ORM methods in `top-monthly-sold-by-category.ts`, `writer.ts`, and `upc-file-analysis.ts`.
- Updated test cases in `top-monthly-sold-by-category.test.ts` to mock the new database interactions.
- Removed unnecessary database initialization and cleanup code.
- Improved code readability and maintainability by using ORM features for inserting and updating records.
2026-05-25 00:08:30 -04:00
Victor Noguera
70e0e8a535 feat: Enhance LLM robustness with improved error handling and model resolution 2026-05-21 20:26:48 -04:00
Victor Noguera
0e03366534 Merge branch 'claude' 2026-05-21 19:58:01 -04:00
Victor Noguera
95cebaa27c feat: add support for Claude LLM integration across multiple modules
- Introduced `useClaude` option in `AnalysisPipelineOptions` to toggle Claude LLM usage.
- Updated `processProductChunk` and `analyzeProducts` functions to accept and handle `useClaude` parameter.
- Modified argument parsing in various scripts (`bestsellers-by-category`, `mid-range-sellers-by-category`, `top-monthly-sold-by-category`, etc.) to include `--claude` flag.
- Enhanced `analyzeProductsInternal` to differentiate between LLM providers and handle requests to Claude API.
- Added error handling for Claude API responses and ensured proper configuration for using Claude.
- Updated documentation and usage messages to reflect the new `--claude` flag.
2026-05-21 19:57:46 -04:00
Victor Noguera
0f256be2be Merge branch 'searxng' 2026-05-20 18:35:53 -04:00
Victor Noguera
5226eee760 feat: add ASIN offer search functionality
- Introduced a new script `asin-offer-search.ts` for searching product offers by ASIN.
- Updated `package.json` to include a new command for the ASIN offer search.
- Enhanced configuration in `config.ts` to support SearXNG URL and timeout settings.
- Added comprehensive tests for the new search functionality in `searxng.test.ts`.
- Implemented the core search logic in `searxng.ts`, supporting multiple providers and price detection.
2026-05-20 18:34:08 -04:00
Victor Noguera
1d2e92addb Merge branch 'jaime' 2026-05-20 16:24:17 -04:00
Victor Noguera
f8bc05685e feat: add XLSX export functionality and refactor argument parsing in main script 2026-05-20 16:18:12 -04:00
Victor Noguera
0c2e59771c feat: add XLSX export functionality for Stalker products and enhance UI for export link 2026-05-19 23:12:34 -04:00
Victor Noguera
90bfee8791 feat: add advanced filtering options for Stalker products including price, sales rank, and seller metrics 2026-05-19 23:01:28 -04:00
Victor Noguera
1f57900da2 feat: implement batch processing for product analysis with delay and error handling 2026-05-19 20:24:08 -04:00
Victor Noguera
7bda3710ed feat: update Keepa and Stalker functionalities with enhanced price extraction logic and test cases 2026-05-19 19:59:20 -04:00
Victor Noguera
0552d183b3 feat: enhance Stalker functionality with additional product details and analysis capabilities 2026-05-19 19:57:53 -04:00
Victor Noguera
f6178a665c feat: add Stalker products functionality with filtering, pagination, and purge option 2026-05-19 19:37:05 -04:00
Victor Noguera
aed0c11017 feat: enhance stalker functionality with inventory sellability checks and update frontend display 2026-05-19 18:35:55 -04:00
Victor Noguera
a7c0e44e3d feat: add Stalker results page with filtering and pagination
- Introduced StalkerResultItem and StalkerResultsResponse types for handling API responses.
- Implemented StalkerExplorer component for displaying Stalker results with search and filter options.
- Added sorting functionality for Stalker results table.
- Enhanced Dashboard to include a button for navigating to Stalker results.
- Updated routing to support Stalker results page.
- Improved styles for section headers and inventory columns in the results table.
2026-05-19 18:10:01 -04:00
Victor Noguera
0f9b785cce refactor: streamline CLAUDE.md for Bun usage and remove outdated instructions 2026-05-19 01:25:17 -04:00
Victor Noguera
f3e4d3ac52 feat: Implement supplier export functionality with workbook generation
- Add `writeSupplierWorkbook` function to create Excel workbooks for supplier analysis results.
- Introduce `SupplierExportSummary` type for summarizing export data.
- Create tests for `writeSupplierWorkbook` to ensure correct sheet creation and data population.
- Implement supplier scoring logic in `supplier-scoring.ts` to evaluate product profitability and demand.
- Add tests for supplier scoring to validate scoring logic and verdict determination.
- Enhance UPC file analysis to integrate supplier scoring and export results to Excel.
- Update database writing logic to accommodate new supplier analysis results.
- Refactor types to include supplier-specific data structures and scoring metrics.
- Ensure proper cleanup of temporary files after tests.
2026-05-19 01:19:48 -04:00
Victor Noguera
41ef57a7bc Refactor mid-range seller processing to enforce sellability gates and enhance command-line arguments
- Updated test case to reflect changes in processing mid-range matches based on sellability.
- Modified `processCategory` function to implement strict and soft sellability gates.
- Introduced new command-line arguments for category selection and sellability gate configuration.
- Enhanced error handling and validation for new arguments.
- Improved logging for category processing and budget usage.
2026-05-12 14:14:20 -04:00
Victor Noguera
f2c8a9728d feat: add mid-range sellers by category analysis pipeline
This new pipeline identifies products meeting specific monthly sold, price, seller count, and Amazon buy box share criteria across categories. It fetches comprehensive product data from Keepa and SP-API, analyzes it using an LLM, and persists the results.

A key enhancement is the introduction of a dedicated Redis cache for Keepa and SP-API responses. This reduces API token consumption and improves performance for subsequent runs by caching enriched ASIN data with a 12-hour TTL. Products are saved regardless of their sellability status to provide a complete view.
2026-05-02 12:03:31 -04:00
Victor Noguera
9b832b7839 perf: optimize Keepa UPC lookups with lightweight queries and caching
Reduces API token consumption by disabling stats and buybox data for UPC-to-ASIN mapping requests. Additionally, introduces a run-level cache to avoid redundant lookups for the same UPC across different batch chunks.
2026-04-17 01:41:01 -04:00
Victor Noguera
072a501102 Merge branch 'upc-to-asin' 2026-04-16 23:06:59 -04:00
Victor Noguera
32e7b0c485 feat: add UPC to ASIN mapping and large file UPC analysis
Introduces the capability to resolve UPCs to ASINs using the Keepa API. This includes a new `upc-file` command for processing large Excel files of UPCs, a `upc` CLI tool for quick lookups, and API endpoints for web-based integration. The analysis pipeline was refactored into a reusable module to support both standard ASIN leads and new UPC-driven workflows.
2026-04-16 23:06:55 -04:00
Victor Noguera
d25cf5d5ec feat: add amazon seller filter to product list and result parsing 2026-04-14 18:43:35 -04:00
Victor Noguera
b52cdc7f2b Merge branch 'az-sell' 2026-04-14 18:26:30 -04:00
Victor Noguera
8d6b0f9e0f feat: add Amazon seller and buy box share metrics to product analysis
- Introduced `amazonIsSeller` and `amazonBuyboxSharePct90d` fields in KeepaData type.
- Updated database schema and queries to store Amazon seller status and buy box share percentage.
- Enhanced product analysis results with new metrics from Keepa API.
- Modified frontend components to display Amazon seller status and buy box share percentage.
- Implemented reanalysis functionality for products to refresh Amazon-related metrics.
2026-04-14 18:26:22 -04:00
Victor Noguera
4eff4a4a2a Merge branch 'most-units-sold' 2026-04-14 17:22:36 -04:00
Victor Noguera
b5ac408539 feat: add top monthly sold by category analysis pipeline
- Introduces a new script to discover categories and identify products with high monthly sales volume.
- Filters candidates based on sellability status and a configurable monthly sold threshold.
- Enriches product data with Keepa and SP-API metrics before performing LLM-based analysis.
- Persists results to SQLite and includes unit tests for the core processing logic.
2026-04-14 17:22:31 -04:00
Victor Noguera
811fe9b10a feat: enhance product analysis results with additional fields and update handling logic 2026-04-13 03:32:46 -04:00
Victor Noguera
299ad7a1a6 feat: enhance product listing with additional metrics and sorting options 2026-04-13 03:04:28 -04:00
Victor Noguera
937fe5da40 feat: expand results schema and refine LLM analysis policy
- Adds new columns to the `results` table for tracking spreadsheet-sourced financial data, supplier details, and lead metadata.
- Implements `ensureResultsTableColumns` to automatically migrate existing databases with the new schema.
- Simplifies LLM evaluation logic by removing mandatory skip triggers for Amazon-exclusive and single-seller products.
- Standardizes formatting for database index and table creation statements.
2026-04-13 02:53:49 -04:00
Victor Noguera
6931253310 Merge branch 'ui-ux' 2026-04-13 02:36:50 -04:00
Victor Noguera
281bc7dcc9 feat: add frontend dashboard for run results viewer
- Implemented main dashboard with run metrics and filtering options.
- Created detailed view for individual runs with results and anomalies.
- Added product listing page with filtering and pagination.
- Introduced utility functions for formatting dates and numbers.
- Styled components with CSS for a clean and responsive layout.
- Set up HTML entry point and linked to the main JavaScript file.
- Updated TypeScript configuration to include DOM types.
2026-04-13 02:36:35 -04:00
Victor Noguera
a906f5ede3 feat: transition bestseller analysis storage to SQLite and add category blacklist
- Replaces Excel output with structured database tables for tracking category analysis runs and product results.
- Implements a blacklist to exclude specific category IDs from the bestseller pipeline.
- Adds unit tests for category processing and enhances logging with levels and timestamps.
- Introduces foreign key enforcement and updated schema definitions in the database module.
2026-04-13 00:28:23 -04:00
Victor Noguera
7ba6397578 Merge branches 'main' and 'main' of https://github.com/nvictorme/asin-check 2026-04-12 23:51:16 -04:00
Victor Noguera
dbe5b1ac71 Refactor SP-API test script and improve type definitions
- Updated `sp-test.ts` to enhance argument parsing and error handling for sellability checks.
- Refactored `types.ts` to maintain consistent formatting and improve readability.
- Improved `writer.ts` for better result handling and CSV writing, ensuring clarity in output.
- Adjusted `tsconfig.json` formatting for consistency and readability.
2026-04-12 23:48:31 -04:00
Victor Noguera
b8667c11e4 Merge branch 'sqlite' 2026-04-12 23:43:29 -04:00