Complete guide to creating your own project from the ScriptHammer template.
# 1. Fork and clone
gh repo fork TortoiseWolfe/ScriptHammer --clone
cd YourProjectName
# 2. Run the rebrand script
./scripts/rebrand.sh MyProject myusername "My awesome project description"
# 3. Create environment file
cp .env.example .env
# Edit .env - set UID and GID (run: id -u && id -g)
# 4. Start Docker
docker compose up -d
# 5. Verify build
docker compose exec myproject pnpm run build
# 6. Run tests
docker compose exec myproject pnpm test
# 7. Commit and push
docker compose exec myproject git add -A
docker compose exec myproject git commit -m "Rebrand to MyProject"
git pushThe scripts/rebrand.sh script automates updating 200+ files:
| Category | Changes |
|---|---|
| Code | Replaces "ScriptHammer" with your project name in all TypeScript, JavaScript, JSON, and Markdown files |
| Files | Renames files containing "ScriptHammer" (e.g., ScriptHammerLogo.tsx → MyProjectLogo.tsx) |
| Docker | Updates service name in docker-compose.yml |
| Git | Updates remote origin URL to your repository |
| Config | Updates package.json name, description, and repository fields |
| Themes | Renames scripthammer-dark/scripthammer-light theme blocks to your project name |
| Env | Updates COMPOSE_PROJECT_NAME and example commands in .env.example |
| CNAME | Updates public/CNAME to your project domain (unless custom domain detected or --keep-cname) |
# Preview changes (no modifications)
./scripts/rebrand.sh MyProject myuser "Description" --dry-run
# Skip all prompts
./scripts/rebrand.sh MyProject myuser "Description" --force
# Keep CNAME file
./scripts/rebrand.sh MyProject myuser "Description" --keep-cname
# Preserve SSH format for git remote (if your origin is SSH)
./scripts/rebrand.sh MyProject myuser "Description" --preserve-ssh
# Keep ScriptHammer attribution link in Footer component
./scripts/rebrand.sh MyProject myuser "Description" --preserve-attribution
# Combine options
./scripts/rebrand.sh MyProject myuser "Description" --dry-run --preserve-ssh --preserve-attribution| Option | Description |
|---|---|
--dry-run |
Preview changes without modifying files |
--force |
Skip all confirmation prompts |
--keep-cname |
Don't update public/CNAME file (keep existing domain) |
--preserve-ssh |
Keep SSH format (git@github.com:) if currently using SSH |
--preserve-attribution |
Skip Footer.tsx to keep ScriptHammer attribution link |
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Invalid arguments |
| 2 | User declined re-rebrand |
| 3 | Git error |
The rebrand script renames the ScriptHammer theme blocks to your project name but keeps the same colors. To customize:
- Edit
src/app/globals.css— change the oklch color values in the@plugin "daisyui/theme"blocks - Run Storybook to preview:
docker compose exec <project> pnpm run storybook - Use the theme switcher in the Storybook toolbar to verify both dark and light variants
See CUSTOM-THEME.md for the full guide including color format, WCAG contrast requirements, and all files that reference the theme.
- Go to your repository Settings → Pages
- Under "Build and deployment", select GitHub Actions as source
- Push to
mainbranch to trigger deployment
Add these secrets in Settings → Secrets and variables → Actions → Repository secrets:
These are required for the build and deployment workflows to succeed:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
These enable full E2E test coverage:
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
TEST_USER_PRIMARY_EMAIL=yourname+test-a@gmail.com
TEST_USER_PRIMARY_PASSWORD=TestPassword123!
TEST_USER_SECONDARY_EMAIL=yourname+test-b@gmail.com
TEST_USER_SECONDARY_PASSWORD=TestPassword456!
TEST_USER_TERTIARY_EMAIL=yourname+test-c@gmail.com
TEST_USER_TERTIARY_PASSWORD=TestPassword789!
TEST_EMAIL_DOMAIN=yourname+e2e@gmail.com
Important: Email Domain Requirements
Supabase Auth validates that email domains have valid MX (mail exchange) records.
@example.comis a reserved domain and will always be blocked.Use Gmail plus aliases instead:
yourname+test@gmail.comThe plus alias format allows unlimited unique emails that all arrive at your inbox but Supabase treats each as a separate user.
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
NEXT_PUBLIC_AUTHOR_NAME=Your Name
NEXT_PUBLIC_AUTHOR_EMAIL=your@email.com
NEXT_PUBLIC_PAGESPEED_API_KEY=your-google-api-key
See README.md for the complete prioritized list of secrets.
The deployment automatically detects your repository name and sets the correct basePath for GitHub Pages. No NEXT_PUBLIC_BASE_PATH secret is required.
- Go to supabase.com and create a new project
- Copy your project URL and anon key from Settings → API
# .env
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...The project uses a monolithic migration file. To set up your database:
- Go to Supabase Dashboard → SQL Editor
- Copy contents of
supabase/migrations/20251006_complete_monolithic_setup.sql - Run the SQL
Add the same values as GitHub repository secrets for deployment.
Git commits from inside the Docker container are fully supported:
# Set your git identity (add to .env)
GIT_AUTHOR_NAME=Your Name
GIT_AUTHOR_EMAIL=your@email.com
# Then commit from container
docker compose exec myproject git add -A
docker compose exec myproject git commit -m "Your commit message"
git push # Push from host (SSH keys on host)After forking, verify everything works:
-
docker compose upstarts without errors -
docker compose exec <project> pnpm test— all tests pass -
docker compose exec <project> pnpm run build— build succeeds - No "ScriptHammer" references in
package.json -
git remote -vshows your repository URL -
.envhasCOMPOSE_PROJECT_NAME=<yourproject>(notscripthammer) -
public/CNAMEcontains your domain (or is absent if no custom domain) -
docker compose psshows your project name in container names - GitHub Pages deployment succeeds (if enabled)
- Site loads at
https://username.github.io/project-name/
The SH_* port environment variables (SH_PORT, SH_STORYBOOK_PORT, etc.) are inherited from the template and work as-is. They control host port bindings in docker-compose.yml. You can customize them in .env if you need fixed ports, but the defaults (ephemeral assignment) prevent collisions automatically.
Unit tests should pass without Supabase environment variables thanks to comprehensive mocks in tests/setup.ts. If tests fail:
- Ensure you have the latest version of the template
- Check that no test is directly importing from
@supabase/supabase-js
Supabase Auth validates email domains have MX records. Common causes:
- Using
@example.com: This reserved domain is always blocked - Missing TEST_EMAIL_DOMAIN: Set this env var to use Gmail plus aliases
Fix: Use Gmail plus alias format in your .env:
TEST_EMAIL_DOMAIN=yourname+e2e@gmail.com
TEST_USER_PRIMARY_EMAIL=yourname+test-a@gmail.comThe session-persistence.spec.ts test previously created users in beforeEach instead of beforeAll, causing rate limits. This is fixed in the template but if you see rate limit errors:
- Check that
beforeAllis used for user creation (notbeforeEach) - Use unique email prefixes via
generateTestEmail('unique-prefix')
- Run
docker compose down && docker compose up --buildto rebuild - Check for any remaining "ScriptHammer" references:
grep -r "ScriptHammer" src/ - Ensure all import paths are correct after file renames
- Verify GitHub Pages is enabled with "GitHub Actions" source
- Check Actions tab for deployment errors
- Wait a few minutes after deployment completes
- Clear browser cache
Always use Docker commands, never sudo:
# Wrong
sudo rm -rf node_modules
# Correct
docker compose exec <project> rm -rf node_modulesKeep your fork updated with improvements from ScriptHammer:
# Add ScriptHammer as upstream remote
git remote add upstream https://github.com/TortoiseWolfe/ScriptHammer.git
# Verify remotes
git remote -v
# origin https://github.com/YOU/YOUR-PROJECT.git (fetch)
# upstream https://github.com/TortoiseWolfe/ScriptHammer.git (fetch)# Fetch upstream changes
git fetch upstream
# Merge upstream into your main branch
git checkout main
git merge upstream/main
# Resolve any conflicts, then push
git push origin mainIf you only want specific fixes:
# View upstream commits
git log upstream/main --oneline -20
# Cherry-pick specific commits
git cherry-pick <commit-hash>- Rebuild Docker:
docker compose down && docker compose up --build - Run tests:
docker compose exec <project> pnpm test - Check for new environment variables in
.env.example
See FORKING-FEEDBACK.md for a changelog of fixes you can apply manually.
- GitHub Issues: ScriptHammer Issues
- Documentation: CLAUDE.md for comprehensive development guide