Note: This project is currently under development!
- When buying products online, there is a risk of counterfeit goods due to unverified suppliers or intermediaries.
- You don’t need to be a reputable seller to deliver products to consumers.
- There is no reliable way to verify product authenticity during resale or second-hand auctions.
- Use blockchain to store product information and track the ownership of products
This project is a supply chain management system that uses Move on Aptos blockchain to store product information and track the ownership of products.
truyGoc
is a Vietnamese word (truy gốc) means trace origin
.
- Product can be minted by company with useful information
- Product can be transferred to another company
- Product can be checked on chain
- QR code can be generated for a product
- QR code can be scanned to verify product ownership
- User and other companies can check product ownership and other information on chain
- User and other companies do not need to trust any third party to verify product ownership
- Every product is unique and cannot be replicated on blockchain
- When third party try to fake product ownership and information, it will be detected on blockchain. For example, when they try to copy product ID on blockchain, it will be detected by unmatchable the human-readable ID on product. If they try to copy every product ID on blockchain, it will be not scalable for large number of products.
This project was created with Better-T-Stack, a modern TypeScript stack that combines React, TanStack Router, Hono, TRPC, and more.
- TypeScript - For type safety and improved developer experience
- TanStack Router - File-based routing with full type safety
- React Native - Build mobile apps using React
- Expo - Tools for React Native development
- TailwindCSS - Utility-first CSS for rapid UI development
- shadcn/ui - Reusable UI components
- Hono - Lightweight, performant server framework
- tRPC - End-to-end type-safe APIs
- Bun - Runtime environment
- Drizzle - TypeScript-first ORM
- SQLite/Turso - Database engine
- Authentication - Email & password authentication with Better Auth
- Turborepo - Optimized monorepo build system
- PWA - Progressive Web App support
- Tauri - Build native desktop applications
- Starlight - Documentation site with Astro
- Biome - Linting and formatting
- Husky - Git hooks for code quality
First, install the dependencies:
bun install
This project uses SQLite with Drizzle ORM.
- Start the local SQLite database:
cd apps/server && bun db:local
-
Update your
.env
file in theapps/server
directory with the appropriate connection details if needed. -
Apply the schema to your database:
bun db:push
Then, run the development server:
bun dev
Open http://localhost:3001 in your browser to see the web application. Use the Expo Go app to run the mobile application. The API is running at http://localhost:3000.
truyGoc/
├── apps/
│ ├── web/ # Frontend application (React + TanStack Router)
│ ├── native/ # Mobile application (React Native, Expo)
│ ├── docs/ # Documentation site (Astro Starlight)
│ └── server/ # Backend API (Hono, TRPC)
bun dev
: Start all applications in development modebun build
: Build all applicationsbun dev:web
: Start only the web applicationbun dev:server
: Start only the serverbun check-types
: Check TypeScript types across all appsbun dev:native
: Start the React Native/Expo development serverbun db:push
: Push schema changes to databasebun db:studio
: Open database studio UIcd apps/server && bun db:local
: Start the local SQLite databasebun check
: Run Biome formatting and lintingcd apps/web && bun generate-pwa-assets
: Generate PWA assetscd apps/web && bun desktop:dev
: Start Tauri desktop app in developmentcd apps/web && bun desktop:build
: Build Tauri desktop appcd apps/docs && bun dev
: Start documentation sitecd apps/docs && bun build
: Build documentation site
Your project will be available at:
- Frontend: http://localhost:3001
- Backend API: http://localhost:3000
- Docs: http://localhost:4321
NOTE: For Expo connectivity issues, update apps/native/.env with your local IP address: EXPO_PUBLIC_SERVER_URL=http://<YOUR_LOCAL_IP>:3000
Database commands:
- Apply schema:
bun db:push
- Database UI:
bun db:studio
- Start local DB (if needed):
cd apps/server && bun db:local
Desktop app with Tauri:
- Start desktop app:
cd apps/web && bun desktop:dev
- Build desktop app:
cd apps/web && bun desktop:build
NOTE: Tauri requires Rust and platform-specific dependencies. See: https://v2.tauri.app/start/prerequisites/
Linting and formatting:
- Format and lint fix:
bun check
Documentation with Starlight:
- Start docs site:
cd apps/docs && bun dev
- Build docs site:
cd apps/docs && bun build
WARNING: 'bun' might cause issues with web + native apps in a monorepo. Use 'pnpm' if problems arise.
Update all dependencies: bunx taze -r
You can reproduce this setup with the following command:
bun create better-t-stack@latest truyGoc --frontend tanstack-router native-unistyles --backend hono --runtime bun --database sqlite --orm drizzle --api trpc --auth --addons turborepo pwa tauri starlight biome husky --examples todo ai --db-setup turso --git --package-manager bun --install