diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 0a57d8d..952f2ba 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -12,7 +12,10 @@ "Bash(git restore:*)", "Bash(supabase status:*)", "Bash(supabase stop:*)", - "Bash(supabase start:*)" + "Bash(supabase start:*)", + "Bash(grep:*)", + "Bash(sed:*)", + "Bash(find:*)" ], "deny": [] }, diff --git a/README.md b/README.md index 23cda48..1f60098 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,19 @@ Before starting development, ensure you have the following installed: git --version ``` +4. **PostgreSQL Client** (Required for Linux, particularly Ubuntu) + ```bash + # Check if installed + psql --version + + # If not installed (Ubuntu/Debian) + sudo apt-get update && sudo apt-get install postgresql-client + + # If not installed (Fedora/RHEL) + sudo dnf install postgresql + ``` + This is needed for the seed scripts to work correctly with Supabase. + ## Development Setup 1. Clone the repository: @@ -247,6 +260,44 @@ When running locally, you can access: - Consider running setup during good internet connectivity - Images are cached after first download +6. **First time setup prompts** + - When running `supabase start` for the first time, you may be prompted to run `supabase init` first + - Run `supabase init` as instructed + - When prompted if you want to set up Edge Functions with Deno, answer "No" + - After initialization is complete, run `supabase start` again + +7. **Docker Architecture Mismatch** + - If you see errors like `exec /usr/bin/sh: exec format error`, it means you're trying to run Docker containers built for a different CPU architecture + + **For Apple Silicon (M1/M2) users**: + ```bash + # Force pull ARM64 images + docker pull --platform=linux/arm64 supabase/postgres:15.1.0 + docker pull --platform=linux/arm64 supabase/edge-runtime:v1 + # (add other images as needed) + ``` + + **For Intel/AMD users**: + ```bash + # Force pull AMD64 images + docker pull --platform=linux/amd64 supabase/postgres:15.1.0 + docker pull --platform=linux/amd64 supabase/edge-runtime:v1 + # (add other images as needed) + ``` + + You may need to specify the platform in your Docker configuration: + ```bash + # Example adding platform to supabase start + DOCKER_DEFAULT_PLATFORM=linux/amd64 supabase start # For Intel/AMD + # or + DOCKER_DEFAULT_PLATFORM=linux/arm64 supabase start # For Apple Silicon + ``` + + If you continue having issues, try: + 1. Remove existing containers: `supabase stop && docker system prune -a` + 2. Set the default platform before starting: `export DOCKER_DEFAULT_PLATFORM=linux/[your-arch]` + 3. Restart Supabase: `supabase start` + ### Getting Help If you encounter issues not covered here: diff --git a/supabase/.gitignore b/supabase/.gitignore index 1684c45..e374a75 100644 --- a/supabase/.gitignore +++ b/supabase/.gitignore @@ -18,3 +18,8 @@ prod.env .env.keys .env.local .env.*.local + +# Supabase +.branches +.temp +.env diff --git a/supabase/data/questions.json b/supabase/data/questions.json deleted file mode 100644 index bc8f5ae..0000000 --- a/supabase/data/questions.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "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/test_data_seed.sql b/supabase/test_data_seed.sql index afbf24f..e95104d 100644 --- a/supabase/test_data_seed.sql +++ b/supabase/test_data_seed.sql @@ -121,7 +121,7 @@ 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, + '660e8400-e29b-41d4-a716-446655440003'::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.', @@ -146,7 +146,7 @@ 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, + '660e8400-e29b-41d4-a716-446655440005'::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.', @@ -356,7 +356,7 @@ 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, + '660e8400-e29b-41d4-a716-446655440043'::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.', @@ -369,7 +369,7 @@ 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, + '660e8400-e29b-41d4-a716-446655440041'::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.', @@ -383,7 +383,7 @@ 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, + '660e8400-e29b-41d4-a716-446655440042'::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.', @@ -395,7 +395,7 @@ 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, + '660e8400-e29b-41d4-a716-446655440044'::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.', @@ -408,7 +408,7 @@ 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, + '660e8400-e29b-41d4-a716-446655440045'::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.', @@ -500,33 +500,33 @@ FROM questions q WHERE q.category = 'personal_Introduction' AND q."order" = 14; -- 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-446655440001'::uuid, '550e8400-e29b-41d4-a716-446655440001'::uuid, '660e8400-e29b-41d4-a716-446655440001'::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-446655440001'::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); + ('770e8400-e29b-41d4-a716-446655440013'::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, NOW()), + ('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, NOW()); -- 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); +INSERT INTO actions (id, user_id, response_id, type, description, version, is_latest, created_at) 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, NOW()), + ('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, NOW()), + ('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, NOW()); -- 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); +INSERT INTO actions (id, user_id, response_id, type, description, version, is_latest, created_at) 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, NOW()), + ('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, NOW()); -- 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 INTO actions (id, user_id, response_id, type, description, version, is_latest, created_at) 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, NOW()), + ('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, NOW()); -- Insert comprehensive fake sharing events INSERT INTO sharing_events (id, user_id, recipient_email, message, shared_at) VALUES @@ -540,7 +540,7 @@ INSERT INTO sharing_events (id, user_id, recipient_email, message, shared_at) VA -- 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-446655440003'::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 @@ -560,7 +560,7 @@ INSERT INTO sharing_event_responses (sharing_event_id, response_id) VALUES -- 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-446655440042'::uuid), -- Latest good days ('880e8400-e29b-41d4-a716-446655440004'::uuid, '660e8400-e29b-41d4-a716-446655440043'::uuid); -- Disability barriers -- Taylor Adams sharing (Dyslexia + Communication preferences) @@ -580,7 +580,7 @@ INSERT INTO sharing_event_actions (sharing_event_id, action_id) VALUES -- 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-446655440013'::uuid), -- Latest communication action ('880e8400-e29b-41d4-a716-446655440002'::uuid, '770e8400-e29b-41d4-a716-446655440011'::uuid); -- Flexible hours -- Sam Chen actions shared