This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Install dependencies
pnpm i
# Copy the example env file and modify as needed
cp .env.example .env
# Start all applications
pnpm dev
# Start only the Next.js app
pnpm dev:next
# Start Expo app (iOS)
cd apps/expo
pnpm dev:ios
# Start Expo app (Android)
cd apps/expo
pnpm dev:android# Build all applications
pnpm build
# Build a specific app
pnpm -F @project-name/nextjs build
pnpm -F @project-name/expo build# Run all tests (Next.js app)
pnpm -F @project-name/nextjs test
# Run tests in watch mode
pnpm -F @project-name/nextjs test -- --watch
# Run API tests
pnpm -F @project-name/api test# Run ESLint
pnpm lint
# Fix ESLint issues
pnpm lint:fix
# Check formatting
pnpm format
# Fix formatting issues
pnpm format:fix
# Check types
pnpm typecheck
# Check workspace dependencies
pnpm lint:ws# Push schema changes to the database
pnpm db:push
# Open MongoDB studio
pnpm db:studio# Add a new UI component using shadcn/ui CLI
pnpm ui-add# Generate a new package
pnpm turbo gen initThis repository is a T3 stack monorepo built with Turborepo, consisting of:
-
Apps:
- nextjs: Main web application (Next.js 14, React 19)
- expo: Mobile application (Expo, React Native) [optional]
-
Packages:
- api: tRPC router definitions
- db: Database models and connections (MongoDB)
- ui: Shared UI components (shadcn/ui)
- validators: Zod schemas for validation
-
Tooling:
- Shared configurations for ESLint, Prettier, TypeScript, etc.
- Frontend: Next.js 14, React 19, Tailwind CSS
- Mobile: Expo, React Native, NativeWind
- API: tRPC v11 for type-safe API calls
- Database: MongoDB with mongoose/typegoose
- Authentication: Clerk
- Build System: Turborepo
- The application uses tRPC for type-safe API communication between client and server
- Database models use typegoose for type-safe schema definitions
- API procedures are divided into:
publicProcedure: Available to all usersprotectedProcedure: Requires authentication
- Uses Clerk for authentication in both web and mobile apps
- Protected routes and procedures use Clerk auth context
- Mobile app authentication uses expo-web-browser and secure storage
Required environment variables (defined in .env):
MONGODB_URI: MongoDB connection stringCLERK_SECRET_KEY: Clerk authentication secretCLERK_PUBLISHABLE_KEY: Clerk authentication public key
- Make changes to shared packages in the
packages/directory - Changes are automatically picked up by apps using those packages
- Use the integrated tools for linting, formatting, and type checking
- Add new UI components via the
ui-addscript - Create new packages with
turbo gen init - Run tests before submitting changes
Documentation is co-located with the code:
- Project Overview: Main documentation index
- Project Structure: Monorepo organization
- App Documentation:
- Package Documentation:
Do what has been asked; nothing more, nothing less. NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one. NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.