Update flow.toml to add environment management tasks and improve index.tsx by removing commented-out gallery code and adjusting hero section height

This commit is contained in:
Nikita
2025-12-24 17:36:17 -08:00
parent f81affe448
commit fcc3d9eedf
2 changed files with 162 additions and 39 deletions

161
flow.toml
View File

@@ -1801,3 +1801,164 @@ fi
description = "Check Stripe configuration status." description = "Check Stripe configuration status."
dependencies = ["node", "pnpm"] dependencies = ["node", "pnpm"]
shortcuts = ["stc", "stripe-check"] shortcuts = ["stc", "stripe-check"]
# =============================================================================
# Environment Management
# =============================================================================
[[tasks]]
name = "env-status"
description = "Show local .env vs wrangler secrets status"
command = '''
set -euo pipefail
echo "=== Environment Status ==="
echo ""
cd packages/web
echo "Local .env:"
if [ -f .env ]; then
cat .env | grep -v "^#" | grep -v "^$" | cut -d= -f1 | sort | while read key; do
echo " ✓ $key"
done
else
echo " ✗ No .env file"
fi
echo ""
echo "Wrangler Secrets (production):"
pnpm exec wrangler secret list 2>&1 | grep '"name"' | sed 's/.*"name": "\([^"]*\)".*/ ✓ \1/' || echo " (none or error)"
echo ""
echo "Commands:"
echo " f env-push - Push .env to wrangler secrets"
echo " f env-pull - Pull wrangler secrets to .env"
echo " f env-set KEY value - Set single var"
'''
shortcuts = ["envs"]
[[tasks]]
name = "env-push"
description = "Push local .env to wrangler secrets (production)"
command = '''
set -euo pipefail
cd packages/web
if [ ! -f .env ]; then
echo "No .env file found"
exit 1
fi
echo "Pushing .env to wrangler secrets..."
echo ""
# Read .env and push each secret
while IFS='=' read -r key value || [ -n "$key" ]; do
# Skip comments and empty lines
[[ "$key" =~ ^#.*$ ]] && continue
[[ -z "$key" ]] && continue
# Skip VITE_ vars (those are build-time, not secrets)
[[ "$key" =~ ^VITE_ ]] && continue
# Skip local-only vars
[[ "$key" == "DATABASE_URL" ]] && continue # Use Hyperdrive in prod
[[ "$key" == "PROD_DATABASE_URL" ]] && continue
[[ "$key" == "ELECTRIC_URL" ]] && continue # Local Electric
# Remove quotes from value
value="${value%\"}"
value="${value#\"}"
echo "Setting $key..."
echo "$value" | pnpm exec wrangler secret put "$key" 2>/dev/null || echo " (failed)"
done < .env
echo ""
echo "Done. Run 'f env-status' to verify."
'''
dependencies = ["pnpm"]
shortcuts = ["envp"]
[[tasks]]
name = "env-set"
description = "Set a wrangler secret (usage: f env-set KEY value)"
command = '''
set -euo pipefail
KEY="${1:-}"
VALUE="${2:-}"
if [ -z "$KEY" ]; then
echo "Usage: f env-set KEY value"
exit 1
fi
cd packages/web
echo "Setting $KEY..."
echo "$VALUE" | pnpm exec wrangler secret put "$KEY"
echo "Done."
'''
dependencies = ["pnpm"]
shortcuts = ["envset"]
[[tasks]]
name = "env-local"
description = "Create local .env from .env.example with defaults"
command = '''
set -euo pipefail
cd packages/web
if [ -f .env ]; then
echo ".env already exists. Delete it first to regenerate."
exit 0
fi
cp .env.example .env
# Generate random auth secret
AUTH_SECRET=$(openssl rand -hex 32)
sed -i '' "s/your-strong-secret-at-least-32-chars/$AUTH_SECRET/" .env
echo "Created .env with:"
echo " - Random BETTER_AUTH_SECRET"
echo " - Local PostgreSQL (needs docker)"
echo " - Local Electric (needs docker)"
echo ""
echo "Next steps:"
echo " 1. Add your OPENROUTER_API_KEY"
echo " 2. Run 'f local-services' for postgres + electric"
echo " 3. Run 'f dev'"
'''
shortcuts = ["envl"]
[[tasks]]
name = "secrets-list"
description = "List all wrangler secrets"
command = '''
cd packages/web
pnpm exec wrangler secret list 2>&1 | jq -r '.[].name' 2>/dev/null | sort || pnpm exec wrangler secret list
'''
dependencies = ["pnpm"]
shortcuts = ["sec"]
[[tasks]]
name = "secrets-delete"
description = "Delete a wrangler secret (usage: f secrets-delete KEY)"
command = '''
KEY="${1:-}"
if [ -z "$KEY" ]; then
echo "Usage: f secrets-delete KEY"
exit 1
fi
cd packages/web
pnpm exec wrangler secret delete "$KEY"
'''
dependencies = ["pnpm"]
shortcuts = ["secd"]

View File

@@ -1,24 +1,13 @@
import { createFileRoute, Link } from "@tanstack/react-router" import { createFileRoute, Link } from "@tanstack/react-router"
import { ShaderBackground } from "@/components/ShaderBackground" import { ShaderBackground } from "@/components/ShaderBackground"
const galleryItems = [
{ id: 1, image: "https://picsum.photos/seed/linsa1/400/600", title: "Nature" },
{ id: 2, image: "https://picsum.photos/seed/linsa2/400/600", title: "Urban" },
{ id: 3, image: "https://picsum.photos/seed/linsa3/400/600", title: "Abstract" },
{ id: 4, image: "https://picsum.photos/seed/linsa4/400/600", title: "Portrait" },
{ id: 5, image: "https://picsum.photos/seed/linsa5/400/600", title: "Landscape" },
{ id: 6, image: "https://picsum.photos/seed/linsa6/400/600", title: "Art" },
{ id: 7, image: "https://picsum.photos/seed/linsa7/400/600", title: "Design" },
{ id: 8, image: "https://picsum.photos/seed/linsa8/400/600", title: "Photo" },
]
function LandingPage() { function LandingPage() {
return ( return (
<div className="relative min-h-screen overflow-hidden bg-black text-white"> <div className="relative min-h-screen overflow-hidden bg-black text-white">
<ShaderBackground /> <ShaderBackground />
{/* Hero Section */} {/* Hero Section */}
<div className="relative z-10 flex min-h-[60vh] flex-col items-center justify-center"> <div className="relative z-10 flex min-h-screen flex-col items-center justify-center">
<h1 className="text-6xl font-bold tracking-tight drop-shadow-2xl"> <h1 className="text-6xl font-bold tracking-tight drop-shadow-2xl">
Linsa Linsa
</h1> </h1>
@@ -51,33 +40,6 @@ function LandingPage() {
</a> </a>
</div> </div>
</div> </div>
{/* Gallery Section */}
<div className="relative z-10 px-6 pb-12">
<div className="mx-auto max-w-7xl">
<h2 className="mb-6 text-center text-2xl font-semibold text-white/90">
Gallery
</h2>
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4">
{galleryItems.map((item) => (
<div
key={item.id}
className="group relative aspect-[2/3] overflow-hidden rounded-2xl bg-white/5 transition-all hover:bg-white/10"
>
<img
src={item.image}
alt={item.title}
className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
/>
<div className="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 transition-opacity group-hover:opacity-100" />
<div className="absolute bottom-0 left-0 right-0 p-4 opacity-0 transition-opacity group-hover:opacity-100">
<p className="text-sm font-medium text-white">{item.title}</p>
</div>
</div>
))}
</div>
</div>
</div>
</div> </div>
) )
} }