Initial project setup: monorepo structure with frontend and backend
- Set up pnpm workspace with frontend (React + Vite) and backend (Express + Prisma) - Configure TypeScript, ESLint, and Prettier - Add Prisma schema for database models (User, Course, Lesson, Progress, etc.) - Create basic frontend structure with Tailwind CSS and shadcn/ui - Add environment configuration files - Update README with project overview and setup instructions - Complete Phase 0: Project initialization
This commit is contained in:
31
packages/backend/prisma/seed.ts
Normal file
31
packages/backend/prisma/seed.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function main() {
|
||||
console.log('🌱 Starting database seed...');
|
||||
|
||||
// Create a sample user
|
||||
const user = await prisma.user.create({
|
||||
data: {
|
||||
email: 'demo@znakovni.hr',
|
||||
displayName: 'Demo User',
|
||||
authProvider: 'local',
|
||||
},
|
||||
});
|
||||
|
||||
console.log('✅ Created demo user:', user.email);
|
||||
|
||||
// Add sample terms here in future phases
|
||||
console.log('✅ Seed completed successfully!');
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((e) => {
|
||||
console.error('❌ Seed failed:', e);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(async () => {
|
||||
await prisma.$disconnect();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user