Commit Graph
343 Commits
Author SHA1 Message Date
Moheeb Zara 8ad1ca44b7 feat: open-source release prep, audit fixes, and deploy hardening
Production deploy completed (DigitalOcean Droplet, self-hosted Supabase,
Caddy + Let's Encrypt, GitHub Actions auto-deploy on push to main, daily
pg_dumpall backups). This commit lands the work that came out of the
deep audit pass and the open-source release prep.

Audit fixes:
- Webhook signing secret is now displayed in the settings UI with
  show/hide and copy-to-clipboard; the broken external docs.hackerspace.sh
  link is replaced with a link to the new local docs.
- Settings updateSpaceSettings parameter type now includes
  mission_statement so the field persists.
- members page enforces member_directory_visibility for non-admin viewers
  (admin_only, board_visible, members_visible).
- Mobile responsiveness pass: Projects Kanban grid, Members + Payments
  tables (column hiding on small screens), Proposal tally + voting
  buttons (2-col on mobile).

Open-source release scaffolding:
- LICENSE (MIT).
- CONTRIBUTING.md with dev setup, conventions, PR flow.
- SECURITY.md with disclosure policy.
- CHANGELOG.md.
- docs/WEBHOOKS.md with Node and Python signature verification examples.
- README.md rewritten for an open-source audience.

Removed v0/Vercel references:
- @vercel/analytics dependency removed.
- app/layout.tsx no longer imports Analytics, drops generator: 'v0.app'.
- Canonical deployment docs (docs/DEPLOYMENT.md, docs/README.md,
  docs/ARCHITECTURE.md, DATABASE.md, CLAUDE.md, README.md) now describe
  the self-hosted Droplet target only.
- e2e console-error check no longer filters [v0] noise.

Landing page:
- GitHub icon link to the public repo in the nav and footer.
2026-05-14 16:28:16 -07:00
Moheeb Zara b8cd36abc3 ci: GitHub Actions auto-deploy to production droplet on push to main
Workflow SSHes into the production droplet as `deploy` and runs
`/opt/hackerspace-ops/deploy.sh` which:
  - git fetches and resets to origin/main
  - rebuilds the app image with NEXT_PUBLIC_* baked in from .env.local
  - applies any new scripts/0NN_*.sql migrations not in the
    public._migrations_applied tracking table
  - hot-swaps the app container with `docker compose up -d --no-deps app`
  - prunes dangling images

Repo secrets DROPLET_HOST and DEPLOY_SSH_PRIVATE_KEY are configured.

Concurrency group `deploy-prod` with cancel-in-progress=false so two
pushes in quick succession queue rather than racing.

Also gitignores `secrets/` and `*.pem` so production credentials never
get committed.
2026-05-14 15:41:33 -07:00
Moheeb Zara 9332320920 fix(resources): use next/font CSS variables, not literal font names
The audit caught a real bug: `resources.css` declared
`font-family: 'IBM Plex Mono'` and `font-family: 'Libre Baskerville'`
as literal font names. `next/font/google` does not register the loaded
webfonts under those names — it generates hashed family names and
exposes them via `--font-ibm-plex-mono` and `--font-libre-baskerville`
CSS variables on the same element that gets the `*-module__*__variable`
class.

The shipped CSS therefore never used the downloaded webfonts; visitors
without the fonts installed locally saw the generic monospace / Georgia
fallback chain instead of the intended typography.

Switched all four font-family declarations to reference the variables
first, then the literal name, then a generic family:

  font-family: var(--font-ibm-plex-mono), 'IBM Plex Mono', ui-monospace, ...
  font-family: var(--font-libre-baskerville), 'Libre Baskerville', Georgia, serif

Also fixed the Wordmark SVG which had a hardcoded `fontFamily` SVG
attribute (overrides CSS); replaced with an inline `style` referencing
the same CSS variable.

Verified the CSS bundle now contains var(--font-ibm-plex-mono) and
var(--font-libre-baskerville) at the relevant rules.
2026-05-14 15:26:47 -07:00
Moheeb Zara 7e15dd1e63 feat: bake hackerspace-sh subsite into the management app
Ports the existing hackerspace.sh Vue site (sibling repo) into this
codebase as a route group `app/(resources)/` so a single domain serves
both the public research / games subsite and the authenticated
management app.

Routes added (all public, all prerendered):
  /resources         landing page (the original HomePage.vue)
  /zine              iframe to the printable hackerspace zine
  /governance        iframe to Governance in a Box
  /space-after-dark  iframe to the isometric exploration game
  /proposal-duel     iframe to the proposal-debate game
  /atlas             iframe to the bundled atlas.html (2.2 MB)

The individual resource paths match the originals exactly so existing
deep links and bookmarks survive the domain switch-over.

Ports six Vue components to React: Wordmark, SpaceIcon, TraceIcon,
CubeIcon, KeyIcon, GridIcon, PromptIcon, AtlasLogo, ProjectCard,
IframeWrapper. CSS scoped under `.resources-root` so the dark IBM Plex
Mono / Libre Baskerville theme cannot bleed into the management app's
shadcn design system. Fonts loaded via next/font/google. The 2.2 MB
atlas.html lives in /public.

proxy.ts adds the six routes plus /atlas.html to PUBLIC_ROUTES so
anonymous visitors can reach them without redirecting to /login.

The management landing page links to /resources twice: a "Resources"
nav link, and a callout under the CTA buttons ("Not running a space?
Read the hackerspace research and games").
2026-05-14 15:18:54 -07:00
Moheeb Zara ea8d7a5f91 feat: governance kernel, deployment hardening, local-dev stack
Adds proposals + proposal_votes + policies + incidents + incident_updates
tables with full RLS, async voting flow, dismissal-appeal pathway,
versioned policies with provenance, and an anonymous-incident token mode.
Adds per-space configurable areas, financial visibility settings, member
self-profile + COI disclosure, and a mission statement that renders in
the app footer.

Reorganises lib/actions.ts into per-domain files (tasks, projects,
members, payments, contacts, knowledge-base, secrets, area-leads,
settings, imports, proposals, incidents, policies, areas) plus a barrel.
Adds lib/permissions.ts and lib/auth-helpers.ts so action bodies stop
duplicating the user-to-member-to-role check. Wires every action that has
a Zod schema; introduces a flexibleDateTime preprocessor so HTML date
pickers no longer hit "Invalid datetime".

Hardens RLS: drops NOT NULL on space_members.user_id for offline members,
adds a privilege-escalation trigger that blocks self-edits to role / tier
/ status / approved / has_card_access / space_id, closes four
cross-tenant holes in the governance kernel, and adds a partial unique
index so two admins cannot concurrently activate two drafts of the same
policy slug.

Ships every deployment artifact: Dockerfile, docker-compose,
.do/app.yaml, .env.example, /api/health, plus a managed-Supabase guide
(docs/DEPLOYMENT.md), an end-to-end self-hosted Droplet guide
(docs/DEPLOY_DO_SELFHOSTED.md), and a Supabase-CLI local-dev quickstart
(docs/LOCAL_DEV.md). Replaces middleware.ts with proxy.ts for Next.js 16.
Adds scripts/schema.sql as the canonical idempotent full deploy plus
fourteen numbered incremental migrations.

Adds scripts/seed.sql so a fresh local DB renders something instead of
empty pages: a demo space, five members across all roles, a v1 code of
conduct, three proposals in different states with seven votes already
cast, an open incident, a project, three tasks, a KB entry, and matching
activity-log rows.

Replaces v0-generated test scaffolding with 266 real tests across
__tests__/{actions,auth-helpers,components,governance,permissions,
security,utils,validations}.test.ts. Adds react-markdown + remark-gfm
for proposal / incident / policy body rendering. Deletes four dead v0
fix-* scripts, the unused components/app-shell.tsx, and the duplicate
app/auth/login/page.tsx.

Routes (31 total): /api/health, /api/paypal/sync, /auth/callback, /,
/login, /signup, /signup/confirm, /dashboard, /tasks, /projects,
/members, /payments, /financials, /contacts, /ops, /ops/[id], /ops/new,
/proposals, /proposals/[id], /proposals/new, /incidents, /incidents/[id],
/incidents/new, /policies, /policies/[slug], /policies/new, /profile,
/recruitment, /settings, /comms, /import.

Full pass-by-pass history is in docs/HANDOFF.md; the roadmap is in
docs/GOVERNANCE_FEATURES.md.
2026-05-14 04:52:11 -07:00
vercel[bot] 8b9128704b Merge pull request #6 from virgilvox/landing-page-design
Create hackerspace management landing page with dark aesthetic
2026-03-11 08:54:30 +00:00
v0andMoheeb Zara cf8fd2b5ca feat: adjust mobile navigation for compact layout
Ensure nav stays compact on small screens with no wrapping.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 08:54:04 +00:00
v0andMoheeb Zara 96dd16982a feat: streamline app copy for clarity
Clean up hero, features, and CTA for concise messaging.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 08:52:17 +00:00
v0andMoheeb Zara 6e4eed8c27 refactor: simplify landing page with ops features
Remove marketing elements and add animated ops preview.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 08:47:27 +00:00
v0andMoheeb Zara 28f1a6f7b0 feat: create hackerspace management app landing page
Add dark aesthetic, animated UI previews, icon-only design, clean copy, responsive layout, stats section, feature grid, clear CTAs

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 08:38:37 +00:00
vercel[bot] 301037c088 Merge pull request #5 from virgilvox/v0/hackbuildvideo-3367-89ba6a7c
Harden application security and improve data integrity
2026-03-11 08:21:25 +00:00
v0andMoheeb Zara f5697f577f feat: comprehensive application audit and fixes
Audited codebase, fixed input validation, OAuth, error handling, type casts, and security hardening

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 08:18:57 +00:00
v0andMoheeb Zara 2e136b5f55 refactor: generate and use Supabase TypeScript types
Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 08:12:39 +00:00
v0andMoheeb Zara c34d5d9529 fix: correct Supabase insert fields for secrets and area leads
Fix missing 'label' in secrets insert and correct area leads field names.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 08:05:53 +00:00
vercel[bot] 5a377e5064 Merge pull request #4 from virgilvox/v0/hackbuildvideo-3367-af7b4c05
Improve mobile responsiveness and stabilize authentication flows
2026-03-11 08:01:03 +00:00
v0andMoheeb Zara bfef722a75 feat: add comprehensive test suites
Expand unit, E2E, and utility tests for full coverage.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 08:00:22 +00:00
v0andMoheeb Zara 3924534858 feat: add Vitest and Playwright testing frameworks
Set up Vitest for unit/integration tests and Playwright for E2E tests; add configs, tests, and documentation

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 07:54:17 +00:00
v0andMoheeb Zara ef36527131 fix: resolve filtering issues for unverified statuses
Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 07:51:38 +00:00
vercel[bot] 95b04202a2 Merge pull request #3 from virgilvox/v0/hackbuildvideo-3367-fc7113bd
Enhance mobile responsiveness and stabilize authentication flows
2026-03-11 07:51:33 +00:00
v0andMoheeb Zara 8cdb9dbb87 fix: resolve member status check bugs
Fix '.eq('status', 'current')' in all actions and page-level files.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 07:49:53 +00:00
v0andMoheeb Zara c33434e552 fix: resolve sidebar drawer navigation issue on mobile
Fix nested component remount and auto-close on path change.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 07:27:42 +00:00
v0andMoheeb Zara d01b9c4359 fix: clean up 'app-sidebar.tsx' export issues
Refactor SidebarContent and add fallback for undefined member names.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 07:22:29 +00:00
v0andMoheeb Zara 1036e1ff5e feat: make app fully mobile-responsive
Update layout, headers, tables, kanban, comms, forms, and modals for mobile.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 07:20:17 +00:00
v0andMoheeb Zara a6d44f2ddb fix: move invite code check to server action for new users
Remove client-side invite code validation to avoid RLS issues.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 07:03:45 +00:00
vercel[bot] b063c48051 Merge pull request #2 from virgilvox/v0/hackbuildvideo-3367-4dea679b
Fix database schema mismatches and improve authentication flow
2026-03-11 06:59:04 +00:00
v0andMoheeb Zara 6cce622536 chore: reset Supabase database and disable email confirmation
Reset database and run clean schema script; disable email
confirmation manually in Supabase Dashboard.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 06:51:06 +00:00
v0andMoheeb Zara 3192897a23 refactor: update schema.sql to match live DB
Replace old scripts with a single definitive schema.sql file.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 06:48:52 +00:00
v0andMoheeb Zara 4ef8438630 fix: resolve session refresh issue post space creation
Ensure session cookies are updated before server navigation for both new and returning users.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 06:48:38 +00:00
v0andMoheeb Zara e36dee2601 feat: update main migration script and add sync migration for existing deployments
Main migration now canonical for fresh deployments; added sync migration for legacy DBs.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 06:36:43 +00:00
v0andMoheeb Zara 1d08719a04 feat: resolve schema discrepancies and update schema.sql
Fix column and constraint mismatches, and update schema.sql to match live DB.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 06:33:50 +00:00
v0andMoheeb Zara 0f71ddf377 fix: resolve auth flow and DB schema issues
Fix column name mismatches, enhance signup UX, and align DB schema with codebase.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 06:17:13 +00:00
vercel[bot] e90e39dbbb Merge pull request #1 from virgilvox/v0/hackbuildvideo-3367-48d30ed0
Stabilize chat and payment features and optimize database performance
2026-03-11 06:09:08 +00:00
v0andMoheeb Zara 9a9d8f762f fix: escape $ signs in JSX to prevent template literal errors
Fix remaining '$' instances in JSX and escape properly.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 06:08:47 +00:00
v0andMoheeb Zara 520c04eadb feat: fully reset and rebuild database with comprehensive guide
Database reset, indexes, RLS policies, triggers, and updated deployment guide

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 06:06:58 +00:00
v0andMoheeb Zara 8461c5d69a fix: escape dollar sign in JSX to avoid template literal parsing
Properly escape '$' in JSX to prevent template literal
interpretation.

Co-authored-by: Moheeb Zara <[email protected]>
2026-03-11 05:53:22 +00:00
v0 42f7d05e5a Add README.md 2026-03-11 05:45:01 +00:00
v0 c0d01b4f3a feat: create canonical schema and README\n\nGenerate single schema migration and add deployment guide. 2026-03-11 05:43:40 +00:00
v0 7e50bd9673 fix: correct JSX structure in card header\n\nProperly wrap badge and PayPal button in flex container. 2026-03-11 05:37:59 +00:00
v0 41051e7000 fix: close PayPal sync conditional block correctly\n\nAdd missing closing ')}' for PayPal conditional JSX. 2026-03-11 05:37:18 +00:00
v0 88071abd3f fix: implement comprehensive bug fixes across multiple components\n\nFix chat, tasks, ops, import, and PayPal components for full functionality. 2026-03-11 05:30:44 +00:00
v0 93cc7af60b fix: investigate and fix broken routes and chat issues\n\nCreate tracking doc and fix critical issues, including RLS policies. 2026-03-11 05:03:50 +00:00
v0 51765625e7 feat: audit and document repository for production readiness\n\nCreate comprehensive documentation and identify key issues and missing features 2026-03-11 04:56:53 +00:00
v0 296c5dd78d Initial commit from v0 2026-03-11 04:44:48 +00:00