{"id":34861200,"url":"https://github.com/ramonclaudio/polar-commerce","last_synced_at":"2026-05-06T06:35:44.347Z","repository":{"id":320662180,"uuid":"1064190056","full_name":"ramonclaudio/polar-commerce","owner":"ramonclaudio","description":"Experimental e-commerce platform built with Next.js 16, Convex, Better Auth, and Polar. Features custom cart bundling, seamless guest-to-auth migration, and automated product seeding.","archived":false,"fork":false,"pushed_at":"2025-10-25T04:23:03.000Z","size":12947,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T21:39:19.297Z","etag":null,"topics":["better-auth","cart","checkout","convex","ecommerce","nextjs","nextjs16","payments","polar","product-catalog","react19","real-time","seeding","serverless","subscription-payments","typescript"],"latest_commit_sha":null,"homepage":"https://polar-commerce.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramonclaudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2025-09-25T17:09:02.000Z","updated_at":"2025-10-25T04:23:07.000Z","dependencies_parsed_at":"2025-10-25T05:44:45.216Z","dependency_job_id":null,"html_url":"https://github.com/ramonclaudio/polar-commerce","commit_stats":null,"previous_names":["rmncldyo/polar-commerce","ramonclaudio/polar-commerce"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ramonclaudio/polar-commerce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonclaudio%2Fpolar-commerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonclaudio%2Fpolar-commerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonclaudio%2Fpolar-commerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonclaudio%2Fpolar-commerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramonclaudio","download_url":"https://codeload.github.com/ramonclaudio/polar-commerce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonclaudio%2Fpolar-commerce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31491094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"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":["better-auth","cart","checkout","convex","ecommerce","nextjs","nextjs16","payments","polar","product-catalog","react19","real-time","seeding","serverless","subscription-payments","typescript"],"created_at":"2025-12-25T21:08:19.845Z","updated_at":"2026-04-06T21:31:00.547Z","avatar_url":"https://github.com/ramonclaudio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polar Commerce\n\nExperimental e-commerce platform built with Next.js 16, Convex, Better Auth, and Polar. Features custom cart bundling, seamless guest-to-auth migration, and automated product seeding. Polar wasn't built for multi-item carts - that's what made this interesting.\n\n## The Challenge\n\nPolar handles payments beautifully but has zero cart system - no multi-item checkout, no cart management, nothing. I needed to figure out how to make it work for a full e-commerce platform without those features.\n\n## The Solution\n\n**Cart bundling:** Built a custom system where multiple cart items bundle into a single ephemeral Polar product at checkout. The full cart composition gets stored in checkout metadata, then reconstructed server-side after payment confirmation via webhook. This workaround lets Polar handle payments for multi-item carts without native support.\n\n**Real-time cart sync:** Convex's real-time subscriptions make the magic happen - cart and wishlist updates sync instantly across all devices and tabs. Add an item on your phone, see it immediately on desktop. No polling, no refresh needed.\n\n**Guest/auth cart merging:** Seamless migration when guests sign in. Items added while browsing anonymously automatically merge with their account data on login - no lost items, no duplicates. Better Auth integration made this straightforward.\n\n**JSON-based product seeding:** Built a comprehensive seeding system that starts with JSON product definitions, uploads images to Polar's CDN, creates products via Polar API, then syncs everything to Convex. One command (`npm run polar:seed`) populates both systems with full inventory, pricing, images, and metadata - all kept in sync automatically.\n\n**Tech stack:**\n- Next.js 16.0.1-canary.2 with React Compiler, Turbopack dev/build caching, component-level caching, and PPR\n- React 19.2 with useEffectEvent, View Transitions API\n- Experimental: `cacheLife`, `cacheTag`, typed routes, inline CSS\n- Convex (real-time database with type-safe schema)\n- Better Auth with Convex adapter\n- Polar (payments for subscriptions and one-time purchases)\n\n## Setup\n\n#### Install and Configure\n```bash\ngit clone https://github.com/RMNCLDYO/polar-commerce.git\ncd polar-commerce\nnpm install\ncp .env.example .env.local\n```\n\n#### Seed \u0026 Run\n```bash\nnpm run polar:seed\nnpm run dev\n```\n\n## What Works\n\n- Cart with real-time sync across devices/tabs\n- Wishlist functionality\n- Full auth flow (email/OAuth/2FA)\n- Checkout with item bundling\n- Order reconstruction from webhooks\n- Subscription and one-time payments\n\n## Known Issues\n\n- **Account menu positioning bug:** The user menu dropdown renders in the top-left corner when navigating to protected pages. Working on a fix ASAP.\n\n## What's Missing\n\nStill figuring out:\n- Cart expiration and cleanup\n- Bundle lifecycle management\n- Per-item tax calculations\n- Partial refund logic\n\n## Why Build This\n\nI wanted to see if I could build e-commerce on Polar despite the missing cart system. Turns out Convex's real-time sync is perfect for carts and wishlists, Better Auth integrates seamlessly, and Next.js 16's experimental features (React Compiler, component-level caching, Turbopack dev caching) combined with React 19.2's useEffectEvent and View Transitions push performance and UX even further. The bundling workaround for Polar isn't elegant, but it works.\n\n## Credits\n\nStarted from [@estebansuarez](https://github.com/estebansuarez)'s [v0 template](https://v0.app/templates/storefront-w-nano-banana-ai-sdk-ai-gateway-XAMOoZPMUO5). Built with Next.js 16, Convex, Better Auth, and Polar.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framonclaudio%2Fpolar-commerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framonclaudio%2Fpolar-commerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framonclaudio%2Fpolar-commerce/lists"}