This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run dev- Start development server on localhost:3000npm run build- Build for production (uses SKIP_ENV_VALIDATION=1)npm run lint- Run ESLintnpm run start- Start production servernpx prisma studio- Open Prisma database browsernpx prisma generate- Generate Prisma client (runs automatically after npm install)npx prisma db seed- Seed database with initial data
Space Hackability is a T3 Stack application for managing and showcasing accessibility-focused projects from the Hackability community.
- Next.js 13.1.6 with hybrid App Router + Pages Router
- tRPC 10.9.1 for type-safe API communication
- Prisma 4.9.0 with PostgreSQL for data persistence
- NextAuth.js 4.19.2 for Google OAuth authentication
- Tailwind CSS + DaisyUI for styling
- Editor.js 2.26.5 for rich content editing
Hybrid Routing: The app uses both App Router (/src/app/) for admin dashboard and Pages Router (/src/pages/) for public pages like the homepage.
Role-Based Access: Three user levels:
- Public users (view published projects)
- Authors (
isAuthor: true- create/edit own projects) - Admins (
isAdmin: true- full system access)
Rich Content System: Projects use Editor.js for structured content with multiple block types (headers, paragraphs, code, images, tables, etc.). Content is stored as JSON in the body field.
Core models:
- User: Authentication + role flags (
isAdmin,isAuthor) - Project: Main content model with rich Editor.js
body(JSON), structured fields (what,why,how),buildSteps(JSON array), and media management - Standard NextAuth models (Account, Session, VerificationToken)
Located in /src/server/api/routers/:
/auth- Authentication management/project- Core project operations, file uploads (Cloudinary/Google Cloud)/author- Author-specific operations (getMyProjects,createProject)/admin- Admin operations (getAllProjects,setDraft,deleteProject, role management)/files- File management utilities
Security: Procedures use protectedProcedure, authorProcedure, and adminProcedure middleware for access control.
/src/projects/- Project-specific components and forms/src/ui/- Reusable UI components (Editor, Logo, Nav, Footer)/src/projects/forms/- Form components with Zod validation and React Final Form/src/app/dashboard/- Admin interface using App Router/src/pages/- Public pages (homepage, project views)
Images: Cloudinary integration with generateCloudinaryUploadSignature for direct uploads
Files: Google Cloud Storage with generategsUploadUrl for document uploads
Fallback: Uses /hackability.png for missing project preview images
Uses React Final Form with Zod validation:
ZodFormwrapper component handles schema validation- Custom field components (
TextField,SelectPicker) in/src/projects/forms/ - Editor.js integration for rich content fields
Environment: Extensive environment validation using Zod schemas - check .env.example for required variables.
TypeScript: Strict TypeScript configuration with full end-to-end type safety via tRPC.
Styling: Tailwind CSS with DaisyUI component library. The project uses Italian language throughout the UI.
Build: Production builds skip environment validation (SKIP_ENV_VALIDATION=1) - ensure all environment variables are properly set in production.
Docker Support: Multi-stage Dockerfile available for containerized deployment.