Commit Graph
45 Commits
Author SHA1 Message Date
justinandClaude Sonnet 4.6 51adec43e0 feat: add rich demo data seed script
Seeds a complete, realistic demo tenant for Sunny Paws Rescue with 28 pets, 6 foster users, medical records, applications, donations, events, happy tails, content blocks, and more. Run with DATABASE_URL=... npx tsx scripts/seed-demo.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 16:19:19 -05:00
justinandClaude Opus 4.6 3b6159e6d0 fix: MariaDB compatibility, Docker build, and StatsCounter props
- Replace serial() with int().autoincrement() for MariaDB compatibility
- Expose DB port 3306 in docker-compose for local dev tooling
- Remove drizzle/ COPY from Dockerfile (using push, not migrations)
- Fix StatsCounter props mismatch on home page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:17:51 -05:00
justinandClaude Opus 4.6 d192062793 docs: add tiered pricing model to design spec
Three paid tiers: Manage ($12/mo, admin-only + embeddable widgets),
Cloud ($25/mo, full hosted site), API add-on (+$5/mo). Self-hosted
remains free. Updated revenue projections and billing products.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:09:38 -05:00
justinandClaude Opus 4.6 8aeebac63c Merge feat/tenant-app: Complete FosterFlow tenant application
Full rescue management platform with public site, admin dashboard,
foster portal, setup wizard, CSV import, Docker deployment, and
config-driven theming with i18n-ready architecture.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:08:15 -05:00
justinandClaude Opus 4.6 74bfbeff46 fix: remove conflicting root page and fix CSV import export
- Remove scaffolded +page.svelte that conflicted with (public) route group
- Change PET_FIELDS from export to local const (SvelteKit disallows)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:55:48 -05:00
justinandClaude Sonnet 4.6 8d86f9f3b3 Add API routes, SEO endpoints, and friendly error page
- GET /api/health — liveness probe returning status + timestamp
- POST /api/newsletter — subscribe with onDuplicateKeyUpdate
- POST /api/stripe-webhook — handles checkout.session.completed for
  adoption fees and donations; verifies signature via constructWebhookEvent
- GET /api/worker/jobs — fetch next pending AI job (Bearer token auth)
- POST /api/worker/jobs/[id] — report job completion or failure
- GET /robots.txt — disallows admin/foster/api/login/setup paths
- GET /sitemap.xml — static pages + all published available pet pages
- +error.svelte — friendly error page with status-appropriate messaging

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:54:13 -05:00
justinandClaude Sonnet 4.6 e7681f0b49 Add generic CSV import tool for bulk pet ingestion
Two-step flow: upload CSV, auto-detect and map columns, preview first 5
rows, then import. Auto-detects common column names (name, species,
breed, age, sex, etc.). Generates unique slugs from pet names, handles
duplicates within the batch and against existing records. Reports
imported count, skipped rows, and per-row errors. Requires 'import'
permission.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:54:06 -05:00
justinandClaude Sonnet 4.6 8e24f5637d Add 5-step setup wizard for initial org configuration
Accessible only by sysadmin when setupComplete is false. Steps cover
org info, branding (color pickers + logo upload), application form
toggles, Stripe integration keys, and a link to CSV import. Each step
saves to org_config via upsert and calls invalidateConfigCache().
Completing the wizard sets setup_complete = true and redirects to /admin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:54:02 -05:00
justinandClaude Sonnet 4.6 6e3ca2e496 Add foster portal with dashboard, submit update, and request supplies
Fosters can view their current animals (with photos), submit updates
(note/photo/update types with optional photo upload), and request
supplies with urgency levels. Staff is notified via email on each
submission. Layout uses orgConfig branding and CSS custom properties.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:53:57 -05:00
justinandClaude Sonnet 4.6 19665c4dd6 docs: update README for FosterFlow branding
Replaces PawPrint branding with FosterFlow throughout. Adds Docker quick start (docker compose up + seed commands), manual quick start, and a self-hosted vs FosterFlow Cloud comparison table. Removes emoji from feature list for cleaner rendering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:49:50 -05:00
justinandClaude Sonnet 4.6 c129eecb15 feat: add Playwright E2E test config and basic tests
Adds playwright.config.ts pointing at tests/e2e/ with a 15s timeout and dev server reuse. Stubs two test files: public-pages (home, pets, login load checks) and admin-guard (unauthenticated /admin and /foster redirect to /login). Installs @playwright/test as a dev dependency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:49:46 -05:00
justinandClaude Sonnet 4.6 b0bd8277a8 feat: add Docker deployment (Dockerfile, compose, Caddyfile)
Multi-stage Dockerfile builds SvelteKit then runs a lean production image. docker-compose.yml wires up MariaDB with health checks, the app, and Caddy for TLS termination. Caddyfile uses SITE_DOMAIN env var with localhost fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:49:42 -05:00
justinandClaude Sonnet 4.6 c6b7d4d4eb feat: add seed scripts and AI worker
Adds scripts/seed.ts for fresh self-hosted installs, scripts/seed-tenant.ts for cloud provisioner use, and scripts/ai-worker.ts adapted from AHCR with improved theme prompts, name filtering, and WORKER_API_KEY guard. Installs tsx as a dev dependency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:49:37 -05:00
justinandClaude Opus 4.6 6ca598b45c feat(task-37): admin Analytics & System — analytics, traffic, moderation, foster dashboard, fosters, system
Key metrics dashboard, page view traffic analysis, foster submission moderation,
foster assignment management, active foster dashboard with supply requests, and
system settings/org config editor with full audit log.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:45:42 -05:00
justinandClaude Opus 4.6 1ae4c1be2c feat(task-36): admin Content section — content blocks, newsletter, happy tails, events, messages
CMS content block editor grouped by page, newsletter subscriber management,
happy tails CRUD, events CRUD, and contact message inbox with read/unread tracking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:42:50 -05:00
justinandClaude Opus 4.6 416b25fca9 feat(task-35): admin People section — vets, sponsors, mentors, volunteers, users
Full CRUD for vets, sponsors, mentors, volunteer applications, and users.
Includes approve/deny flows for pending users, role management, and password reset.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:38:48 -05:00
justinandClaude Opus 4.6 63f127dfca Add admin pet detail pages: profile, photos, medical, fosters (Task 32b)
Pet layout: tabbed nav with counts for photos/medical/fosters, status
badge in header. Detail overview: summary cards and compatibility grid.
Profile: full edit form including adoption info conditional on status,
audit logged. Photos: upload, set primary (star toggle), delete, reorder
with prev/next arrows. Medical: add/delete records grouped by date,
cost stored as cents. Fosters: assign by user account (linked to
foster-role users), set current, delete, audit logged throughout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:33:24 -05:00
justinandClaude Opus 4.6 55c1eb7a9f Add admin pet list, new pet form, and quick intake (Task 32a)
Pet list: search by name/breed/microchip, filter by status/species,
sort columns, pagination, delete with confirm modal. New pet form:
full fields including photos with drag-and-drop preview. Quick intake:
mobile-optimized form with camera/gallery photo capture, toggles for
species/sex, sets intake date to today.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:33:15 -05:00
justinandClaude Opus 4.6 6b6dab6cf8 Add admin layout and dashboard (Task 31)
Sidebar with permission-filtered nav, mobile hamburger, org name from
config, logout button. Dashboard loads pet/application/foster/donation
stats and recent audit log activity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:33:05 -05:00
justinandClaude Sonnet 4.6 d1e7a52eec feat(admin): Task 34 — donations, expenses, and financial reports
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:30:55 -05:00
justinandClaude Sonnet 4.6 f06e85e6f8 feat(admin): Task 33 — applications list, detail, status actions, homevisit notes, contract
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:30:51 -05:00
justinandClaude Opus 4.6 c1efb85c14 Add content pages (contact, events, happy tails, sponsors, donate)
All pages use config-driven org info via data.orgConfig — no hardcoded
org names, emails, or external URLs. Stripe donate page gracefully falls
back to a contact CTA when STRIPE_SECRET_KEY is not configured.
RateLimiter applied to contact form and happy tails submission.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:21:17 -05:00
justinandClaude Sonnet 4.6 c83f24084c feat: add auth pages (login, logout, register, change-password)
Login uses loginLimiter, authenticates via authenticateUser, creates
session cookie, and redirects foster role to /foster, others to /admin.
Logout destroys session and redirects to /. Register uses
registrationLimiter, validates input, creates inactive user, and sends
registration notification. Change-password verifies current password,
enforces 8-char minimum, updates hash, clears mustChangePassword flag.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:14:56 -05:00
justinandClaude Sonnet 4.6 fccc89630e feat: add AI pet name generator page and API endpoint
Client-side generator page with species (dog/cat) and theme selectors
submits a job to /api/pet-names POST, then polls GET until completed.
API uses nameGeneratorLimiter for rate limiting and delegates to
queueNameGenerationJob/getJobStatus from lib/server/ai.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:14:52 -05:00
justinandClaude Sonnet 4.6 464f300775 feat: add application forms for adopt, foster, volunteer, and surrender
Each form checks orgConfig.applications to verify the type is enabled,
validates required fields, inserts into the applications table, and
sends email notification via sendApplicationNotification. Adoption form
supports optional pet pre-selection via ?pet=slug query param. Surrender
form auto-creates a pet record from submitted data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:14:46 -05:00
justinandClaude Sonnet 4.6 708a434032 Add static content pages (about, adoption-process, become-a-foster, etc.)
- About, adoption process, become a foster, how to help, volunteer, why adopt pages
- All org name/email/contact info driven by data.orgConfig
- Foster resources page with optional FOSTER_RESOURCES_PASSWORD password gate
- Content blocks loaded from DB with sensible generic fallback text
- Application links conditionally shown based on orgConfig.applications flags

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:14:17 -05:00
justinandClaude Sonnet 4.6 f9002898f8 Add home page, pets listing, pet detail, and API endpoint
- Home page loads featured pets, upcoming events, content blocks, and stats
- Pets listing page with search/filter by species and sex, infinite scroll
- Pet detail page with photo gallery/lightbox, compatibility badges, and related pets
- /api/pets GET endpoint for infinite scroll pagination
- All schema adapted for pawprint (url, startDate, published, etc.)
- All org name references driven by data.orgConfig.orgInfo.name

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:10:39 -05:00
justin 2fa3d4ec67 feat: add root and public layouts with config-driven theming 2026-03-26 12:03:31 -05:00
justin a30205fa28 feat: add public site components (header, footer, pet card, sponsors, etc.) 2026-03-26 12:03:11 -05:00
justinandClaude Sonnet 4.6 7f7d4870d0 feat: add UI component library (toast, search, badges, modals, upload, table)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:02:19 -05:00
justin ff6dc03a06 feat: add toast state, server hooks (auth, guards, tracking, security headers) 2026-03-26 12:00:30 -05:00
justinandClaude Sonnet 4.6 9dac6f9f8b feat: add server modules (stripe, contract, ai, facebook)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 11:59:31 -05:00
justinandClaude Sonnet 4.6 3669c0d4f8 feat: add server modules (audit, upload, email, content, tracking)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 11:59:00 -05:00
justinandClaude Sonnet 4.6 649c324f37 feat: add org_config loader with caching and defaults
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 11:56:51 -05:00
justinandClaude Sonnet 4.6 0367886ac6 feat: add i18n system with English locale
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 11:56:48 -05:00
justin c06a78b5fc feat: add session-based auth system 2026-03-26 11:55:47 -05:00
justin c5f1d2c993 feat: add in-memory sliding window rate limiter 2026-03-26 11:54:51 -05:00
justin af2e48347f feat: add slugify utility 2026-03-26 11:54:42 -05:00
justinandClaude Opus 4.6 86c1389d67 feat: add auth utilities (Argon2, session tokens)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:54:35 -05:00
justin fdc27584c9 feat: add role-based permission system 2026-03-26 11:54:24 -05:00
justinandClaude Sonnet 4.6 22f0ded88f feat: add database schema and connection pool
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 11:53:30 -05:00
justinandClaude Sonnet 4.6 b5cb5ba96a feat: scaffold FosterFlow SvelteKit project with config
Initializes SvelteKit 2 + Svelte 5 project with adapter-node, Tailwind CSS 4,
Drizzle ORM (MySQL), Stripe, Nodemailer, and argon2 dependencies. Configures
app.html with PWA meta tags, app.css with brand color tokens, and manifest.json.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 11:50:11 -05:00
justinandClaude Opus 4.6 76d1e086d0 Add FosterFlow tenant app implementation plan
45 tasks across 9 phases covering foundation, server modules, UI,
public routes, admin dashboard, foster portal, setup wizard, API,
deployment, and testing. Full TDD approach with AHCR as reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:37:39 -05:00
justinandClaude Opus 4.6 d68ec1bd11 Add FosterFlow SaaS platform design spec
Comprehensive design for the multi-tenant rescue management SaaS,
covering architecture, data model, tenant lifecycle, roles, features,
tech details, testing, and deployment. Clean room rebuild from AHCR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:26:58 -05:00
justinandClaude Opus 4.6 7fd2438c36 Initial paw❤️print repo with SaaS architecture docs
README, multi-tenant SaaS architecture (database-per-tenant),
automated onboarding flow (signup → 60 seconds → live site),
and template extraction plan from AHCR codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:36:38 -05:00