Redesign dashboard with list layout, sparklines, and search

- Add sparkline component for 7-day price history visualization
- Convert product cards to horizontal list items
- Add search functionality to filter products by name/URL
- Backend returns sparkline data and 7-day price change with products
- Show price trend indicator (green for drops, red for increases)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
clucraft 2026-01-20 19:32:25 -05:00
parent 93dbb5cc7c
commit ba9e52b90f
6 changed files with 519 additions and 80 deletions

View file

@ -8,11 +8,11 @@ const router = Router();
// All routes require authentication
router.use(authMiddleware);
// Get all products for the authenticated user
// Get all products for the authenticated user (with sparkline data)
router.get('/', async (req: AuthRequest, res: Response) => {
try {
const userId = req.userId!;
const products = await productQueries.findByUserId(userId);
const products = await productQueries.findByUserIdWithSparkline(userId);
res.json(products);
} catch (error) {
console.error('Error fetching products:', error);