Skip to content

Latest commit

 

History

History
213 lines (150 loc) · 4.2 KB

File metadata and controls

213 lines (150 loc) · 4.2 KB

Getting Started with HeySport

Welcome to the HeySport monorepo! This guide will help you get up and running quickly.

🚀 Quick Start (3 Steps)

Step 1: Verify Prerequisites

Make sure you have these installed:

# Check Node.js (need >= 18.0.0)
node --version

# Check pnpm (need >= 9.0.0)
pnpm --version

# Check Bun (need >= 1.0.0)
bun --version

Missing something? See the Installation section below.

Step 2: Install Dependencies

pnpm install

This installs all dependencies for:

  • API server (Hono + Bun)
  • Mobile app (Expo + React Native)
  • Shared packages (TypeScript configs + types)

Step 3: Start Development

pnpm dev

This starts both the API and mobile app simultaneously!

📱 Development

Running Individual Apps

API Only:

cd apps/api
bun dev

Mobile Only:

cd apps/mobile
pnpm dev

Testing the API

# Health check
curl http://localhost:3001

# Get a user
curl http://localhost:3001/api/users/123

Testing the Mobile App

  1. Install Expo Go on your phone:

  2. Run pnpm dev in apps/mobile

  3. Scan the QR code with:

    • iOS: Camera app → opens in Expo Go
    • Android: Expo Go app → Scan QR

🏗️ Project Structure

heysport/
├── apps/
│   ├── api/                 # Hono API (Bun runtime)
│   │   └── src/index.ts     # API routes & logic
│   └── mobile/              # Expo/React Native app
│       └── App.tsx          # Mobile app entry
├── packages/
│   ├── types/               # Shared TypeScript types
│   └── typescript-config/   # Shared TS configs
├── turbo.json               # Turborepo pipeline
├── pnpm-workspace.yaml      # pnpm workspace config
└── package.json             # Root package.json

🎯 What's Included

✅ Configured & Ready to Use

  • Turborepo - Fast build system for monorepos
  • pnpm Workspaces - Efficient dependency management
  • Expo/React Native - Mobile app development
  • Hono + Bun - Ultra-fast API server
  • TypeScript - Full type safety across the monorepo
  • Shared Types - Type definitions used by both apps
  • Metro Config - Configured for monorepo structure

📦 Shared Packages

@repo/types - Shared TypeScript types

import type { User, ApiResponse } from '@repo/types';

@repo/typescript-config - Shared TypeScript configurations

  • base.json - Base config
  • react-native.json - For mobile app
  • node.json - For API server

🛠️ Common Tasks

Type Checking

pnpm type-check

Building

pnpm build

Linting (when configured)

pnpm lint

Adding Dependencies

To the API:

cd apps/api
bun add <package-name>

To the Mobile App:

cd apps/mobile
pnpm add <package-name>

To Shared Types:

cd packages/types
pnpm add -D <package-name>

📚 Learn More

💡 Tips

  1. Use TypeScript: Define shared types in packages/types for consistency
  2. Hot Reload: Both apps support hot reload in development
  3. Turbo Cache: Second runs are faster thanks to Turborepo caching
  4. Workspace Protocol: Dependencies use workspace:* for monorepo packages

Installation

pnpm

npm install -g pnpm

Bun

curl -fsSL https://bun.sh/install | bash

Expo CLI (included in dependencies)

Installed automatically with pnpm install.

🆘 Need Help?

🎉 You're Ready!

Start building amazing things with HeySport!

pnpm dev

Happy coding! 🚀