A Next.js web application for creating and sharing homebrew content for the Daggerheart TTRPG. Create custom cards, adversaries, and access game master tools and reference materials.
Live Site: daggerheartbrews.com
- Card Builder: Create custom ability cards with domains, colors, images, and stats
- Adversary Builder: Design custom adversaries with customizable stats, attacks, and abilities
- Community Sharing: Browse and share homebrew content with the community
- Game Master Tools: Quick reference for rules, tables, and game mechanics
- Authentication: Secure email/password and social login (Google, Discord)
- Export: Generate printable card images
- Framework: Next.js 15 with App Router, TypeScript
- Styling: Tailwind CSS v4
- Database: PostgreSQL with Drizzle ORM (Neon serverless in production)
- Authentication: Better Auth
- State Management: Zustand
- Email: React Email with Resend
- Testing: Vitest + React Testing Library (unit), Playwright (E2E)
- Deployment: Vercel
- Node.js 20+
- PostgreSQL database (local or Neon)
- OAuth credentials (Discord, Google)
- Resend API key
- Clone the repository:
git clone https://github.com/kelvin-mai/daggerheartbrews.com.git
cd daggerheartbrews.com- Install dependencies:
npm install- Set up environment variables:
cp .env.example .envEdit .env with your credentials:
- DATABASE_URL: PostgreSQL connection string
- BETTER_AUTH_SECRET: Generate with
openssl rand -base64 32 - BETTER_AUTH_URL: Your app URL (http://localhost:3000 for dev)
- DISCORD_CLIENT_ID/SECRET: From Discord Developer Portal
- GOOGLE_CLIENT_ID/SECRET: From Google Cloud Console
- RESEND_API_KEY: From Resend
- Generate and run database migrations:
npm run db:generateApply migrations manually by running the SQL files in the sql/ directory against your database.
- Start the development server:
npm run devOpen http://localhost:3000 to see the app.
npm run dev # Start dev server with Turbopack
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLint
npm run lint:fix # Run ESLint with auto-fix
npm run format # Format code with Prettier
npm run test # Run unit tests with Vitest
npm run test:e2e # Run E2E tests with Playwright
npm run test:e2e:ui # Run E2E tests with Playwright UIFor detailed testing guidance, see docs/testing.md.
npm run db:generate # Generate Drizzle migrations from schema
npm run migration:generate # Generate custom migrationMigrations are stored in sql/ directory with numbered prefixes.
src/
├── app/ # Next.js App Router
│ ├── (auth)/ # Authentication routes
│ ├── (dashboard)/ # Protected routes
│ └── api/ # API routes
├── components/ # React components
│ ├── card-creation/ # Card builder
│ ├── adversary-creation/ # Adversary builder
│ ├── game-master/ # GM tools
│ └── ui/ # Reusable UI components
├── lib/
│ ├── auth/ # Authentication config
│ ├── database/ # Drizzle schemas
│ ├── constants/ # SRD game data
│ └── utils/ # Utilities
├── actions/ # Server actions
├── store/ # Zustand stores
└── hooks/ # Custom React hooks
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see LICENSE for details.
Daggerheart™ is a trademark of Darrington Press, LLC. This project is an independent fan-made tool and is not affiliated with, endorsed by, or sponsored by Darrington Press. All game content and mechanics belong to their respective copyright holders.
This software creates content compatible with the Daggerheart System Reference Document (SRD).
- Built with Next.js
- UI components from Radix UI
- Styled with Tailwind CSS
- SRD content from the official Daggerheart System Reference Document