diff --git a/apps/cli/package.json b/apps/cli/package.json index b9d4f32..4a453c8 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "@c0upons/cli", - "version": "1.10.0", + "version": "1.10.1", "description": "c0upons CLI — search, submit, and manage coupons from the terminal", "type": "module", "bin": { diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index e63684f..8c658b7 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -29,6 +29,48 @@ async function getTrendingCoupons(): Promise { } } +/** + * The newest coupons, so a deal is on the homepage the hour it lands instead of + * waiting for votes. Grocery weekly-ad prices (source 'flipp') are left out: + * they arrive by the hundreds every few minutes and would be all this showed. + */ +async function getJustAdded(): Promise { + try { + const db = getDb(); + const today = new Date().toISOString().slice(0, 10); + return await db.sql` + SELECT c.*, s.name AS store_name, s.slug AS store_slug, s.logo_url AS store_logo + FROM coupons c + JOIN stores s ON s.id = c.store_id + WHERE (c.source IS NULL OR c.source <> 'flipp') + AND (c.expiry_date IS NULL OR c.expiry_date = '' OR c.expiry_date >= ${today}) + ORDER BY c.id DESC + LIMIT 8 + `; + } catch { + return []; + } +} + +/** Codes software founders list on PeerPush (lib/peerpush-sync.ts, read daily), newest deal first. */ +async function getPeerpushDeals(): Promise { + try { + const db = getDb(); + const today = new Date().toISOString().slice(0, 10); + return await db.sql` + SELECT c.*, s.name AS store_name, s.slug AS store_slug, s.logo_url AS store_logo + FROM coupons c + JOIN stores s ON s.id = c.store_id + WHERE c.source = 'peerpush' + AND (c.expiry_date IS NULL OR c.expiry_date = '' OR c.expiry_date >= ${today}) + ORDER BY c.created_at DESC, c.id DESC + LIMIT 8 + `; + } catch { + return []; + } +} + async function getTopStores(): Promise { try { const db = getDb(); @@ -116,8 +158,10 @@ export async function generateMetadata(): Promise { } export default async function HomePage() { - const [coupons, stores, stats] = await Promise.all([ + const [coupons, justAdded, peerpush, stores, stats] = await Promise.all([ getTrendingCoupons(), + getJustAdded(), + getPeerpushDeals(), getTopStores(), getStats(), ]); @@ -190,6 +234,49 @@ export default async function HomePage() { )} + {/* Just added */} + {justAdded.length > 0 && ( +
+
+
+

Just Added

+

The newest codes, before anyone has voted on them

+
+
+
+ {justAdded.map((c) => ( + + ))} +
+
+ )} + + {/* Software deals from PeerPush */} + {peerpush.length > 0 && ( +
+
+
+

Software Deals

+

+ Codes founders list on{' '} + + PeerPush + + , refreshed daily +

+
+ + View all → + +
+
+ {peerpush.map((c) => ( + + ))} +
+
+ )} + {/* Top Stores */}
diff --git a/apps/web/package.json b/apps/web/package.json index cc0c944..675c5c4 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "@c0upons/web", - "version": "1.10.0", + "version": "1.10.1", "private": true, "type": "module", "scripts": { diff --git a/apps/web/public/cli/c0upons b/apps/web/public/cli/c0upons index 024f0d7..20113a1 100644 --- a/apps/web/public/cli/c0upons +++ b/apps/web/public/cli/c0upons @@ -6,7 +6,7 @@ set -euo pipefail -VERSION="1.10.0" +VERSION="1.10.1" BASE_URL="${C0UPONS_API:-https://c0upons.com/api}" # Website root (for login + share links). Defaults to BASE_URL without /api. WEB_URL="${C0UPONS_WEB:-${BASE_URL%/api}}" diff --git a/bun.lock b/bun.lock index 79650b0..03427ad 100644 --- a/bun.lock +++ b/bun.lock @@ -12,7 +12,7 @@ }, "apps/cli": { "name": "@c0upons/cli", - "version": "1.9.3", + "version": "1.10.1", "bin": { "c0upons": "./dist/index.js", }, @@ -30,7 +30,7 @@ }, "apps/web": { "name": "@c0upons/web", - "version": "1.9.3", + "version": "1.10.1", "dependencies": { "@anthropic-ai/sdk": "^1.3.0", "@profullstack/bridges": "^0.2.0", diff --git a/package.json b/package.json index c8ba7fd..6b27f68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "c0upons", - "version": "1.10.0", + "version": "1.10.1", "private": true, "type": "module", "packageManager": "bun@1.4.4",