diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2e718c..ef6d914 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,20 +105,20 @@ Run the setup script once after cloning. It checks prerequisites, installs depen ```bash # macOS / Linux -./setup.sh +./scripts/setup.sh # Windows -./setup.ps1 +./scripts/setup.ps1 ``` ### Starting all services ```bash # macOS / Linux — starts Postgres, backend, and web in one terminal -./dev.sh +./scripts/dev.sh # Windows — opens three separate PowerShell windows -./dev.ps1 +./scripts/dev.ps1 ``` Or start services individually: diff --git a/Makefile b/Makefile index af8f204..f02aabc 100644 --- a/Makefile +++ b/Makefile @@ -9,18 +9,18 @@ setup: ifeq ($(OS),Windows_NT) - powershell -ExecutionPolicy Bypass -File setup.ps1 + powershell -ExecutionPolicy Bypass -File scripts/setup.ps1 else - bash setup.sh + bash scripts/setup.sh endif # ── Development ──────────────────────────────────────────────────────────────── dev: ifeq ($(OS),Windows_NT) - powershell -ExecutionPolicy Bypass -File dev.ps1 + powershell -ExecutionPolicy Bypass -File scripts/dev.ps1 else - bash dev.sh + bash scripts/dev.sh endif dev-backend: diff --git a/README.md b/README.md index 5079eb1..37c5a20 100644 --- a/README.md +++ b/README.md @@ -68,12 +68,12 @@ git clone https://github.com/your-username/fullstack-template.git cd fullstack-template # First-time setup: installs deps, copies .env.example files, checks prerequisites -./setup.sh # macOS / Linux -.\setup.ps1 # Windows PowerShell +./scripts/setup.sh # macOS / Linux +.\scripts\setup.ps1 # Windows PowerShell # Start all three services (backend + web + mobile hot-reload) in parallel -./dev.sh # macOS / Linux -.\dev.ps1 # Windows PowerShell +./scripts/dev.sh # macOS / Linux +.\scripts\dev.ps1 # Windows PowerShell ``` ### Manual setup @@ -114,8 +114,9 @@ fullstack-template/ ├── TEMPLATE_STATUS.md # Readiness gap tracker ├── docs/ │ └── adr/ # Architecture Decision Records -├── dev.sh / dev.ps1 # Start all services in parallel -├── setup.sh / setup.ps1 # First-run contributor setup +├── scripts/ +│ ├── dev.sh / dev.ps1 # Start all services in parallel +│ └── setup.sh / setup.ps1 # First-run contributor setup ├── renovate.json # Automated dependency updates ├── .claude/ │ ├── agents/ # Specialized Claude subagents diff --git a/dev.ps1 b/scripts/dev.ps1 similarity index 85% rename from dev.ps1 rename to scripts/dev.ps1 index e4620a6..8cb2e3a 100644 --- a/dev.ps1 +++ b/scripts/dev.ps1 @@ -1,8 +1,8 @@ -# dev.ps1 — start all services in separate PowerShell windows (Windows equivalent of dev.sh) -# Usage: .\dev.ps1 +# dev.ps1 — start all services in separate PowerShell windows (Windows equivalent of dev.sh) +# Usage: .\scripts\dev.ps1 # Close each terminal window manually when done. -$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +$ScriptDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Definition) Write-Host "[postgres] Starting Docker Compose (Postgres)..." -ForegroundColor Blue Start-Process powershell -ArgumentList "-NoExit", "-ExecutionPolicy", "Bypass", "-Command", "Set-Location '$ScriptDir\backend'; make docker-run" ` diff --git a/dev.sh b/scripts/dev.sh similarity index 94% rename from dev.sh rename to scripts/dev.sh index 0751ccb..4370fb2 100644 --- a/dev.sh +++ b/scripts/dev.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # dev.sh — start all services in parallel in a single terminal -# Usage: ./dev.sh +# Usage: ./scripts/dev.sh # Press Ctrl+C to stop everything. set -euo pipefail @@ -10,7 +10,7 @@ GREEN='\033[1;32m' YELLOW='\033[1;33m' RESET='\033[0m' -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # Kill all background jobs when the script exits (Ctrl+C or error) trap 'echo ""; echo "Stopping all services..."; kill $(jobs -p) 2>/dev/null; wait' EXIT diff --git a/setup.ps1 b/scripts/setup.ps1 similarity index 96% rename from setup.ps1 rename to scripts/setup.ps1 index ccef726..f3a5190 100644 --- a/setup.ps1 +++ b/scripts/setup.ps1 @@ -1,9 +1,9 @@ # setup.ps1 -- first-run setup for new contributors (Windows / PowerShell) -# Usage: .\setup.ps1 +# Usage: .\scripts\setup.ps1 # Run once after cloning the repo. $ErrorActionPreference = "Continue" -$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +$ScriptDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Definition) $Errors = 0 # Banner @@ -113,7 +113,7 @@ if (Test-Path $androidHome) { # Abort on failures if ($Errors -gt 0) { Write-Host "" - Write-Host "$Errors prerequisite(s) failed. Fix the issues above and re-run .\setup.ps1." -ForegroundColor Red + Write-Host "$Errors prerequisite(s) failed. Fix the issues above and re-run .\scripts\setup.ps1." -ForegroundColor Red Write-Host "" exit 1 } @@ -167,7 +167,7 @@ Write-Host " You're all set! Run these commands to start developing: " -Foreg Write-Host "============================================================" -ForegroundColor Green Write-Host "" Write-Host " Quickstart (all services in separate windows):" -ForegroundColor White -Write-Host " .\dev.ps1" -ForegroundColor Yellow +Write-Host " .\scripts\dev.ps1" -ForegroundColor Yellow Write-Host "" Write-Host " Or start each service individually:" -ForegroundColor White Write-Host " cd backend; make docker-run # Postgres" -ForegroundColor Blue diff --git a/setup.sh b/scripts/setup.sh similarity index 97% rename from setup.sh rename to scripts/setup.sh index 585866a..183f1d3 100644 --- a/setup.sh +++ b/scripts/setup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # setup.sh — first-run setup for new contributors -# Usage: ./setup.sh +# Usage: ./scripts/setup.sh # Run once after cloning the repo. set -euo pipefail @@ -12,7 +12,7 @@ RED='\033[0;31m' BOLD='\033[1m' RESET='\033[0m' -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ERRORS=0 # ── Banner ───────────────────────────────────────────────────────────────────── @@ -101,7 +101,7 @@ fi # Abort if any hard prerequisite failed if [[ "$ERRORS" -gt 0 ]]; then echo "" - echo -e "${RED}${BOLD}$ERRORS prerequisite(s) failed. Fix the issues above and re-run ./setup.sh.${RESET}" + echo -e "${RED}${BOLD}$ERRORS prerequisite(s) failed. Fix the issues above and re-run ./scripts/setup.sh.${RESET}" echo "" exit 1 fi @@ -146,7 +146,7 @@ echo -e "${BOLD}${GREEN}║ You're all set! Run these commands to start develo echo -e "${BOLD}${GREEN}╚═══════════════════════════════════════════════════════════╝${RESET}" echo "" echo -e " ${BOLD}Quickstart (all services in one terminal):${RESET}" -echo -e " ${YELLOW}./dev.sh${RESET}" +echo -e " ${YELLOW}./scripts/dev.sh${RESET}" echo "" echo -e " ${BOLD}Or start each service individually:${RESET}" echo -e " ${BLUE}cd backend && make docker-run${RESET} # Postgres"