From ac8dd8adffc2986516c012fe5afc474ad1e5a4a0 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 29 May 2025 11:13:26 +0100 Subject: [PATCH 1/5] fix: removed old references to second online environment --- .claude/settings.local.json | 3 ++- supabase/.gitignore | 9 +++++++++ supabase/scripts/push-dev.sh | 8 -------- supabase/scripts/push-prod.sh | 6 ------ 4 files changed, 11 insertions(+), 15 deletions(-) delete mode 100755 supabase/scripts/push-dev.sh delete mode 100755 supabase/scripts/push-prod.sh diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 364684b..7d3b62a 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -12,5 +12,6 @@ "Bash(git restore:*)" ], "deny": [] - } + }, + "enableAllProjectMcpServers": false } \ No newline at end of file diff --git a/supabase/.gitignore b/supabase/.gitignore index 3079223..1684c45 100644 --- a/supabase/.gitignore +++ b/supabase/.gitignore @@ -9,3 +9,12 @@ config.toml .env.*.local dev.env prod.env + +# Supabase +.branches +.temp + +# dotenvx +.env.keys +.env.local +.env.*.local diff --git a/supabase/scripts/push-dev.sh b/supabase/scripts/push-dev.sh deleted file mode 100755 index 3b2d867..0000000 --- a/supabase/scripts/push-dev.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e -export SUPABASE_DNS_RESOLVER=native -source ./supabase/dev.env -supabase db push --db-url "$SUPABASE_DB_URL" --debug - - -echo "Database schema pushed to Supabase successfully." \ No newline at end of file diff --git a/supabase/scripts/push-prod.sh b/supabase/scripts/push-prod.sh deleted file mode 100755 index 255dc23..0000000 --- a/supabase/scripts/push-prod.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -e -source ./supabase/prod.env -echo "⚠️ Dry run for production:" -supabase db push --db-url "$SUPABASE_DB_URL" --dry-run -echo "✅ If it looks good, remove --dry-run and push to prod." From 1f0b72806695bec0876772c918974ccc3a489a8a Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 29 May 2025 12:10:35 +0100 Subject: [PATCH 2/5] fix: cleaned supabase installation and updated docs --- .claude/settings.local.json | 5 +- .env.example | 10 +++ .vscode/settings.json | 4 ++ CLAUDE.md | 39 ++++++---- HITL_Docs/ARCHITECTURE.md | 11 +-- README.md | 139 ++++++++++++++++++++++++++++-------- 6 files changed, 158 insertions(+), 50 deletions(-) create mode 100644 .env.example create mode 100644 .vscode/settings.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 7d3b62a..0a57d8d 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -9,7 +9,10 @@ "Bash(git push:*)", "Bash(cat:*)", "Bash(git check-ignore:*)", - "Bash(git restore:*)" + "Bash(git restore:*)", + "Bash(supabase status:*)", + "Bash(supabase stop:*)", + "Bash(supabase start:*)" ], "deny": [] }, diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..0c21cfa --- /dev/null +++ b/.env.example @@ -0,0 +1,10 @@ +# Supabase Local Development Configuration +# Copy this file to .env.local - these values are the same for all local Supabase instances + +# Local Supabase instance (these are standard local development keys) +PUBLIC_SUPABASE_URL=http://127.0.0.1:54321 +PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0 +SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU + +# Optional: Email service for production (not needed for local development) +EMAIL_SERVICE_KEY=your_email_service_key \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8fc344b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "supabase.projectUrl": "http://127.0.0.1:54321", + "supabase.anonKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0" +} \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md index 3ae493e..516845e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,7 +15,7 @@ A digital workplace passport application that helps neurodivergent employees doc - Authentication: Supabase Magic Link - Testing: Vitest - Hosting: Vercel -- Development: Supabase environments (no local instances) +- Development: Local Supabase instance via Docker - Database Management: Supabase CLI ## Code Style & Conventions @@ -79,26 +79,35 @@ describe('MyComponent', () => { ## Environment Setup -- Required environment variables: - - `PUBLIC_SUPABASE_URL` - - `PUBLIC_SUPABASE_ANON_KEY` - - `SUPABASE_SERVICE_KEY` (server-only) +- Required environment variables (for local development): + - `PUBLIC_SUPABASE_URL=http://127.0.0.1:54321` + - `PUBLIC_SUPABASE_ANON_KEY` (from supabase status) + - `SUPABASE_SERVICE_KEY` (from supabase status, server-only) - `EMAIL_SERVICE_KEY` (for sending emails) - Supabase environments: - - Development, staging, and production projects in Supabase - - No local Supabase instance required - - Environment-specific database and auth settings + - **Development**: Local Supabase instance via Docker + - **Production**: Remote Supabase project + - Local instance provides full Supabase stack including Auth, Database, Storage, and Email testing - Setup commands: ```bash # Install dependencies npm install - # Copy environment template + # Install Supabase CLI globally + npm install -g supabase + + # Start local Supabase instance + supabase start + + # Copy environment template and configure for local development cp .env.example .env.local - # Fill in environment variables with appropriate Supabase project keys + # Set local environment variables: + # PUBLIC_SUPABASE_URL=http://127.0.0.1:54321 + # PUBLIC_SUPABASE_ANON_KEY=[anon key from supabase status] + # SUPABASE_SERVICE_KEY=[service_role key from supabase status] ``` ## Common Commands @@ -120,10 +129,12 @@ npm run check # TypeScript type checking # Development server npm run dev -# Database commands -./supabase/scripts/push-dev.sh # Push schema to development environment -./supabase/scripts/push-prod.sh # Push schema to production environment -npx supabase db reset # Reset and seed database +# Local Supabase commands +supabase start # Start local Supabase instance +supabase stop # Stop local Supabase instance +supabase status # Check status and get keys +supabase db reset # Reset and seed local database +supabase db push # Push schema changes to production ``` ## Project Structure diff --git a/HITL_Docs/ARCHITECTURE.md b/HITL_Docs/ARCHITECTURE.md index 67d75d9..b4dbfd4 100644 --- a/HITL_Docs/ARCHITECTURE.md +++ b/HITL_Docs/ARCHITECTURE.md @@ -18,16 +18,17 @@ - **Authentication**: Supabase Magic Link - **API**: SvelteKit server routes + Supabase client - **Testing**: Vitest with mocked Supabase client -- **Database Management**: Supabase CLI for schema migrations (via `./supabase/scripts/push-dev.sh` scripts) and seeding +- **Database Management**: Supabase CLI for schema migrations and local development ### Infrastructure - **Hosting**: Vercel - **Environments**: - - Development - - Production -- **Database**: Supabase environments (no local instances required) - - Separate Supabase projects for each environment + - **Development**: Local Supabase instance via Docker + - **Production**: Remote Supabase project +- **Database**: + - Local development uses Docker-based Supabase stack + - Production uses remote Supabase project - Environment-specific configuration and credentials ## Project Structure diff --git a/README.md b/README.md index 159326f..1dc723a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,36 @@ A digital workplace passport application that helps neurodivergent employees doc - **Authentication**: Supabase Magic Link - **Testing**: Vitest + @testing-library/svelte +## Prerequisites + +Before starting development, ensure you have the following installed: + +### Required Software + +1. **Node.js** (v18 or higher) + ```bash + # Check your version + node --version + ``` + Download from [nodejs.org](https://nodejs.org/) if needed. + +2. **Docker Desktop** + - **macOS**: Download from [Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/) + - **Windows**: Download from [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/) + - **Linux**: Follow [Docker Engine installation](https://docs.docker.com/engine/install/) for your distribution + + ```bash + # Verify Docker is running + docker --version + docker ps + ``` + +3. **Git** + ```bash + # Check if installed + git --version + ``` + ## Development Setup 1. Clone the repository: @@ -28,7 +58,7 @@ A digital workplace passport application that helps neurodivergent employees doc cp .env.example .env.local ``` - Fill in the `.env.local` file with your Supabase project details. + **Note**: The `.env.example` already contains the correct local development keys that Supabase always uses. 4. Install Supabase CLI: ```bash @@ -41,63 +71,112 @@ A digital workplace passport application that helps neurodivergent employees doc For other installation options, see the [Supabase CLI docs](https://supabase.com/docs/guides/cli/getting-started). -5. Login to Supabase: +5. Start local Supabase instance: ```bash - supabase login + supabase start ``` -6. Link your local project to Supabase: + **First time setup notes**: + - This will download several Docker images (~2-3GB total) + - The download may take 5-15 minutes depending on your internet connection + - Docker Desktop must be running before executing this command + - All database migrations will be automatically applied + +6. Verify setup: ```bash - supabase link --project-ref + # Start the development server + npm run dev + + # In another terminal, check Supabase Studio + open http://127.0.0.1:54323 ``` - You can find your project reference in the Supabase dashboard URL: `https://supabase.com/dashboard/project/`. - - > **IMPORTANT**: When prompted, you'll need to create `supabase/config.toml` with your database password. This file contains sensitive information and is already added to `.gitignore` to prevent it from being committed. - ## Database Management -### Pushing Schema Changes +### Local Development -To push database schema changes to your Supabase project, you can use the provided scripts: +Your local Supabase instance runs entirely in Docker containers. The database schema is automatically applied from the migrations when you start the instance. ```bash -# First, make scripts executable (only needed once) -chmod +x supabase/scripts/*.sh +# Start the local Supabase stack +supabase start -# Push schema to development environment -./supabase/scripts/push-dev.sh +# Check status and get connection details +supabase status + +# Reset local database (clears data and re-applies migrations) +supabase db reset -# Push schema to production environment (runs in dry-run mode by default) -./supabase/scripts/push-prod.sh +# Stop the local instance +supabase stop ``` -> **Note**: The scripts use environment variables from `supabase/dev.env` and `supabase/prod.env` files. The production script runs in dry-run mode by default for safety - edit the script to remove the `--dry-run` flag when you're ready to actually push to production. +### Production Deployment -Alternatively, you can use the Supabase CLI directly: +When ready to deploy schema changes to production: ```bash -# Push schema to development environment -npx supabase db push --env dev - -# Push schema to production environment -npx supabase db push --env prod +# Push local schema changes to production Supabase project +supabase db push ``` ### Generating Types -Generate TypeScript types from your database schema: +Generate TypeScript types from your local database schema: ```bash supabase gen types typescript --local > src/lib/types/supabase.ts ``` -### Seeding the Database +### Accessing Local Services -```bash -# Run the seed script -supabase db reset -``` +When running locally, you can access: + +- **API**: http://127.0.0.1:54321 +- **Database**: postgresql://postgres:postgres@127.0.0.1:54322/postgres +- **Studio**: http://127.0.0.1:54323 +- **Email Testing (Inbucket)**: http://127.0.0.1:54324 + +## Troubleshooting + +### Common Issues + +1. **"Docker not found" error** + - Ensure Docker Desktop is installed and running + - Try restarting Docker Desktop + - On Windows: Make sure you're using PowerShell or Command Prompt as Administrator + +2. **Port conflicts (ports 54321-54327 already in use)** + ```bash + # Stop any existing Supabase instances + supabase stop + + # If that doesn't work, find and kill processes using the ports + lsof -ti:54321 | xargs kill -9 + ``` + +3. **Migration errors or missing tables** + ```bash + # Reset and reapply all migrations + supabase db reset + ``` + +4. **VS Code Supabase extension can't connect** + - Use URL: `http://127.0.0.1:54321` (not https) + - Get anon key from `supabase status` + - Try reloading VS Code window + +5. **Slow Docker image downloads** + - Initial setup downloads ~2-3GB of Docker images + - Consider running setup during good internet connectivity + - Images are cached after first download + +### Getting Help + +If you encounter issues not covered here: +1. Check `supabase status` for service health +2. Check `docker ps` to see running containers +3. Check the [Supabase CLI docs](https://supabase.com/docs/guides/cli) ## Development Workflow From 903cbfaccb694afc604a0f056b5957c447ed2fae Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 2 Jun 2025 11:30:02 +0100 Subject: [PATCH 3/5] data: improved seed --- .env.example | 16 +- CLAUDE.md | 37 ++- README.md | 74 ++++- scripts/seed-test-data.sh | 77 +++++ supabase/data/questions.json | 69 ++++ supabase/seed.sql | 18 ++ supabase/test_data_seed.sql | 599 +++++++++++++++++++++++++++++++++++ 7 files changed, 887 insertions(+), 3 deletions(-) create mode 100755 scripts/seed-test-data.sh create mode 100644 supabase/data/questions.json create mode 100644 supabase/seed.sql create mode 100644 supabase/test_data_seed.sql diff --git a/.env.example b/.env.example index 0c21cfa..00fee9c 100644 --- a/.env.example +++ b/.env.example @@ -7,4 +7,18 @@ PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYm SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU # Optional: Email service for production (not needed for local development) -EMAIL_SERVICE_KEY=your_email_service_key \ No newline at end of file +EMAIL_SERVICE_KEY=your_email_service_key + +# Production Database Configuration (for seeding test data in production) +# NOTE: For Vercel deployment, set these as environment variables in Vercel dashboard +# Get DATABASE_URL from your Supabase project settings > Database > Connection string +# Format: postgresql://[user]:[password]@[host]:[port]/[database] +DATABASE_URL=postgresql://postgres:[password]@db.[project-ref].supabase.co:5432/postgres + +# Alternative: Individual database connection parameters (if not using DATABASE_URL) +# Set these in Vercel environment variables for production deployment +# DB_HOST=db.[project-ref].supabase.co +# DB_PORT=5432 +# DB_USER=postgres +# DB_PASSWORD=your_production_password +# DB_NAME=postgres \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md index 516845e..2b1252f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -90,6 +90,11 @@ describe('MyComponent', () => { - **Production**: Remote Supabase project - Local instance provides full Supabase stack including Auth, Database, Storage, and Email testing +- Database seeding strategy: + - `supabase/seed.sql`: Real questions data (auto-runs with `supabase db reset`) + - `supabase/test_data_seed.sql`: Fake test data (run separately with script) + - `scripts/seed-test-data.sh`: Environment-aware script for adding test data + - Setup commands: ```bash # Install dependencies @@ -133,8 +138,13 @@ npm run dev supabase start # Start local Supabase instance supabase stop # Stop local Supabase instance supabase status # Check status and get keys -supabase db reset # Reset and seed local database +supabase db reset # Reset and seed local database with questions supabase db push # Push schema changes to production + +# Database seeding commands +./scripts/seed-test-data.sh # Add test data (works local and production) + # Local: uses default postgres password + # Vercel: requires DATABASE_URL environment variable ``` ## Project Structure @@ -183,6 +193,31 @@ Before submitting any code, ensure the following steps are completed: - [ ] Documentation updated - [ ] Accessibility checked +## Deployment (Vercel) + +### Environment Variables Setup + +Set these environment variables in Vercel dashboard (Settings > Environment Variables): + +**Required for application:** +- `PUBLIC_SUPABASE_URL` - Your production Supabase project URL +- `PUBLIC_SUPABASE_ANON_KEY` - Your production Supabase anon key +- `SUPABASE_SERVICE_KEY` - Your production Supabase service role key +- `EMAIL_SERVICE_KEY` - For sending emails + +**Optional for test data seeding:** +- `DATABASE_URL` - Full PostgreSQL connection string (get from Supabase > Settings > Database) + - Format: `postgresql://postgres:[password]@db.[project-ref].supabase.co:5432/postgres` + +### Seeding Test Data in Production + +```bash +# After deploying to Vercel, if you want to add test data: +# 1. Set DATABASE_URL environment variable in Vercel +# 2. Run locally with production env vars, or +# 3. Use Vercel CLI: vercel env pull && ./scripts/seed-test-data.sh +``` + ## Known Issues & Workarounds - Supabase has limited support for transactions - use client-side data validation as additional protection diff --git a/README.md b/README.md index 1dc723a..f733b73 100644 --- a/README.md +++ b/README.md @@ -104,13 +104,63 @@ supabase start # Check status and get connection details supabase status -# Reset local database (clears data and re-applies migrations) +# Reset local database (clears data and re-applies migrations + questions seed) supabase db reset # Stop the local instance supabase stop ``` +### Database Seeding + +The project uses a two-tier seeding strategy to separate real data from test data: + +#### 1. Questions Seed (Production Data) +- **File**: `supabase/seed.sql` +- **Content**: Real workplace passport questions +- **Auto-runs**: Automatically applied when you run `supabase db reset` +- **Purpose**: Contains the actual questions users will answer + +#### 2. Test Data Seed (Development/Testing) +- **File**: `supabase/test_data_seed.sql` +- **Content**: Fake users, responses, actions, and sharing events +- **Manual**: Run separately when you need test data +- **Purpose**: Provides realistic test data for development and testing + +#### Adding Test Data to Local Database + +After resetting your database, add test data for development: + +```bash +# Reset database (includes questions) +supabase db reset + +# Add test data (5 fake users with comprehensive responses) +./scripts/seed-test-data.sh +``` + +**What the test data includes:** +- 5 fake users with diverse profiles +- Multiple responses across all question categories +- Some questions answered multiple times (different versions) +- Mix of answered and skipped questions +- Workplace adjustments and actions linked to responses +- Sample sharing events with line managers + +#### Environment-Smart Seeding Script + +The `seed-test-data.sh` script automatically detects your environment: + +**Local Development:** +- Detects local Supabase instance +- Uses default `postgres` password (no prompts) +- Connects to `127.0.0.1:54322` + +**Production/Vercel:** +- Uses environment variables from Vercel dashboard +- Requires `DATABASE_URL` to be set +- Connects to production Supabase instance + ### Production Deployment When ready to deploy schema changes to production: @@ -120,6 +170,28 @@ When ready to deploy schema changes to production: supabase db push ``` +#### Seeding Test Data in Production + +If you need test data in your production environment (e.g., for demos or testing): + +1. **Set environment variables in Vercel dashboard:** + - Go to your Vercel project → Settings → Environment Variables + - Add `DATABASE_URL` with your production Supabase connection string + - Format: `postgresql://postgres:[password]@db.[project-ref].supabase.co:5432/postgres` + +2. **Run the seeding script:** + ```bash + # Option 1: Run locally with production env vars + vercel env pull .env.production + source .env.production + ./scripts/seed-test-data.sh + + # Option 2: Run with environment variables directly + DATABASE_URL="your-production-url" ./scripts/seed-test-data.sh + ``` + +⚠️ **Warning**: Only add test data to production if you need it for demos or testing. Real user data should come through the application interface. + ### Generating Types Generate TypeScript types from your local database schema: diff --git a/scripts/seed-test-data.sh b/scripts/seed-test-data.sh new file mode 100755 index 0000000..c1150be --- /dev/null +++ b/scripts/seed-test-data.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +# Script to seed test data into Supabase database +# Works for both local development and production environments +# Run this after 'supabase db reset' (local) or when you need test data + +set -e # Exit on any error + +echo "🌱 Seeding test data..." + +# Check if we're in local development or production +if [ -f ".env.local" ] && [ -d "supabase" ]; then + # Local development environment + echo "📍 Detected local development environment" + + # Check if Supabase is running locally + if ! supabase status &> /dev/null; then + echo "❌ Local Supabase is not running. Start it with 'supabase start'" + exit 1 + fi + + # For local, use default postgres password and set it via environment + export PGPASSWORD="postgres" + DB_HOST="127.0.0.1" + DB_PORT="54322" + DB_USER="postgres" + DB_NAME="postgres" + +else + # Production or remote environment + echo "📍 Detected production/remote environment" + + # Load environment variables for production + if [ -f ".env" ]; then + source .env + fi + + # Check required environment variables for production + if [ -z "$DATABASE_URL" ] && [ -z "$DB_HOST" ]; then + echo "❌ Missing database connection info. Set DATABASE_URL or DB_HOST, DB_PORT, etc." + exit 1 + fi + + # Use DATABASE_URL if available, otherwise construct from individual vars + if [ -n "$DATABASE_URL" ]; then + echo "🔗 Using DATABASE_URL for connection" + psql "$DATABASE_URL" -f supabase/test_data_seed.sql + echo "✅ Test data seeded successfully!" + exit 0 + else + # Use individual connection parameters + DB_HOST="${DB_HOST:-localhost}" + DB_PORT="${DB_PORT:-5432}" + DB_USER="${DB_USER:-postgres}" + DB_NAME="${DB_NAME:-postgres}" + + # Set password from environment if available + if [ -n "$DB_PASSWORD" ]; then + export PGPASSWORD="$DB_PASSWORD" + fi + fi +fi + +# Run the test data seed +echo "🔌 Connecting to database at $DB_HOST:$DB_PORT" +psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" -f supabase/test_data_seed.sql + +if [ $? -eq 0 ]; then + echo "✅ Test data seeded successfully!" + echo " - 3 fake users with profiles" + echo " - Sample responses across different categories" + echo " - Workplace adjustments and actions" + echo " - Sharing events with line managers" +else + echo "❌ Failed to seed test data" + exit 1 +fi \ No newline at end of file diff --git a/supabase/data/questions.json b/supabase/data/questions.json new file mode 100644 index 0000000..bc8f5ae --- /dev/null +++ b/supabase/data/questions.json @@ -0,0 +1,69 @@ +{ + "setQuestions": [ + { + "category": "wellbeing", + "mainQuestion": "Is there anything either inside or outside of work that may affect your wellbeing, that you think we should know about?" + + }, + { + "category": "wellbeing", + "mainQuestion": "Please describe how you are when you are having a good day." + + }, + { + "category": "wellbeing", + "mainQuestion": "Please describe how you are when you are having a bad, or not-so-good day. Sometimes people mask what’s really going on for them, so this may be things not visible to others." + + }, + { + "category": "wellbeing", + "mainQuestion": "If things are not going so well, are you aware of any early warning signs that would be useful for us to learn? What action can we take when we recognise your early warning signs? Please include how you would like us to approach and raise this with you, along with what we can and cannot do to help or support you." + + }, + { + "category": "wellbeing", + "mainQuestion": "The following symptoms are indications that I am not well enough to be at work" + + }, + { + "category": "parental", + "mainQuestion": "Do you have any parental or caring responsibilities that you think it would be helpful for us to know about?" + }, + { + "category": "parental", + "mainQuestion": "What arrangements or support do you need from us to fulfil your role as parent or carer? This may include looking after your own wellbeing as well as that of the person you are a parent or carer for." + }, + { + "category": "religious", + "mainQuestion": "Are there any arrangements or support you need from us which will enable you to take part in any religious practices? This may include space to pray or holidays you observe." + }, + { + + "category": "religious", + "mainQuestion": "Is there anything else you think would be helpful for us to know about your religion or belief? This may include dietary needs for work events." + }, + { + "category": "disability", + "mainQuestion": "Use this space to give a brief description of the impact your disability or long-term condition may have at work. You may need to split this up if you have multiple conditions. " + }, + { + + "category": "disability", + "mainQuestion": "Are there any barriers which are impacting on your ability to perform in your job?" + }, + { + + "category": "What support or understanding do you need from us?", + "mainQuestion": "Share the information about your work needs that would be helpful for your colleagues." + }, + { + + "category": "employer_Support", + "mainQuestion": "What do you need to thrive in your role here at Islington? There is space in the next section to outline specific workplace adjustments." + }, + { + "category": "personal_Introduction", + "mainQuestion": "Is there anything you think would be helpful for your colleagues to know? How should this be shared?" + } + ] +} diff --git a/supabase/seed.sql b/supabase/seed.sql new file mode 100644 index 0000000..d37e5b2 --- /dev/null +++ b/supabase/seed.sql @@ -0,0 +1,18 @@ +-- Seed data for questions table +-- This file populates the questions table with initial data + +INSERT INTO questions (category, question_text, "order") VALUES + ('wellbeing', 'Is there anything either inside or outside of work that may affect your wellbeing, that you think we should know about?', 1), + ('wellbeing', 'Please describe how you are when you are having a good day.', 2), + ('wellbeing', 'Please describe how you are when you are having a bad, or not-so-good day. Sometimes people mask what''s really going on for them, so this may be things not visible to others.', 3), + ('wellbeing', 'If things are not going so well, are you aware of any early warning signs that would be useful for us to learn? What action can we take when we recognise your early warning signs? Please include how you would like us to approach and raise this with you, along with what we can and cannot do to help or support you.', 4), + ('wellbeing', 'The following symptoms are indications that I am not well enough to be at work', 5), + ('parental', 'Do you have any parental or caring responsibilities that you think it would be helpful for us to know about?', 6), + ('parental', 'What arrangements or support do you need from us to fulfil your role as parent or carer? This may include looking after your own wellbeing as well as that of the person you are a parent or carer for.', 7), + ('religious', 'Are there any arrangements or support you need from us which will enable you to take part in any religious practices? This may include space to pray or holidays you observe.', 8), + ('religious', 'Is there anything else you think would be helpful for us to know about your religion or belief? This may include dietary needs for work events.', 9), + ('disability', 'Use this space to give a brief description of the impact your disability or long-term condition may have at work. You may need to split this up if you have multiple conditions.', 10), + ('disability', 'Are there any barriers which are impacting on your ability to perform in your job?', 11), + ('What support or understanding do you need from us?', 'Share the information about your work needs that would be helpful for your colleagues.', 12), + ('employer_Support', 'What do you need to thrive in your role here at Islington? There is space in the next section to outline specific workplace adjustments.', 13), + ('personal_Introduction', 'Is there anything you think would be helpful for your colleagues to know? How should this be shared?', 14); \ No newline at end of file diff --git a/supabase/test_data_seed.sql b/supabase/test_data_seed.sql new file mode 100644 index 0000000..afbf24f --- /dev/null +++ b/supabase/test_data_seed.sql @@ -0,0 +1,599 @@ +-- Test data seed file +-- This file contains fake data for testing purposes +-- Run this after the main seed.sql to populate with test data + +-- Create fake users in auth.users (for local testing only) +-- Note: These UUIDs should match what you'll use in profiles +INSERT INTO auth.users ( + instance_id, + id, + aud, + role, + email, + encrypted_password, + email_confirmed_at, + created_at, + updated_at, + confirmation_token, + email_change, + email_change_token_new, + recovery_token +) VALUES ( + '00000000-0000-0000-0000-000000000000', + '550e8400-e29b-41d4-a716-446655440001'::uuid, + 'authenticated', + 'authenticated', + 'alex.thompson@example.com', + '$2a$10$7Z1234567890abcdefghijklmnopqrstuvwxyz', + NOW(), + NOW(), + NOW(), + '', + '', + '', + '' +), ( + '00000000-0000-0000-0000-000000000000', + '550e8400-e29b-41d4-a716-446655440002'::uuid, + 'authenticated', + 'authenticated', + 'jordan.martinez@example.com', + '$2a$10$7Z1234567890abcdefghijklmnopqrstuvwxyz', + NOW(), + NOW(), + NOW(), + '', + '', + '', + '' +), ( + '00000000-0000-0000-0000-000000000000', + '550e8400-e29b-41d4-a716-446655440003'::uuid, + 'authenticated', + 'authenticated', + 'sam.chen@example.com', + '$2a$10$7Z1234567890abcdefghijklmnopqrstuvwxyz', + NOW(), + NOW(), + NOW(), + '', + '', + '', + '' +), ( + '00000000-0000-0000-0000-000000000000', + '550e8400-e29b-41d4-a716-446655440004'::uuid, + 'authenticated', + 'authenticated', + 'priya.patel@example.com', + '$2a$10$7Z1234567890abcdefghijklmnopqrstuvwxyz', + NOW(), + NOW(), + NOW(), + '', + '', + '', + '' +), ( + '00000000-0000-0000-0000-000000000000', + '550e8400-e29b-41d4-a716-446655440005'::uuid, + 'authenticated', + 'authenticated', + 'taylor.adams@example.com', + '$2a$10$7Z1234567890abcdefghijklmnopqrstuvwxyz', + NOW(), + NOW(), + NOW(), + '', + '', + '', + '' +); + +-- Insert fake profiles +INSERT INTO profiles (id, user_id, name, pronouns, job_title, employer_name, line_manager_name, line_manager_email) VALUES + ('550e8400-e29b-41d4-a716-446655440001'::uuid, '550e8400-e29b-41d4-a716-446655440001'::uuid, 'Alex Thompson', 'they/them', 'Software Developer', 'TechCorp Ltd', 'Sarah Wilson', 'sarah.wilson@techcorp.com'), + ('550e8400-e29b-41d4-a716-446655440002'::uuid, '550e8400-e29b-41d4-a716-446655440002'::uuid, 'Jordan Martinez', 'she/her', 'UX Designer', 'Creative Agency', 'Mike Johnson', 'mike.johnson@creative.com'), + ('550e8400-e29b-41d4-a716-446655440003'::uuid, '550e8400-e29b-41d4-a716-446655440003'::uuid, 'Sam Chen', 'he/him', 'Data Analyst', 'DataFlow Inc', 'Lisa Brown', 'lisa.brown@dataflow.com'), + ('550e8400-e29b-41d4-a716-446655440004'::uuid, '550e8400-e29b-41d4-a716-446655440004'::uuid, 'Priya Patel', 'she/her', 'Product Manager', 'InnovateCorp', 'David Kim', 'david.kim@innovatecorp.com'), + ('550e8400-e29b-41d4-a716-446655440005'::uuid, '550e8400-e29b-41d4-a716-446655440005'::uuid, 'Taylor Adams', 'he/him', 'Marketing Specialist', 'BrandWorks', 'Emma Rodriguez', 'emma.rodriguez@brandworks.com'); + +-- Insert comprehensive fake responses using actual question IDs from the questions table + +-- =========================================== +-- ALEX THOMPSON - Software Developer (ADHD) +-- =========================================== + +-- Wellbeing responses (has multiple versions for some questions) +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest, created_at) +SELECT + '660e8400-e29b-41d4-a716-446655440001'::uuid, + '550e8400-e29b-41d4-a716-446655440001'::uuid, + q.id, + 'I have ADHD which can affect my concentration, especially in open office environments. I work best with noise-cancelling headphones and scheduled breaks.', + 'answered', + 'public', + 1, + false, + NOW() - INTERVAL '2 months' +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 1; + +-- Updated version of the same question +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest, created_at) +SELECT + '660e8400-e29b-41d4-a716-446655440001b'::uuid, + '550e8400-e29b-41d4-a716-446655440001'::uuid, + q.id, + 'I have ADHD which significantly impacts my concentration and executive function. Open office environments are particularly challenging due to auditory processing sensitivity. I work most effectively with noise-cancelling headphones, scheduled breaks every 90 minutes, and advance notice of any changes to my routine.', + 'answered', + 'public', + 2, + true, + NOW() - INTERVAL '2 weeks' +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 1; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440002'::uuid, + '550e8400-e29b-41d4-a716-446655440001'::uuid, + q.id, + 'On good days, I''m energetic, creative, and able to hyperfocus on tasks. I communicate clearly and enjoy collaborating with the team. I''m most productive in the morning and can tackle complex problems efficiently.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 2; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440003'::uuid, + '550e8400-e29b-41d4-a716-446655440001'::uuid, + q.id, + 'On difficult days, I struggle with focus and can become easily overwhelmed by interruptions or unexpected changes. I may appear restless or fidgety, have difficulty sitting through long meetings, and need more time to process verbal instructions.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 3; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440004'::uuid, + '550e8400-e29b-41d4-a716-446655440001'::uuid, + q.id, + 'Early warning signs include increased fidgeting, difficulty completing tasks, procrastination on important work, and appearing scattered in conversations. When you notice these signs, please: give me written instructions rather than verbal ones, allow me to take short breaks, and avoid scheduling back-to-back meetings.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 4; + +-- Parental responsibilities +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440010'::uuid, + '550e8400-e29b-41d4-a716-446655440001'::uuid, + q.id, + 'I care for my elderly parent who has mobility issues and dementia. Sometimes I need to leave early for medical appointments or handle urgent care situations.', + 'answered', + 'private', + 1, + true +FROM questions q WHERE q.category = 'parental' AND q."order" = 6; + +-- Support needs +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440012'::uuid, + '550e8400-e29b-41d4-a716-446655440001'::uuid, + q.id, + 'I need clear written instructions, regular check-ins to ensure I''m on track, and the flexibility to work in quieter spaces when needed. I also benefit from agenda items being shared in advance for meetings.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'employer_Support' AND q."order" = 13; + +-- =========================================== +-- JORDAN MARTINEZ - UX Designer (Anxiety + Chronic Fatigue) +-- =========================================== + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440020'::uuid, + '550e8400-e29b-41d4-a716-446655440002'::uuid, + q.id, + 'I have generalized anxiety disorder and chronic fatigue syndrome. Unexpected changes in deadlines or project scope can trigger anxiety episodes, and my energy levels fluctuate significantly throughout the day.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 1; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440021'::uuid, + '550e8400-e29b-41d4-a716-446655440002'::uuid, + q.id, + 'On good days, I''m creative, collaborative, and detail-oriented. I can engage fully in brainstorming sessions and provide thoughtful design feedback. I work well with structured timelines and clear expectations.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 2; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440022'::uuid, + '550e8400-e29b-41d4-a716-446655440002'::uuid, + q.id, + 'On difficult days, I may appear withdrawn, have trouble making decisions, or seem overwhelmed by feedback. Fatigue can make it hard to concentrate during afternoon meetings.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 3; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440023'::uuid, + '550e8400-e29b-41d4-a716-446655440002'::uuid, + q.id, + 'skipped', + 'skipped', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 4; + +-- Disability details +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440024'::uuid, + '550e8400-e29b-41d4-a716-446655440002'::uuid, + q.id, + 'Chronic fatigue syndrome means my energy levels can vary significantly day to day. Some days I can work full capacity, other days I need to pace myself and may be less productive in the afternoon.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'disability' AND q."order" = 10; + +-- Religious needs +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440025'::uuid, + '550e8400-e29b-41d4-a716-446655440002'::uuid, + q.id, + 'I observe Ramadan and will need some flexibility during fasting hours. I may need to step away briefly for prayers during the day.', + 'answered', + 'private', + 1, + true +FROM questions q WHERE q.category = 'religious' AND q."order" = 8; + +-- =========================================== +-- SAM CHEN - Data Analyst (Autism) +-- =========================================== + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440030'::uuid, + '550e8400-e29b-41d4-a716-446655440003'::uuid, + q.id, + 'I am autistic and have sensory processing sensitivities. Bright fluorescent lights and sudden loud noises can be overwhelming. I prefer structured environments and clear expectations.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 1; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440031'::uuid, + '550e8400-e29b-41d4-a716-446655440003'::uuid, + q.id, + 'On good days, I''m detail-oriented and can work through complex datasets methodically. I enjoy problem-solving and finding patterns. I prefer working independently but am happy to collaborate when needed.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 2; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440032'::uuid, + '550e8400-e29b-41d4-a716-446655440003'::uuid, + q.id, + 'skipped', + 'skipped', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 3; + +-- Parental responsibilities +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440033'::uuid, + '550e8400-e29b-41d4-a716-446655440003'::uuid, + q.id, + 'I have two young children (ages 5 and 8) and occasionally need flexibility for school events, parent-teacher conferences, or when they''re sick.', + 'answered', + 'private', + 1, + true +FROM questions q WHERE q.category = 'parental' AND q."order" = 6; + +-- Personal introduction +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440034'::uuid, + '550e8400-e29b-41d4-a716-446655440003'::uuid, + q.id, + 'I communicate best through email or written messages rather than verbal instructions. I appreciate direct, honest feedback and prefer advance notice of changes to projects or meetings.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'personal_Introduction' AND q."order" = 14; + +-- =========================================== +-- PRIYA PATEL - Product Manager (Depression + Diabetes) +-- =========================================== + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440040'::uuid, + '550e8400-e29b-41d4-a716-446655440004'::uuid, + q.id, + 'I manage depression and Type 1 diabetes. Both conditions can affect my energy levels and require ongoing management throughout the day.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 1; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440041'::uuid, + '550e8400-e29b-41d4-a716-446655440004'::uuid, + q.id, + 'On good days, I''m strategic, organized, and great at facilitating team discussions. I can balance multiple projects effectively and provide clear direction to development teams.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 2; + +-- Updated version of good days response +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest, created_at) +SELECT + '660e8400-e29b-41d4-a716-446655440041b'::uuid, + '550e8400-e29b-41d4-a716-446655440004'::uuid, + q.id, + 'On good days, I''m strategic, organized, and excellent at facilitating team discussions. I can balance multiple projects effectively, provide clear direction to development teams, and I''m particularly good at stakeholder management and roadmap planning.', + 'answered', + 'public', + 2, + false, + NOW() - INTERVAL '1 week' +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 2; + +-- Latest version +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440041c'::uuid, + '550e8400-e29b-41d4-a716-446655440004'::uuid, + q.id, + 'On good days, I''m strategic, organized, and excellent at facilitating team discussions and stakeholder meetings. I can balance multiple projects effectively, provide clear direction to development teams, and excel at roadmap planning. I''m energetic and collaborative, often helping to solve cross-team challenges.', + 'answered', + 'public', + 3, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 2; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440042'::uuid, + '550e8400-e29b-41d4-a716-446655440004'::uuid, + q.id, + 'On difficult days, I may need to step away to manage my blood sugar levels or may have lower energy due to depression. I try not to let it show, but I might be less talkative or need more time to make decisions.', + 'answered', + 'private', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 3; + +-- Disability barriers +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440043'::uuid, + '550e8400-e29b-41d4-a716-446655440004'::uuid, + q.id, + 'I need to monitor my blood sugar regularly and sometimes need to eat during meetings or step away briefly. Long meetings without breaks can be challenging.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'disability' AND q."order" = 11; + +-- =========================================== +-- TAYLOR ADAMS - Marketing Specialist (Dyslexia) +-- =========================================== + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440050'::uuid, + '550e8400-e29b-41d4-a716-446655440005'::uuid, + q.id, + 'I have dyslexia which affects my reading speed and written communication. I''m more comfortable with verbal communication and visual presentations.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 1; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440051'::uuid, + '550e8400-e29b-41d4-a716-446655440005'::uuid, + q.id, + 'On good days, I''m creative, enthusiastic, and great at brainstorming and presenting ideas. I excel at visual thinking and can come up with innovative marketing campaigns.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 2; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440052'::uuid, + '550e8400-e29b-41d4-a716-446655440005'::uuid, + q.id, + 'skipped', + 'skipped', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 3; + +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440053'::uuid, + '550e8400-e29b-41d4-a716-446655440005'::uuid, + q.id, + 'skipped', + 'skipped', + 'public', + 1, + true +FROM questions q WHERE q.category = 'wellbeing' AND q."order" = 4; + +-- Support needs +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440054'::uuid, + '550e8400-e29b-41d4-a716-446655440005'::uuid, + q.id, + 'I work well when I can present ideas verbally rather than in lengthy written reports. I benefit from spell-check tools and prefer collaborative editing for important documents.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'employer_Support' AND q."order" = 13; + +-- Colleague information +INSERT INTO responses (id, user_id, question_id, response_text, status, visibility, version, is_latest) +SELECT + '660e8400-e29b-41d4-a716-446655440055'::uuid, + '550e8400-e29b-41d4-a716-446655440005'::uuid, + q.id, + 'I''m a visual thinker and often prefer to explain ideas through sketches or diagrams rather than written documents. I''m always happy to discuss ideas verbally and brainstorm collaboratively.', + 'answered', + 'public', + 1, + true +FROM questions q WHERE q.category = 'personal_Introduction' AND q."order" = 14; + +-- Insert comprehensive fake actions linked to responses + +-- Actions for Alex Thompson (ADHD accommodations) +INSERT INTO actions (id, user_id, response_id, type, description, version, is_latest) VALUES + ('770e8400-e29b-41d4-a716-446655440001'::uuid, '550e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440001b'::uuid, 'workplace_adjustment', 'Provide noise-cancelling headphones and assign desk in quieter area of office', 1, true), + ('770e8400-e29b-41d4-a716-446655440002'::uuid, '550e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440001b'::uuid, 'schedule_adjustment', 'Allow 15-minute breaks every 90 minutes to help with focus', 1, true), + ('770e8400-e29b-41d4-a716-446655440003'::uuid, '550e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440004'::uuid, 'communication', 'Provide written instructions and meeting agendas in advance', 1, true), + ('770e8400-e29b-41d4-a716-446655440004'::uuid, '550e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440010'::uuid, 'schedule_flexibility', 'Flexible hours for parent care responsibilities and medical appointments', 1, true); + +-- Actions for Jordan Martinez (Anxiety + Chronic Fatigue) +INSERT INTO actions (id, user_id, response_id, type, description, version, is_latest, created_at) VALUES + ('770e8400-e29b-41d4-a716-446655440010'::uuid, '550e8400-e29b-41d4-a716-446655440002'::uuid, '660e8400-e29b-41d4-a716-446655440020'::uuid, 'communication', 'Provide 48-hour advance notice for any project changes when possible', 1, false, NOW() - INTERVAL '3 weeks'), + ('770e8400-e29b-41d4-a716-446655440010b'::uuid, '550e8400-e29b-41d4-a716-446655440002'::uuid, '660e8400-e29b-41d4-a716-446655440020'::uuid, 'communication', 'Provide 48-hour advance notice for project changes and avoid scheduling back-to-back meetings', 2, true, NOW() - INTERVAL '1 week'), + ('770e8400-e29b-41d4-a716-446655440011'::uuid, '550e8400-e29b-41d4-a716-446655440002'::uuid, '660e8400-e29b-41d4-a716-446655440024'::uuid, 'workload_management', 'Flexible working hours and option to work from home on low-energy days', 1, true), + ('770e8400-e29b-41d4-a716-446655440012'::uuid, '550e8400-e29b-41d4-a716-446655440002'::uuid, '660e8400-e29b-41d4-a716-446655440025'::uuid, 'religious_accommodation', 'Flexible prayer times during Ramadan and consideration for fasting schedules', 1, true); + +-- Actions for Sam Chen (Autism accommodations) +INSERT INTO actions (id, user_id, response_id, type, description, version, is_latest) VALUES + ('770e8400-e29b-41d4-a716-446655440020'::uuid, '550e8400-e29b-41d4-a716-446655440003'::uuid, '660e8400-e29b-41d4-a716-446655440030'::uuid, 'workplace_adjustment', 'Provide desk lamp to reduce fluorescent lighting and minimize sudden noise interruptions', 1, true), + ('770e8400-e29b-41d4-a716-446655440021'::uuid, '550e8400-e29b-41d4-a716-446655440003'::uuid, '660e8400-e29b-41d4-a716-446655440034'::uuid, 'communication', 'Prefer email communication over verbal instructions for important tasks', 1, true), + ('770e8400-e29b-41d4-a716-446655440022'::uuid, '550e8400-e29b-41d4-a716-446655440003'::uuid, '660e8400-e29b-41d4-a716-446655440033'::uuid, 'schedule_flexibility', 'Flexible hours for child-related responsibilities', 1, true); + +-- Actions for Priya Patel (Diabetes + Depression accommodations) +INSERT INTO actions (id, user_id, response_id, type, description, version, is_latest) VALUES + ('770e8400-e29b-41d4-a716-446655440030'::uuid, '550e8400-e29b-41d4-a716-446655440004'::uuid, '660e8400-e29b-41d4-a716-446655440043'::uuid, 'health_accommodation', 'Allow regular blood sugar monitoring breaks and eating during meetings when needed', 1, true), + ('770e8400-e29b-41d4-a716-446655440031'::uuid, '550e8400-e29b-41d4-a716-446655440004'::uuid, '660e8400-e29b-41d4-a716-446655440043'::uuid, 'schedule_adjustment', 'Ensure meeting breaks every 90 minutes for health management', 1, true); + +-- Actions for Taylor Adams (Dyslexia accommodations) +INSERT INTO actions (id, user_id, response_id, type, description, version, is_latest) VALUES + ('770e8400-e29b-41d4-a716-446655440040'::uuid, '550e8400-e29b-41d4-a716-446655440005'::uuid, '660e8400-e29b-41d4-a716-446655440054'::uuid, 'workplace_adjustment', 'Provide access to advanced spell-check tools and collaborative editing software', 1, true), + ('770e8400-e29b-41d4-a716-446655440041'::uuid, '550e8400-e29b-41d4-a716-446655440005'::uuid, '660e8400-e29b-41d4-a716-446655440055'::uuid, 'communication', 'Encourage verbal presentations and visual aids over lengthy written reports', 1, true); + +-- Insert comprehensive fake sharing events +INSERT INTO sharing_events (id, user_id, recipient_email, message, shared_at) VALUES + ('880e8400-e29b-41d4-a716-446655440001'::uuid, '550e8400-e29b-41d4-a716-446655440001'::uuid, 'sarah.wilson@techcorp.com', 'Hi Sarah, I wanted to share my workplace passport with you so you can better understand my needs and how to support me in my role. This includes my ADHD accommodations and care responsibilities.', NOW() - INTERVAL '2 weeks'), + ('880e8400-e29b-41d4-a716-446655440002'::uuid, '550e8400-e29b-41d4-a716-446655440002'::uuid, 'mike.johnson@creative.com', 'Hi Mike, here is my workplace passport with information about my needs and how we can work together effectively. Please note my energy levels vary due to chronic fatigue.', NOW() - INTERVAL '1 month'), + ('880e8400-e29b-41d4-a716-446655440003'::uuid, '550e8400-e29b-41d4-a716-446655440003'::uuid, 'lisa.brown@dataflow.com', 'Hi Lisa, I''m sharing my workplace passport to help you understand my communication preferences and work style as an autistic person.', NOW() - INTERVAL '3 weeks'), + ('880e8400-e29b-41d4-a716-446655440004'::uuid, '550e8400-e29b-41d4-a716-446655440004'::uuid, 'david.kim@innovatecorp.com', 'Hi David, please find my workplace passport attached. It includes information about my diabetes management needs and some personal accommodation requests.', NOW() - INTERVAL '1 week'), + ('880e8400-e29b-41d4-a716-446655440005'::uuid, '550e8400-e29b-41d4-a716-446655440005'::uuid, 'emma.rodriguez@brandworks.com', 'Hi Emma, I''m sharing my workplace passport to help you understand how my dyslexia affects my work and what support helps me be most effective.', NOW() - INTERVAL '5 days'); + +-- Link responses to sharing events (multiple responses per sharing event) + +-- Alex Thompson sharing (ADHD + wellbeing + parental) +INSERT INTO sharing_event_responses (sharing_event_id, response_id) VALUES + ('880e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440001b'::uuid), -- Latest wellbeing response + ('880e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440002'::uuid), -- Good days + ('880e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440003'::uuid), -- Bad days + ('880e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440012'::uuid); -- Support needs + +-- Jordan Martinez sharing (Anxiety + Chronic Fatigue + Religious) +INSERT INTO sharing_event_responses (sharing_event_id, response_id) VALUES + ('880e8400-e29b-41d4-a716-446655440002'::uuid, '660e8400-e29b-41d4-a716-446655440020'::uuid), -- Wellbeing + ('880e8400-e29b-41d4-a716-446655440002'::uuid, '660e8400-e29b-41d4-a716-446655440021'::uuid), -- Good days + ('880e8400-e29b-41d4-a716-446655440002'::uuid, '660e8400-e29b-41d4-a716-446655440024'::uuid); -- Disability + +-- Sam Chen sharing (Autism + Communication) +INSERT INTO sharing_event_responses (sharing_event_id, response_id) VALUES + ('880e8400-e29b-41d4-a716-446655440003'::uuid, '660e8400-e29b-41d4-a716-446655440030'::uuid), -- Wellbeing + ('880e8400-e29b-41d4-a716-446655440003'::uuid, '660e8400-e29b-41d4-a716-446655440031'::uuid), -- Good days + ('880e8400-e29b-41d4-a716-446655440003'::uuid, '660e8400-e29b-41d4-a716-446655440034'::uuid); -- Personal intro + +-- Priya Patel sharing (Depression + Diabetes) +INSERT INTO sharing_event_responses (sharing_event_id, response_id) VALUES + ('880e8400-e29b-41d4-a716-446655440004'::uuid, '660e8400-e29b-41d4-a716-446655440040'::uuid), -- Wellbeing + ('880e8400-e29b-41d4-a716-446655440004'::uuid, '660e8400-e29b-41d4-a716-446655440041c'::uuid), -- Latest good days + ('880e8400-e29b-41d4-a716-446655440004'::uuid, '660e8400-e29b-41d4-a716-446655440043'::uuid); -- Disability barriers + +-- Taylor Adams sharing (Dyslexia + Communication preferences) +INSERT INTO sharing_event_responses (sharing_event_id, response_id) VALUES + ('880e8400-e29b-41d4-a716-446655440005'::uuid, '660e8400-e29b-41d4-a716-446655440050'::uuid), -- Wellbeing + ('880e8400-e29b-41d4-a716-446655440005'::uuid, '660e8400-e29b-41d4-a716-446655440051'::uuid), -- Good days + ('880e8400-e29b-41d4-a716-446655440005'::uuid, '660e8400-e29b-41d4-a716-446655440054'::uuid), -- Support needs + ('880e8400-e29b-41d4-a716-446655440005'::uuid, '660e8400-e29b-41d4-a716-446655440055'::uuid); -- Personal intro + +-- Link actions to sharing events + +-- Alex Thompson actions shared +INSERT INTO sharing_event_actions (sharing_event_id, action_id) VALUES + ('880e8400-e29b-41d4-a716-446655440001'::uuid, '770e8400-e29b-41d4-a716-446655440001'::uuid), -- Noise-cancelling headphones + ('880e8400-e29b-41d4-a716-446655440001'::uuid, '770e8400-e29b-41d4-a716-446655440002'::uuid), -- Break schedule + ('880e8400-e29b-41d4-a716-446655440001'::uuid, '770e8400-e29b-41d4-a716-446655440003'::uuid); -- Written instructions + +-- Jordan Martinez actions shared +INSERT INTO sharing_event_actions (sharing_event_id, action_id) VALUES + ('880e8400-e29b-41d4-a716-446655440002'::uuid, '770e8400-e29b-41d4-a716-446655440010b'::uuid), -- Latest communication action + ('880e8400-e29b-41d4-a716-446655440002'::uuid, '770e8400-e29b-41d4-a716-446655440011'::uuid); -- Flexible hours + +-- Sam Chen actions shared +INSERT INTO sharing_event_actions (sharing_event_id, action_id) VALUES + ('880e8400-e29b-41d4-a716-446655440003'::uuid, '770e8400-e29b-41d4-a716-446655440020'::uuid), -- Lighting adjustment + ('880e8400-e29b-41d4-a716-446655440003'::uuid, '770e8400-e29b-41d4-a716-446655440021'::uuid); -- Email communication + +-- Priya Patel actions shared +INSERT INTO sharing_event_actions (sharing_event_id, action_id) VALUES + ('880e8400-e29b-41d4-a716-446655440004'::uuid, '770e8400-e29b-41d4-a716-446655440030'::uuid), -- Health breaks + ('880e8400-e29b-41d4-a716-446655440004'::uuid, '770e8400-e29b-41d4-a716-446655440031'::uuid); -- Meeting breaks + +-- Taylor Adams actions shared +INSERT INTO sharing_event_actions (sharing_event_id, action_id) VALUES + ('880e8400-e29b-41d4-a716-446655440005'::uuid, '770e8400-e29b-41d4-a716-446655440040'::uuid), -- Spell-check tools + ('880e8400-e29b-41d4-a716-446655440005'::uuid, '770e8400-e29b-41d4-a716-446655440041'::uuid); -- Verbal presentations \ No newline at end of file From 658fcdaba389254edf1b31f231c8ac1f5027425f Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 2 Jun 2025 11:43:06 +0100 Subject: [PATCH 4/5] doc: updated readme file to make explicit when the Supabase Docker container gets downloaded --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2183b98..23cda48 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Before starting development, ensure you have the following installed: ``` **First time setup notes**: - - This will download several Docker images (~2-3GB total) + - If Supabase Docker containers are not already downloaded, this command will automatically download them (~2-3GB total) - The download may take 5-15 minutes depending on your internet connection - Docker Desktop must be running before executing this command - All database migrations will be automatically applied From a3240ab9ff554e389b59969d2e75212446458c93 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 2 Jun 2025 11:51:46 +0100 Subject: [PATCH 5/5] commited config.toml --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index d6a5902..9554e26 100644 --- a/.gitignore +++ b/.gitignore @@ -72,7 +72,6 @@ lerna-debug.log* .cache # Supabase -/supabase/config.toml /supabase/*.env /supabase/dev.env /supabase/prod.env