{"id":31655580,"url":"https://github.com/rohittcodes/fashion-hub","last_synced_at":"2025-10-07T13:16:59.930Z","repository":{"id":318071872,"uuid":"1069263604","full_name":"rohittcodes/fashion-hub","owner":"rohittcodes","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-03T20:28:55.000Z","size":312,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T23:00:40.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rohittcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"rohittcodes"}},"created_at":"2025-10-03T16:48:35.000Z","updated_at":"2025-10-03T20:28:58.000Z","dependencies_parsed_at":"2025-10-04T23:01:28.163Z","dependency_job_id":"5bfd1ed4-434c-4669-b437-a0157f105fff","html_url":"https://github.com/rohittcodes/fashion-hub","commit_stats":null,"previous_names":["rohittcodes/fashion-hub"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/rohittcodes/fashion-hub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Ffashion-hub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Ffashion-hub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Ffashion-hub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Ffashion-hub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohittcodes","download_url":"https://codeload.github.com/rohittcodes/fashion-hub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Ffashion-hub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278780183,"owners_count":26044506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-07T13:16:58.803Z","updated_at":"2025-10-07T13:16:59.923Z","avatar_url":"https://github.com/rohittcodes.png","language":"TypeScript","funding_links":["https://github.com/sponsors/rohittcodes"],"categories":[],"sub_categories":[],"readme":"# Fashion Hub\n\n![license: MIT](https://img.shields.io/badge/license-MIT-green)\n![build](https://img.shields.io/badge/build-pnpm%20turbo-blue)\n![type safety](https://img.shields.io/badge/types-TypeScript-informational)\n\nFashion Hub is a modern e‑commerce monorepo showcasing a production‑ready personalization stack. It combines a Next.js web app, an Expo mobile app, and a type‑safe API layer to deliver personalized product recommendations, rich product browsing, and fast, maintainable developer workflows.\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003ePersonalized recommendations • Type‑safe APIs • Web + Native • Modern DX\u003c/em\u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n- [Project Overview](#project-overview)\n- [Features](#features)\n- [Architecture](#architecture)\n- [Recommendations Engine](#recommendations-engine)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Development Scripts](#development-scripts)\n- [Quality (Lint, Types)](#quality-lint-types)\n- [Deployment](#deployment)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n  \n\u003e Quick links: [Install](#5-installation) · [Run Web](#6-usage) · [Run Mobile](#6-usage) · [API](#4-recommendations-engine)\n\n## Project Overview\n\nFashion Hub delivers a catalog, product detail pages, cart/checkout flows, and three recommendation surfaces:\n- For You (personalized)\n- Trending Now (popular right now)\n- Similar Items (contextual on PDP)\n\nRecommendations are powered by lightweight signal aggregation (views, wishlist, cart, purchases) and efficient product projection returned over a type‑safe tRPC API.\n\n## Features\n\n- Personalized recommendations with user‑aware signals\n- Trending products using recent activity (with cart/order fallback)\n- Similar items on product pages\n- Accessible UI with skeletons, error, and empty states\n- End‑to‑end type safety (tRPC v11 + React Query)\n- Shared UI and tooling across apps (Tailwind, ESLint, TS, Prettier)\n\nOptional niceties you can add:\n- Screenshots/GIFs of the home page, PDP, and recs sections\n- Badges for CI, coverage, and package versions\n\n## Architecture\n\n- Web (apps/nextjs): Next.js (App Router), React 19, Tailwind, tRPC, React Query\n- Mobile (apps/expo): Expo, NativeWind; uses shared types for DX\n- API (packages/api): tRPC router, Drizzle ORM, recommendation service\n- DB (packages/db): Drizzle + edge‑compatible Postgres driver\n- Auth (packages/auth): better‑auth configuration and schema generation\n- UI (packages/ui): shared components (shadcn‑ui primitives)\n\nMonorepo management via Turborepo; shared presets in tooling/*.\n\n### Monorepo Structure\n\n```text\napps/\n  nextjs/         # Web app (Next.js)\n  expo/           # Mobile app (Expo)\npackages/\n  api/            # tRPC router, recs service\n  auth/           # Better‑Auth config \u0026 schema generation\n  db/             # Drizzle ORM and schema\n  ui/             # Shared UI components\ntooling/          # ESLint/TS/Tailwind/Prettier presets\n```\n\n## Recommendations Engine\n\nKey locations:\n- Router: `packages/api/src/router/recommendation.ts`\n- Service: `packages/api/src/recommendation/service.ts`\n- Repository: `packages/api/src/recommendation/repository.ts`\n- Content similarity: `packages/api/src/recommendation/content-similarity.ts`\n\nEndpoints:\n- `recommendation.forYou({ limit })` — personalized by recent user signals\n- `recommendation.trending({ limit })` — recent interactions with cart/order fallback\n- `recommendation.similar({ productId, limit })` — product‑anchored suggestions\n- `recommendation.trackInteraction({ productId, interactionType, weight?, metadata? })`\n\nUI integration:\n- Sections component: `apps/nextjs/src/app/_components/recommendations.tsx`\n  - For You, Trending Now, Similar Items (Suspense + queryOptions)\n- Product card/grid: `apps/nextjs/src/app/_components/products.tsx`\n- Tracking hook: `apps/nextjs/src/lib/recommendations.ts` (dedups view events)\n\nData flow:\n1) Client fires `trackInteraction` (view/cart/purchase/wishlist)\n2) API stores weighted signals\n3) Aggregation ranks product IDs; minimal product projection returned\n4) UI renders sections with a11y states and lazy fetch\n\n## Installation\n\nPrerequisites: Node (per package.json engines), pnpm, Postgres (or Vercel Postgres), and a .env file.\n\n```bash\n# Install dependencies\npnpm i\n\n# Configure environment variables\ncp .env.example .env  # then fill values\n\n# Push the Drizzle schema\npnpm db:push\n\n# Generate Better‑Auth database schema\npnpm --filter @acme/auth generate\n```\n\n### Environment Variables\n\nCreate `.env` at the repo root. Common variables:\n\n```bash\n# Database\nPOSTGRES_URL=...\n\n# Better‑Auth\nAUTH_SECRET=...\nAUTH_DISCORD_ID=...\nAUTH_DISCORD_SECRET=...\nAUTH_BASE_URL=http://localhost:3000\nAUTH_PRODUCTION_URL=https://your-domain.com\n\n# Expo (mobile)\nEXPO_PUBLIC_API_URL=http://192.168.1.10:3000\n```\n\n## Usage\n\nRun the web app (Next.js):\n```bash\npnpm --filter @acme/nextjs dev\n```\n\nRun the mobile app (Expo):\n```bash\npnpm --filter @acme/expo dev\n```\n\nNotes:\n- Update `apps/expo/src/utils/base-url.ts` to point to your LAN or production API URL.\n- For OAuth in preview/development, prefer Better‑Auth proxy.\n\n### Common Issues\n\n- If the Edge runtime complains about Node‑only modules in middleware, keep middleware minimal and enforce RBAC server‑side in routes.\n- If mobile cannot reach your API, verify LAN IP and firewall settings.\n\n## Development Scripts\n\nCommon scripts:\n- `pnpm db:push` — apply Drizzle schema\n- `pnpm --filter @acme/auth generate` — generate auth schema\n- `pnpm --filter @acme/nextjs dev` — Next.js dev server\n- `pnpm --filter @acme/expo dev` — Expo dev server\n\nFormatting and linting:\n```bash\npnpm fmt    # Prettier\npnpm lint   # ESLint\npnpm typecheck\n```\n\n## Quality (Lint, Types)\n\n- Lint (shared presets under tooling/eslint):\n```bash\npnpm lint\n```\n- Typecheck across packages:\n```bash\npnpm typecheck\n```\n\n## Deployment\n\nWeb (Next.js):\n- Deploy `apps/nextjs` to Vercel; set required env vars (e.g., `POSTGRES_URL`).\n- Use your deployed domain for the Expo base URL in production.\n\nMobile (Expo):\n- Use EAS Build/Submit for `apps/expo`.\n- Ensure `getBaseUrl` points to the deployed web API.\n\n### Security \u0026 Data\n\n- Store secrets in platform key managers (Vercel env, EAS secrets)\n- Add SAST/DAST and dependency scanning in CI for production use\n\n## Contributing\n\nPRs welcome. Please:\n- Match existing code style (see tooling/*)\n- Keep functions small and readable\n- Favor explicit types and minimal comments that explain non‑obvious rationale\n\nSuggested workflow:\n- Create a feature branch\n- Write focused commits with descriptive messages\n- Ensure `pnpm lint` and `pnpm typecheck` pass\n- Open a PR with a short description and screenshots when relevant\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n## Contact\n\nQuestions or suggestions?\n- Open an issue in this repo\n- Or reach out via your preferred channel\n\n---\n\nThis repository is based on create‑t3‑turbo and extends it with a real‑world recommendations system for Fashion Hub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohittcodes%2Ffashion-hub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohittcodes%2Ffashion-hub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohittcodes%2Ffashion-hub/lists"}