From a3cd46e39ace8b606b167b7081863807e3dfc524 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Wed, 1 Apr 2026 17:35:21 -0700 Subject: [PATCH] fix(ci): correct playwright config paths and add env example files - Fix testDir path from './src/__tests__/e2e' to './e2e' - Fix globalSetup path from './src/__tests__/e2e/global.setup' to './e2e/global.setup' - Create .env.development.example with development database configuration - Update .gitignore to allow .env.example files to be tracked --- .env.development.example | 15 +++++++++++ .env.example | 54 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 9 ++++++- playwright.config.ts | 4 +-- 4 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 .env.development.example create mode 100644 .env.example diff --git a/.env.development.example b/.env.development.example new file mode 100644 index 0000000..0502b9b --- /dev/null +++ b/.env.development.example @@ -0,0 +1,15 @@ +# Development environment configuration for EuchreCamp +# Copy this file to .env.development and fill in your values + +# Database Configuration +DATABASE_PROVIDER=postgresql +# Development database URL - must contain "_dev" to pass safety checks +DATABASE_URL="postgresql://euchre_camp:password@localhost:5432/euchre_camp_dev" + +# Authentication +BETTER_AUTH_SECRET="your-secret-key-change-this" +BETTER_AUTH_URL="http://localhost:3000" + +# Application Configuration +NODE_ENV=development +TRUSTED_ORIGINS="http://localhost:3000,http://127.0.0.1:3000" diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ddc3d66 --- /dev/null +++ b/.env.example @@ -0,0 +1,54 @@ +# EuchreCamp Environment Configuration +# Copy this file to .env and fill in your values + +# ============================================ +# Database Configuration +# ============================================ +# PostgreSQL connection string +# Format: postgresql://username:password@host:port/database +DATABASE_URL=postgresql://euchre:euchrepassword@localhost:5432/euchre_camp + +# Shadow database for Prisma migrations (optional for PostgreSQL) +DATABASE_SHADOW_URL=postgresql://euchre:euchrepassword@localhost:5432/euchre_camp_shadow + +# Database provider (postgresql, mysql, sqlite, etc.) +DATABASE_PROVIDER=postgresql + +# ============================================ +# Better Auth Configuration +# ============================================ +# Secret key for session encryption (generate a strong random string) +# Run: openssl rand -base64 32 +BETTER_AUTH_SECRET=your-secret-key-change-in-production + +# Base URL for authentication callbacks +# For production: https://your-domain.com +BETTER_AUTH_URL=http://localhost:3000 + +# ============================================ +# Application Configuration +# ============================================ +# Environment: development, production, test +NODE_ENV=production + +# Trusted origins for CORS and authentication +# Add your domain(s) for production +TRUSTED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000 + +# ============================================ +# Optional: External Services +# ============================================ +# If using external database (e.g., Supabase, Railway) +# DATABASE_URL=postgresql://user:pass@host:port/db + +# If using external auth provider +# BETTER_AUTH_URL=https://your-app.com + +# ============================================ +# CasaOS Deployment Notes +# ============================================ +# When deploying to CasaOS, set these via the UI: +# 1. DATABASE_URL: Your PostgreSQL connection string +# 2. BETTER_AUTH_SECRET: Generate with: openssl rand -base64 32 +# 3. BETTER_AUTH_URL: Your app's public URL +# 4. TRUSTED_ORIGINS: Your app's public URL(s) diff --git a/.gitignore b/.gitignore index 1a46362..09cf69f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,7 +34,14 @@ yarn-error.log* .pnpm-debug.log* # env files (can opt-in for committing if needed) -.env* +.env +.env.local +.env.development.local +.env.test.local +.env.production.local +# Allow example env files to be tracked +!.env.example +!.env.development.example # vercel .vercel diff --git a/playwright.config.ts b/playwright.config.ts index d4c8ea2..7579fdc 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,7 +1,7 @@ import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ - testDir: './src/__tests__/e2e', + testDir: './e2e', timeout: 30000, expect: { timeout: 5000 @@ -17,7 +17,7 @@ export default defineConfig({ // Reporter to use reporter: 'html', // Global setup and teardown - globalSetup: require.resolve('./src/__tests__/e2e/global.setup'), + globalSetup: require.resolve('./e2e/global.setup'), // Use base URL for relative navigation use: { baseURL: 'http://localhost:3000',