A comprehensive web application for tracking your progress through the vast Warhammer 40,000 Black Library collection. Built with Next.js 15, TypeScript, and Supabase.
- 76+ complete series with 440 books total
- 85 standalone novels
- 101 novellas
- 137 anthologies and collections
- 763 unique books across all categories
- Major series including:
- The Horus Heresy (54 books)
- Siege of Terra (8 books)
- Dawn of Fire (9 books, ongoing)
- Gaunt's Ghosts (16 books)
- Eisenhorn, Ravenor, and Bequin trilogies
- Ultramarines, Night Lords, Space Wolves, and more
- Xenos-focused series: Path of the Eldar, Twice-Dead King, Phoenix Lords
- Four Book Categories - Separate navigation for Series, Singles, Novellas, and Anthologies
- Multiple Sorting Options per Category - Each category supports browsing:
- By Series (Series only) - Follow Black Library publication order
- By Name - Alphabetically sorted complete catalog
- By Tags - Find books by themes (e.g., "Primarchs", "Siege", "Investigation")
- By Factions - Filter by your favorite armies and factions
- Pagination - 20 items per page for easy browsing
- Search Functionality - Quick filtering within tags and factions views
- Three reading states: Unread, Reading, Completed
- Tabbed Dashboard - Separate dashboards for Series, Singles, Novellas, and Anthologies
- Visual progress indicators and completion rates
- Statistics for each category (Total, Completed, Reading, Unread)
- Collapsible Sections - Currently Reading and Completed Books sections with expand/collapse functionality
- Rating and Notes - Add ratings (1-5 stars) and personal notes for Singles, Novellas, and Anthologies
- Real-time sync across all your devices
- Warhammer-themed dark interface with Imperial Gold accents
- Detailed book modals with all metadata
- Responsive design for desktop and mobile
- Smooth animations and transitions
- Google OAuth via Supabase Auth
- Row-level security for user data
- Admin-only import functionality
- Secure API endpoints
- User Requests - Any authenticated user can request books to be added to the library
- Request Management - Four status categories:
- Requests (Pending) - New requests awaiting admin review
- Approved - Requests accepted and fulfilled
- Waitlist - Requests acknowledged but not yet ready to add
- Refused - Requests rejected with admin-provided reasons
- Filtering - Sort requests by newest or oldest
- Admin-Only Status Changes - Only admins can move requests between statuses
- Refusal Comments - Required explanations when refusing requests, with edit tracking
- JSON-based book import system with file selection
- Support for importing Series, Singles, Novellas, and Anthologies
- Automatic tag and faction normalization
- Folder-based organization (_meta folders) for easy management
- Real-time updates to canonical tag/faction lists across all categories
- Selective import (choose specific files to import)
- Book request management with status updates and refusal comments
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth (Google OAuth)
- Styling: Tailwind CSS
- UI Components: Custom design system
- Deployment Ready: Vercel-optimized
- Node.js 18+
- npm/yarn/pnpm/bun
- Supabase account
- Clone the repository:
git clone https://github.com/yourusername/codex-librarium.git
cd codex-librarium- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.localEdit .env.local and add your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
ADMIN_EMAILS=your-admin-email@example.com- Run the development server:
npm run devβββ app/ # Next.js app directory
β βββ api/ # API routes
β β βββ books/ # Series books API
β β βββ singles/ # Singles API
β β βββ novellas/ # Novellas API
β β βββ anthologies/ # Anthologies API
β β βββ reading/ # Reading progress APIs
β β β βββ route.ts # Series progress (GET/POST)
β β β βββ singles/ # Singles progress (GET/POST)
β β β βββ novellas/ # Novellas progress (GET/POST)
β β β βββ anthologies/ # Anthologies progress (GET/POST)
β β βββ requests/ # Book requests APIs
β β β βββ route.ts # List/create requests (GET/POST)
β β β βββ [id]/ # Update/delete request (PATCH/DELETE)
β β βββ import/ # Import system APIs
β βββ dashboard/ # Dashboard pages
β β βββ page.tsx # Series dashboard
β β βββ singles/ # Singles dashboard
β β βββ novellas/ # Novellas dashboard
β β βββ anthologies/ # Anthologies dashboard
β β βββ requests/ # Book requests dashboard
β βββ import/ # Admin import page
β βββ order/ # Book browsing pages
β β βββ series/ # Series books
β β β βββ page.tsx # Redirect to /series
β β β βββ series/ # Browse by series
β β β βββ name/ # Browse by name
β β β βββ tags/ # Browse by tags
β β β βββ factions/ # Browse by factions
β β βββ singles/ # Single novels
β β β βββ page.tsx # Redirect to /name
β β β βββ name/ # Browse by name
β β β βββ tags/ # Browse by tags
β β β βββ factions/ # Browse by factions
β β βββ novellas/ # Novellas
β β β βββ page.tsx # Redirect to /name
β β β βββ name/ # Browse by name
β β β βββ tags/ # Browse by tags
β β β βββ factions/ # Browse by factions
β β βββ anthologies/ # Anthologies
β β βββ page.tsx # Redirect to /name
β β βββ name/ # Browse by name
β β βββ tags/ # Browse by tags
β β βββ factions/ # Browse by factions
β βββ auth/ # Authentication callbacks
βββ components/ # React components
β βββ AppLayout.tsx # Main layout wrapper
β βββ BookDetailsModal.tsx
β βββ DashboardTabs.tsx # Dashboard category tabs
β βββ OrderTabs.tsx # Sorting tabs
β βββ Navbar.tsx
β βββ SeriesView.tsx
βββ lib/ # Utilities and types
β βββ supabase/ # Supabase client setup
β βββ design-system.ts # Theming and styles
β βββ types.ts # TypeScript definitions
βββ data/ # Book data
β βββ series/ # Series JSON files
β β βββ _meta/ # tags.json, factions.json
β βββ singles/ # Singles JSON files
β β βββ _meta/ # tags.json, factions.json
β βββ novellas/ # Novellas JSON files
β β βββ _meta/ # tags.json, factions.json
β βββ anthologies/ # Anthologies JSON files
β βββ _meta/ # tags.json, factions.json
βββ supabase/ # Database migrations
β βββ migrations/ # SQL migration files
βββ .claude/ # Documentation
βββ DESIGN_SYSTEM.md
βββ DATABASE.md
βββ API_ENDPOINTS.md
βββ AUTHENTICATION.md
- Create a new Supabase project at https://supabase.com/dashboard
- Go to SQL Editor in your Supabase dashboard
- Run
supabase/migrations/004_complete_fresh_schema.sql- Creates all tables, indexes, and RLS policies - Run
supabase/migrations/005_add_book_requests.sql- Adds book requests feature - In Authentication β Providers, enable Google OAuth with your credentials
npx supabase db pushThe database includes:
- Book Tables:
series,series_books,singles,novellas,anthologies - Reading Progress Tables:
reading_progress_series_books,reading_progress_singles,reading_progress_novellas,reading_progress_anthologies - Book Requests Table:
book_requests- User-submitted book requests with admin management - Row Level Security (RLS) on all tables
- Indexes for optimal query performance
See supabase/migrations/004_complete_fresh_schema.sql for the main schema and 005_add_book_requests.sql for the book requests feature.
Books are stored as JSON files in four category directories:
data/series/- Series with booksdata/singles/- Standalone novelsdata/novellas/- Novellasdata/anthologies/- Anthologies and collections
To add books:
- Create a new JSON file in the appropriate category folder
- Follow the schema for that category
- Tags and factions will auto-normalize against canonical lists in
_meta/folders - Validate your changes:
npm run validate-dataThis script checks for:
- Missing IDs
- Duplicate IDs within each table
- Overlapping IDs between tables (warning only)
For admin access, use the /import page to selectively import JSON files.
Comprehensive documentation is available in the .claude/ directory:
DESIGN_SYSTEM.md- Colors, typography, component patternsDATABASE.md- Schema, RLS policies, queriesAPI_ENDPOINTS.md- API reference and examplesAUTHENTICATION.md- Auth flow and securityPROJECT_STRUCTURE.md- Architecture overviewADDING_BOOKS.md- Book import guide
- Push your code to GitHub
- Import the repository in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
Make sure to set these in your Vercel dashboard:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY(for admin imports)GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETADMIN_EMAILS(comma-separated list)
Contributions are welcome! To add new book series:
- Fork the repository
- Create a new series JSON file following the schema
- Test locally
- Submit a pull request
This is a personal project for tracking Warhammer 40,000 book collections. All Warhammer 40,000 intellectual property belongs to Games Workshop.
- Black Library for the incredible Warhammer 40,000 book collection
- Games Workshop for the Warhammer 40,000 universe
- The community for keeping track of reading orders
In the grim darkness of the far future, there are only books to track.