A full-stack application built with a Turborepo monorepo structure, featuring a NestJS backend and Next.js frontend.
New to this project? Check out QUICK_START.md for a 5-minute setup guide!
For detailed environment configuration and Railway deployment: See ENV_SETUP.md
For wallet API documentation: See WALLET_API.md
- Node.js >= 18
- pnpm 9.0.0 (recommended package manager)
- PostgreSQL (local or Docker)
# Install dependencies
pnpm installStart all applications in development mode:
pnpm devOr run specific applications:
# Run only the web app (Next.js frontend)
pnpm dev --filter=web
# Run only the backend (NestJS API)
pnpm dev --filter=backendDevelopment URLs:
- Frontend: http://localhost:3000
- Backend: http://localhost:3001 (default NestJS port)
Build all packages and applications:
pnpm buildBuild specific applications:
# Build only the web app
pnpm build --filter=web
# Build only the backend
pnpm build --filter=backend# Lint all packages
pnpm lint
# Type checking
pnpm check-types
# Run tests
pnpm test
# Format code
pnpm formatThis Turborepo includes the following packages/apps:
backend: a NestJS API server with TypeScriptweb: a Next.js 15 app with React 19 and Turbopack@repo/wallet-sdk: Pure wallet/chain logic layer with @tetherto/wdk integration@repo/types: shared TypeScript types and DTOs used across the monorepo@repo/ui: shadcn/ui component library@repo/eslint-config: ESLint configurations (includeseslint-config-nextandeslint-config-prettier)@repo/typescript-config: sharedtsconfig.jsonconfigurations used throughout the monorepo
Each package/app is 100% TypeScript.
Backend:
- NestJS 11
- TypeScript 5.7
- class-validator & class-transformer for DTO validation
- Jest for testing
Frontend:
- Next.js 15.5
- React 19.1
- Turbopack for fast development builds
- TypeScript 5.9
Monorepo Tools:
- Turborepo 2.5.8 for build orchestration
- pnpm workspaces for dependency management
Tempwallets.com/
βββ apps/
β βββ backend/ # NestJS API server
β β βββ src/
β β β βββ products/ # Products module
β β β βββ main.ts # Application entry point
β β βββ test/ # E2E tests
β βββ web/ # Next.js frontend
β βββ app/ # App router pages
β βββ public/ # Static assets
βββ packages/
β βββ wallet-sdk/ # Wallet/chain logic with @tetherto/wdk
β βββ types/ # Shared TypeScript types & DTOs
β βββ ui/ # Shared UI components (shadcn/ui)
β βββ eslint-config/ # Shared ESLint configurations
β βββ typescript-config/ # Shared TypeScript configurations
βββ turbo.json # Turborepo configuration
βββ pnpm-workspace.yaml # pnpm workspace configuration
The build process uses Turborepo to orchestrate builds across all packages and applications with intelligent caching.
Build Pipeline:
@repo/types- Compiles shared TypeScript types first (dependency for backend)backend- Builds NestJS application (depends on types)web- Builds Next.js application independently
Recent Build Output:
β @repo/types#build - TypeScript compilation
β backend#build - NestJS production build
β web#build - Next.js optimized production build
β’ Route bundling
β’ Static page generation
β’ Build optimization
Build Caching: Turborepo caches build outputs to speed up subsequent builds. Only changed packages are rebuilt.
If you encounter decorator-related errors with class-validator, ensure your tsconfig.json includes:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"useDefineForClassFields": false
}
}If you see errors like 'apps/backend/' does not have a commit checked out:
rm -rf apps/backend/.git
git add .If you see warnings about using global turbo, install it locally:
pnpm add turbo -D -wTip
Vercel Remote Cache is free for all plans and can significantly speed up CI/CD pipelines.
Turborepo supports Remote Caching to share build cache artifacts across machines and team members.
Enable Remote Caching:
# Login to Vercel
pnpm exec turbo login
# Link your monorepo to remote cache
pnpm exec turbo linkThis enables:
- Shared build caches across your team
- Faster CI/CD builds
- Consistent build artifacts
Quick Setup:
# Backend
cd apps/backend
cp .env.example .env
# Edit .env with your DATABASE_URL and other settings
# Web
cd apps/web
cp .env.example .env.local
# Edit .env.local with your API URLπ For detailed instructions: See ENV_SETUP.md for:
- Local development setup
- Railway deployment guide
- Environment variable reference
- Security best practices
Note
Never commit .env or .env.local files. They are already in .gitignore.
- β
Any package (
@repo/*) - β Other apps (no cross-app imports)
- β Other packages in dependency order
- β Apps (packages must be app-agnostic)
// Backend
import { WalletFactory } from '@repo/wallet-sdk';
import { CreateProductRequest } from '@repo/types';
// Frontend
import { Button } from '@repo/ui/components/ui/button';
import { WalletManager } from '@repo/wallet-sdk';Dependency Graph:
apps/web βββββββ
βββ> @repo/wallet-sdk ββ> @tetherto/wdk-*
apps/backend βββ βββ> @repo/types
apps/web ββ> @repo/ui
Learn more about the power of Turborepo: