Commit Graph

30 Commits

Author SHA1 Message Date
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
Victor Noguera
8ffbd48c46 feat: implement SQLite persistent storage for analysis results
- Implemented database initialization and connection management in `database.ts` using Bun's SQLite.
- Created `runs` and `results` tables to track historical analysis metadata and detailed product performance.
- Updated `writer.ts` to persist analysis results to the database within a transaction, replacing the previous CSV output logic.
- Updated README and `.gitignore` to reflect the new persistent storage capability.
2026-04-12 23:41:40 -04:00
Victor Noguera
4386560964 feat: enhance README and index.ts for large file processing and output management 2026-04-11 16:57:27 -04:00
Victor Noguera
0162e54007 feat: enhance README with updated SP-API connectivity tests and sellability optimization details 2026-04-08 21:36:02 -04:00
Victor Noguera
53901e4dde feat: Integrate Amazon SP-API for product sellability and pricing
- Added `amazon-sp-api` dependency to package.json.
- Enhanced configuration to include SP-API credentials and settings.
- Implemented SP-API client initialization and error handling in sp-api.ts.
- Developed functions to fetch product sellability and pricing data.
- Updated main processing logic in index.ts to incorporate sellability checks before fetching pricing.
- Modified LLM analysis to account for sellability status and reasons.
- Created a new sp-test.ts script for testing SP-API connectivity and sellability.
- Updated types.ts to define SellabilityInfo and extend SpApiData.
- Enhanced result reporting in writer.ts to include sellability information.
2026-04-08 21:33:43 -04:00
Victor Noguera
2e626ce1f3 feat: refactor token management and enhance logging in fetchKeepaDataBatch function 2026-04-08 00:35:32 -04:00
Victor Noguera
a5a2e9182c feat: enhance cleanLlmJson function to improve JSON extraction and formatting 2026-04-07 23:50:23 -04:00
Victor Noguera
1dd657b386 feat: enhance printResults function to filter and display FBA/FBM leads with detailed profit calculations 2026-04-07 23:33:11 -04:00
Victor Noguera
d192799850 feat: enhance README and improve product data handling in cache, llm, reader, and writer modules 2026-04-07 22:36:01 -04:00
Victor Noguera
1548979859 docs: update README with project overview, requirements, setup, usage, and pipeline details 2026-04-04 21:48:28 -04:00
Victor Noguera
061f771279 feat: initialize asin-check project with Bun
- Add README.md with installation and usage instructions.
- Create bun.lock for dependency management.
- Add package.json to define project metadata and dependencies.
- Implement caching with Redis in cache.ts for ASIN data.
- Configure environment variables in config.ts for API keys and Redis URL.
- Develop main application logic in index.ts to read products, fetch data, and analyze results.
- Integrate Keepa API for product data retrieval in keepa.ts.
- Create LLM analysis functionality in llm.ts for product viability assessment.
- Implement product reading from Excel files in reader.ts.
- Stub SP-API integration in sp-api.ts for future implementation.
- Define TypeScript types in types.ts for product and analysis data structures.
- Write results to console and CSV in writer.ts.
- Configure TypeScript settings in tsconfig.json for project compilation.
2026-04-04 21:33:27 -04:00