Core Features: - Complete Prisma database schema with all entities (users, orgs, projects, checks, etc.) - Production-grade authentication service with Argon2 password hashing - JWT-based session management with HttpOnly cookies - Comprehensive auth middleware with role-based access control - RESTful auth API endpoints: register, login, logout, me, refresh - Database seeding with demo data for development - Rate limiting on auth endpoints (5 attempts/15min) Technical Implementation: - Type-safe authentication with Zod validation - Proper error handling and logging throughout - Secure password hashing with Argon2id - JWT tokens with 7-day expiration - Database transactions for atomic operations - Comprehensive middleware for optional/required auth - Role hierarchy system (MEMBER < ADMIN < OWNER) Database Schema: - Users with secure password storage - Organizations with membership management - Projects for organizing redirect checks - Complete audit logging system - API key management for programmatic access - Bulk job tracking for future phases Backward Compatibility: - All existing endpoints preserved and functional - No breaking changes to legacy API responses - New auth system runs alongside existing functionality Ready for Phase 2: Enhanced redirect tracking with database persistence
27 lines
603 B
JSON
27 lines
603 B
JSON
{
|
|
"name": "@redirect-intelligence/database",
|
|
"version": "2.0.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"db:generate": "prisma generate",
|
|
"db:migrate": "prisma migrate dev",
|
|
"db:deploy": "prisma migrate deploy",
|
|
"db:studio": "prisma studio",
|
|
"db:seed": "tsx prisma/seed.ts",
|
|
"db:reset": "prisma migrate reset"
|
|
},
|
|
"dependencies": {
|
|
"@prisma/client": "^5.7.1",
|
|
"argon2": "^0.31.2"
|
|
},
|
|
"devDependencies": {
|
|
"prisma": "^5.7.1",
|
|
"tsx": "^4.6.2",
|
|
"@types/node": "^20.10.0",
|
|
"typescript": "^5.3.0"
|
|
},
|
|
"prisma": {
|
|
"seed": "tsx prisma/seed.ts"
|
|
}
|
|
}
|