Admin dashboard for managing pcbtools.xyz - hosted at admin.pcbtools.xyz.
- Framework: Next.js 16 (App Router)
- UI: Tailwind CSS + shadcn/ui
- Database: PostgreSQL (shared with main site)
- Auth: Better Auth with Google OAuth
- ORM: Prisma 7 with pg adapter
- Deployment: Docker → Coolify
This project shares a database with the main pcbtools.xyz site.
| Tables | Owner |
|---|---|
User, Session, Account, Verification, ToolEmbedding, BugReport |
pcbtools (main) |
admin_user, admin_session, admin_account, admin_verification |
pcbtools-admin |
- NEVER push this schema before the main site — it can overwrite shared tables
- Read-only tables MUST match
apps/web/prisma/schema.prismaexactly - Only modify admin-prefixed tables (
admin_*) in this schema - Use
db push, not migrations — both projects modify the same DB
# ALWAYS update main site FIRST:
cd pcbtools/apps/web
pnpm exec prisma db push --accept-data-loss
# Then sync admin schema:
cd pcbtools-admin
# 1. Copy shared table definitions from main schema
# 2. Push admin schema
pnpm exec prisma db push --accept-data-loss- 📊 Dashboard - Overview metrics (users, bugs, activity)
- 🐛 Bug Reports - Manage KiNotes bug reports
- 👥 Users - View and manage registered users
- 🔒 Admin Only - Environment-based email whitelist
npm installcp .env.example .envEdit .env:
DATABASE_URL="postgresql://user:pass@host:5432/pcbtools"
ADMIN_EMAILS="your@email.com"
NEXTAUTH_SECRET="generate-with-openssl-rand-base64-32"
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"npm run prisma:generatenpm run devVisit: http://localhost:3001
- Type: Docker
- Repo:
way2pramil/pcbtools-admin - Domain:
admin.pcbtools.xyz - Port:
3001
Add in Coolify:
DATABASE_URL=postgresql://...
ADMIN_EMAILS=pramil.wakchaure@gmail.com
NEXTAUTH_URL=https://admin.pcbtools.xyz
NEXTAUTH_SECRET=your-secret
GOOGLE_CLIENT_ID=xxx
GOOGLE_CLIENT_SECRET=xxx
- Build Command:
npm run build - Start Command:
npm start
Only emails listed in ADMIN_EMAILS can access the dashboard.
To add admins:
ADMIN_EMAILS="admin1@example.com,admin2@example.com"src/
├── app/
│ ├── layout.tsx # Root layout
│ ├── login/page.tsx # Admin login
│ └── dashboard/
│ ├── layout.tsx # Dashboard layout with sidebar
│ ├── page.tsx # Dashboard home
│ ├── bugs/page.tsx # Bug reports management
│ └── users/page.tsx # User management
├── components/
│ ├── sidebar.tsx # Navigation sidebar
│ ├── header.tsx # Top header with user info
│ ├── stats-card.tsx # Metric cards
│ └── status-badge.tsx # Status indicators
└── lib/
├── prisma.ts # Database client
├── auth.ts # Admin check utility
└── utils.ts # Helper functions
Shares the same PostgreSQL database with the main pcbtools.xyz site.
Models Used:
User- Registered usersBugReport- User-submitted bugsSession- Auth sessionsOAuthAccount- OAuth connections
- ✅ Environment-based admin whitelist
- ✅ OAuth-only authentication (no passwords)
- ✅ Database-level access control
- ✅ Separate domain from main site
docker logs -f <container-id>npm run prisma:studionpm update
npm audit fixThis is a solo developer project. For issues, contact pramil.wakchaure@gmail.com.
Proprietary - Part of pcbtools.xyz