ShopStack is a production-ready foundation for a marketplace-style commerce platform that combines a storefront, vendor workspace, and admin console into one codebase. It emphasizes a modern React 19 UI, file-based routing, and a type-safe, server-function-first approach to backend logic.
It is designed for three primary audiences:
- Customers: Browse products, manage orders, and shop.
- Vendors: Manage stores, inventory, staff, and operations.
- Admins: Oversee tenants, platform configuration, and global catalogs.
The project features a complete UI structure with authentication and vendor onboarding wired to the database, using mock data for some management pages to showcase layouts while backend modules are completed.
- TanStack Start: A full-stack React framework with server-side rendering, file-based routing, and server functions.
- TanStack Router: A fully type-safe router for React applications, providing file-based routing.
- TanStack Query: Powerful asynchronous state management for fetching, caching, and updating server state.
- TanStack Table: Headless UI for building powerful and performant tables and datagrids.
- Drizzle ORM: A lightweight and type-safe TypeScript ORM for interacting with the database.
- Neon Postgres: Serverless Postgres built for the cloud, providing scalability and performance.
- Better Auth: Comprehensive authentication library for TypeScript, supporting email/password, social providers, and 2FA.
- Tailwind CSS 4: A utility-first CSS framework for rapid UI development with a focus on modern features.
- Radix UI: Unstyled, accessible components for building high-quality design systems and web apps.
- Zustand: A small, fast, and scalable bearbones state-management solution.
- Bun: A fast all-in-one JavaScript runtime and toolkit.
- Landing & Products: Dynamic landing page, product listings, and detailed product pages.
- Shopping Experience: Cart management, checkout flow, order confirmation, and tracking.
- User Accounts: Customer profile management and wishlist functionality.
- Dashboard: Dedicated vendor dashboard and "my shop" area.
- Shop Management: Tools for managing products, orders, staff, shipping, taxes, and more.
- Onboarding: Integrated vendor onboarding flow.
- Platform Oversight: Admin dashboard for global metrics.
- Tenant Management: Manage tenants, users, and global settings.
- Catalog Control: Oversee global products, categories, brands, and reviews.
- Auth System: Secure authentication mounted at
/api/auth/*using Better Auth. - Server Functions: Type-safe backend logic using TanStack Start server functions.
- Email: OTP email delivery via Nodemailer (SMTP).
Follow these steps to set up the project locally on your machine.
Make sure you have the following installed on your machine:
- Bun (Recommended runtime)
- Node.js (v20+ for tooling)
- PostgreSQL (or a Neon database)
git clone https://github.com/FullStack-Flow/shop-stack.git
cd shop-stackInstall the project dependencies using Bun:
bun installCreate a new file named .env in the root of your project and add the following content:
DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/db
BETTER_AUTH_SECRET=replace-with-strong-secret
VITE_BETTER_AUTH_URL=http://localhost:3000
NODE_ENV=development
# Production URL
BETTER_AUTH_URL=https://your-production-domain.com
# Social Auth (Optional)
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# SMTP (Brevo Example)
BREVO_SMTP_SERVER=smtp-relay.brevo.com
BREVO_SMTP_PORT=587
BREVO_SMTP_LOGIN=your-brevo-login
BREVO_SMTP_PASSWORD=your-brevo-passwordRun the following commands to generate migrations, push them to the database, and seed initial data:
bun run db:generate
bun run db:push
bun run db:seedbun run devOpen http://localhost:3000 in your browser to view the project.
- Live Demo: https://shop-stack-demo.vercel.app/
- Repository: https://github.com/FullStack-Flow/shop-stack
- Video Walkthrough: https://youtu.be/KRZF4VxqETU
The start script runs server.ts, a Bun-based production server that serves the built TanStack Start output.
- Set all required environment variables in your hosting platform.
- Build the application:
bun run build
- Run the production server:
bun run start
- Fork the repository and create a feature branch.
- Run
bun installand ensure tests and linting pass. - Keep UI changes aligned with existing Tailwind and shadcn patterns.
- Submit a pull request with a clear summary and screenshots.