Skip to content

MXmaster2s/Tempwallets.com

Repository files navigation

Tempwallets.com

A full-stack application built with a Turborepo monorepo structure, featuring a NestJS backend and Next.js frontend.

πŸš€ Quick Start

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

Prerequisites

  • Node.js >= 18
  • pnpm 9.0.0 (recommended package manager)
  • PostgreSQL (local or Docker)

Quick Start

Installation

# Install dependencies
pnpm install

Development

Start all applications in development mode:

pnpm dev

Or run specific applications:

# Run only the web app (Next.js frontend)
pnpm dev --filter=web

# Run only the backend (NestJS API)
pnpm dev --filter=backend

Development URLs:

Production Build

Build all packages and applications:

pnpm build

Build specific applications:

# Build only the web app
pnpm build --filter=web

# Build only the backend
pnpm build --filter=backend

Other Commands

# Lint all packages
pnpm lint

# Type checking
pnpm check-types

# Run tests
pnpm test

# Format code
pnpm format

What's inside?

This Turborepo includes the following packages/apps:

Apps and Packages

  • backend: a NestJS API server with TypeScript
  • web: 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 (includes eslint-config-next and eslint-config-prettier)
  • @repo/typescript-config: shared tsconfig.json configurations used throughout the monorepo

Each package/app is 100% TypeScript.

Technology Stack

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

Project Structure

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

Build Information

The build process uses Turborepo to orchestrate builds across all packages and applications with intelligent caching.

Build Pipeline:

  1. @repo/types - Compiles shared TypeScript types first (dependency for backend)
  2. backend - Builds NestJS application (depends on types)
  3. 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.

Troubleshooting

TypeScript Decorator Errors

If you encounter decorator-related errors with class-validator, ensure your tsconfig.json includes:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "useDefineForClassFields": false
  }
}

Git Submodule Issues

If you see errors like 'apps/backend/' does not have a commit checked out:

rm -rf apps/backend/.git
git add .

Install Turbo Locally

If you see warnings about using global turbo, install it locally:

pnpm add turbo -D -w

Remote Caching (Optional)

Tip

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 link

This enables:

  • Shared build caches across your team
  • Faster CI/CD builds
  • Consistent build artifacts

Environment Variables

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.

Import Rules & Package Boundaries

Apps can import from:

  • βœ… Any package (@repo/*)
  • ❌ Other apps (no cross-app imports)

Packages can import from:

  • βœ… Other packages in dependency order
  • ❌ Apps (packages must be app-agnostic)

Import Examples:

// 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

Useful Links

Learn more about the power of Turborepo:

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages