A digital workplace passport application that helps neurodivergent employees document and share their workplace needs with line managers, promoting a more inclusive workplace environment.
- Frontend: Svelte 5 + SvelteKit
- Styling: TailwindCSS
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Magic Link
- Testing: Vitest + @testing-library/svelte
Before starting development, ensure you have the following installed:
-
Node.js (v18 or higher)
# Check your version node --version
Download from nodejs.org if needed.
-
Docker Desktop
- macOS: Download from Docker Desktop for Mac
- Windows: Download from Docker Desktop for Windows
- Linux: Follow Docker Engine installation for your distribution
# Verify Docker is running docker --version docker ps
-
Git
# Check if installed git --version
-
PostgreSQL Client (Required for Linux, particularly Ubuntu)
# 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.
-
Clone the repository:
git clone https://github.com/foundersandcoders/LIFT02.git cd LIFT02
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env.local
Note: The
.env.example
already contains the correct local development keys that Supabase always uses. -
Install Supabase CLI:
# Using npm npm install supabase --save-dev # Using Homebrew (macOS) brew install supabase/tap/supabase
For other installation options, see the Supabase CLI docs.
-
Start local Supabase instance:
supabase start
First time setup notes:
- 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
-
Verify setup:
# Start the development server npm run dev # In another terminal, check Supabase Studio open http://127.0.0.1:54323
Your local Supabase instance runs entirely in Docker containers. The database schema is automatically applied from the migrations when you start the instance.
# Start the local Supabase stack
supabase start
# Check status and get connection details
supabase status
# Reset local database (clears data and re-applies migrations + questions seed)
supabase db reset
# Stop the local instance
supabase stop
The project uses a two-tier seeding strategy to separate real data from test 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
- 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
After resetting your database, add test data for development:
# 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
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
When ready to deploy schema changes to production:
# Push local schema changes to production Supabase project
supabase db push
If you need test data in your production environment (e.g., for demos or testing):
-
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
-
Run the seeding script:
# 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
Generate TypeScript types from your local database schema:
supabase gen types typescript --local > src/lib/types/supabase.ts
When running locally, you can access:
- API:
http://127.0.0.1:54321
- Database:
postgresql://postgres:[email protected]:54322/postgres
- Studio:
http://127.0.0.1:54323
- Email Testing (Inbucket):
http://127.0.0.1:54324
-
"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
-
Port conflicts (ports 54321-54327 already in use)
# 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
-
Migration errors or missing tables
# Reset and reapply all migrations supabase db reset
-
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
- Use URL:
-
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
-
First time setup prompts
- When running
supabase start
for the first time, you may be prompted to runsupabase 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
- When running
-
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:
# 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:
# 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:
# 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:
- Remove existing containers:
supabase stop && docker system prune -a
- Set the default platform before starting:
export DOCKER_DEFAULT_PLATFORM=linux/[your-arch]
- Restart Supabase:
supabase start
- If you see errors like
If you encounter issues not covered here:
- Check
supabase status
for service health - Check
docker ps
to see running containers - Check the Supabase CLI docs
Start the development server:
npm run dev
# or open in a new browser tab
npm run dev -- --open
Run tests with Vitest:
# Run all tests
npm run test
# Run tests in watch mode
npm run test:unit
# Run with coverage
npm run test -- --coverage
# Format code
npm run format
# Lint code
npm run lint
# Type checking
npm run check
npm run build
Preview the production build:
npm run preview
The project follows a standard SvelteKit structure:
/src
- Application source code/routes
- SvelteKit routes (pages)/lib
- Shared components, utilities, and services
/static
- Static assets
- FUNCTIONAL.md - Functional requirements
- ARCHITECTURE.md - Technical architecture
- TESTING.md - Testing guide