Native Development Workflow with Network Testing Support #1

Merged
cal merged 2 commits from feature/native-dev-workflow into main 2026-02-07 00:16:06 +00:00
Owner

Overview

This PR introduces a fast native development workflow that eliminates Docker rebuild overhead and enables instant cross-device testing.

Performance Improvements

  • Startup time: 3-5 minutes → 5-10 seconds (18-36x faster)
  • Code changes: 3-5 min rebuild → Instant hot-reload
  • Debugging: Native debugger support

Key Features

1. Native Dev Script (dev-native.sh)

  • One-command startup with hot-reload
  • Runs backend with uv run uvicorn --reload
  • Runs frontend with npm run dev
  • Redis in Docker (lightweight, seconds to start)

2. Network Testing Mode

./dev-native.sh start              # localhost only
./dev-native.sh start --network    # accessible from network
  • Auto-detects network IP
  • Updates all environment variables automatically
  • Shows Discord OAuth redirect URI to add
  • Test from phone/tablet/laptop on same network
  • Development mode: Secure=false + SameSite=lax (localhost-friendly)
  • Production mode: Secure=true + SameSite=none (cross-domain)
  • Respects APP_ENV setting

4. Python 3.13 Pinning

  • Added .python-version to pin to Python 3.13
  • Resolves pydantic-core incompatibility with Python 3.14

Files Changed

  • Added: dev-native.sh - Native dev startup script
  • Added: NATIVE_DEV_SETUP.md - Comprehensive documentation
  • Added: backend/.python-version - Python version pinning
  • Added: backend/.env.network - Network mode template
  • Modified: backend/app/utils/cookies.py - Cookie security respects APP_ENV
  • Modified: CLAUDE.md - Updated quick start guide
  • Modified: .gitignore - Added native dev artifacts

Testing

  • All 981 backend tests passing
  • Backend starts in ~5 seconds with hot-reload
  • Frontend starts in ~5 seconds with HMR
  • Discord OAuth works on localhost
  • Network mode tested and working
  • Cookie security flags correct for dev/prod

Documentation

See NATIVE_DEV_SETUP.md for complete setup instructions including Discord OAuth configuration.

For daily development, use ./dev-native.sh start for maximum speed. Keep ./start.sh prod for production build testing only.

## Overview This PR introduces a fast native development workflow that eliminates Docker rebuild overhead and enables instant cross-device testing. ## Performance Improvements - **Startup time**: 3-5 minutes → 5-10 seconds (18-36x faster) - **Code changes**: 3-5 min rebuild → Instant hot-reload - **Debugging**: Native debugger support ## Key Features ### 1. Native Dev Script (`dev-native.sh`) - One-command startup with hot-reload - Runs backend with `uv run uvicorn --reload` - Runs frontend with `npm run dev` - Redis in Docker (lightweight, seconds to start) ### 2. Network Testing Mode ```bash ./dev-native.sh start # localhost only ./dev-native.sh start --network # accessible from network ``` - Auto-detects network IP - Updates all environment variables automatically - Shows Discord OAuth redirect URI to add - Test from phone/tablet/laptop on same network ### 3. Cookie Security Fix - Development mode: `Secure=false` + `SameSite=lax` (localhost-friendly) - Production mode: `Secure=true` + `SameSite=none` (cross-domain) - Respects `APP_ENV` setting ### 4. Python 3.13 Pinning - Added `.python-version` to pin to Python 3.13 - Resolves pydantic-core incompatibility with Python 3.14 ## Files Changed - **Added**: `dev-native.sh` - Native dev startup script - **Added**: `NATIVE_DEV_SETUP.md` - Comprehensive documentation - **Added**: `backend/.python-version` - Python version pinning - **Added**: `backend/.env.network` - Network mode template - **Modified**: `backend/app/utils/cookies.py` - Cookie security respects APP_ENV - **Modified**: `CLAUDE.md` - Updated quick start guide - **Modified**: `.gitignore` - Added native dev artifacts ## Testing - ✅ All 981 backend tests passing - ✅ Backend starts in ~5 seconds with hot-reload - ✅ Frontend starts in ~5 seconds with HMR - ✅ Discord OAuth works on localhost - ✅ Network mode tested and working - ✅ Cookie security flags correct for dev/prod ## Documentation See `NATIVE_DEV_SETUP.md` for complete setup instructions including Discord OAuth configuration. ## Recommended Workflow For daily development, use `./dev-native.sh start` for maximum speed. Keep `./start.sh prod` for production build testing only.
cal added 2 commits 2026-02-07 00:12:03 +00:00
- Add dev-native.sh script for fast local development (10s vs 3-5min Docker builds)
- Fix cookie security flags to respect APP_ENV (dev uses Secure=false, prod uses Secure=true)
- Pin backend to Python 3.13 (3.14 not yet supported by pydantic-core)
- Add comprehensive NATIVE_DEV_SETUP.md documentation
- Update CLAUDE.md to recommend native dev workflow
- Add .pids/ and .logs/ to .gitignore for native dev artifacts

Benefits:
- Instant startup (5-10 seconds)
- Hot-reload enabled (backend + frontend)
- Native debugging support
- No Docker rebuilds needed
- Discord OAuth works on localhost with proper cookie settings
- Add ./dev-native.sh start --network for network-accessible development
- Auto-detects network IP and configures all URLs accordingly
- Create .env.network templates for backend and frontend
- No manual environment variable editing needed
- Shows Discord OAuth redirect URI to add

Usage:
  ./dev-native.sh start              # localhost only
  ./dev-native.sh start --network    # accessible from network
  ./dev-native.sh restart --network  # restart in network mode

Benefits:
- Test from phone/tablet/laptop on same network
- One command to switch between local and network modes
- Automatic IP detection and configuration
cal merged commit 81c198f2bc into main 2026-02-07 00:16:06 +00:00
cal deleted branch feature/native-dev-workflow 2026-02-07 00:16:06 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/strat-gameplay-webapp#1
No description provided.