mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-11 14:21:15 +00:00
57ce1bffb285c9bc441a00b10453713ecdd8304a
The standalone `npx tsc --noEmit` can't resolve @/ path aliases for generated Prisma client files on CI, even with baseUrl set. next build already runs TypeScript type checking and ESLint via its own bundler which handles path aliases correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dragon's Stash
A self-hosted inventory management system for 3D printing filament, SLA resin, and miniature paints. Built with a dark, data-dense UI inspired by Spoolman.
Features
- Filament tracking with spool weight, material type, color swatches, and usage logging
- SLA resin management with bottle sizes, resin types, and remaining volume tracking
- Miniature paint inventory with product lines, finishes, and volume tracking
- Dashboard with inventory stats, low-stock alerts, and recent activity
- Vendor and location management to organize your supplies
- Usage logging to track consumption over time
- Low-stock alerts with configurable threshold percentage
- Dark theme optimized for workshop environments
- Role-based auth with admin and user roles
- Docker-ready for easy self-hosting
Tech Stack
- Framework: Next.js 16 (App Router)
- Language: TypeScript (strict mode)
- Database: PostgreSQL with Prisma ORM
- Auth: Auth.js v5 (credentials + GitHub OAuth)
- UI: Tailwind CSS, shadcn/ui, Lucide icons
- Tables: TanStack Table v8 with server-side pagination
- Validation: Zod v4 + React Hook Form
Quick Start
Prerequisites
- Node.js 20+
- PostgreSQL 16+ (or Docker)
Development Setup
- Clone the repository:
git clone https://github.com/your-username/dragons-stash.git
cd dragons-stash
- Install dependencies:
npm install
- Start a PostgreSQL database (using Docker):
docker compose -f docker-compose.dev.yml up -d
- Copy the environment file and update values:
cp .env.example .env.local
- Run database migrations and seed:
npx prisma migrate dev
npx prisma db seed
- Start the development server:
npm run dev
- Open http://localhost:3000 and log in:
- Admin: admin@dragonsstash.local / password123
- User: user@dragonsstash.local / password123
Docker Deployment
docker compose up -d
This starts both the application and PostgreSQL database. The app will be available at http://localhost:3000.
To seed the database on first run:
SEED_DATABASE=true docker compose up -d
Project Structure
src/
app/
(auth)/ # Login/Register pages
(app)/ # Authenticated app pages
dashboard/ # Overview stats
filaments/ # Filament CRUD
resins/ # Resin CRUD
paints/ # Paint CRUD
vendors/ # Vendor management
locations/ # Location management
settings/ # User preferences
api/
auth/ # NextAuth API routes
health/ # Health check endpoint
components/
layout/ # Sidebar, header, navigation
shared/ # Reusable data table components
ui/ # shadcn/ui components
data/ # Prisma query functions
hooks/ # React hooks
lib/ # Auth config, Prisma client, constants
schemas/ # Zod validation schemas
types/ # TypeScript type definitions
prisma/
schema.prisma # Database schema
seed.ts # Seed data
Configuration
Environment variables (see .env.example):
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Required |
AUTH_SECRET |
NextAuth secret key | Required |
AUTH_TRUST_HOST |
Trust the host header | true |
AUTH_GITHUB_ID |
GitHub OAuth client ID | Optional |
AUTH_GITHUB_SECRET |
GitHub OAuth client secret | Optional |
NEXT_PUBLIC_APP_URL |
Public application URL | http://localhost:3000 |
Health Check
The application exposes a health check endpoint at /api/health that verifies database connectivity.
curl http://localhost:3000/api/health
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Languages
TypeScript
81.4%
HTML
17.1%
Batchfile
0.5%
Dockerfile
0.4%
CSS
0.4%
Other
0.1%