Modern ve kapsamlı bir İnsan Kaynakları yönetim sistemi. Bu uygulama, İngilizce testleri, beceri ve kişilik değerlendirmeleri ile Product Owner simülasyonları sunarak işe alım süreçlerini dijitalleştirir.
- NextAuth.js tabanlı güvenli oturum yönetimi
- JWT token kullanarak stateless authentication
- Rol bazlı erişim kontrolü (admin/user)
- Middleware ile sayfa seviyesinde güvenlik kontrolü
- bcrypt ile şifrelenmiş password saklama
- İngilizce seviye testleri oluşturma ve yönetimi
- Beceri ve kişilik değerlendirme testleri
- Otomatik test atama sistemi
- Zaman sınırı ile test alma
- Gerçek zamanlı test ilerlemesi takibi
- Detaylı sonuç raporları ve analiz
- AWS Bedrock Claude AI ile dinamik içerik üretimi
- Team Meeting senaryoları
- Backlog Prioritization görevleri
- User Story Writing alıştırmaları
- Gerçek zamanlı performans değerlendirmesi
- Kullanıcı yönetimi ve rol atama
- Test sonuçlarının detaylı analizi
- Atanmış testlerin takibi
- Kapsamlı raporlama araçları
- Data table ile gelişmiş filtreleme
- Framework: Next.js 14 (App Router)
- Runtime: React 18 (Concurrent Features)
- Language: JavaScript (JSDoc ile type hints)
- Database: MongoDB
- ORM: Prisma 5.20.0
- Authentication: NextAuth.js v4
- API Client: Axios
- Primary AI: AWS Bedrock (Claude 3 Sonnet)
- SDK: @aws-sdk/client-bedrock-runtime
- Backup: @anthropic-ai/sdk
- UI Library: Radix UI (Headless Components)
- Styling: Tailwind CSS 3.4.1
- Animations: Framer Motion
- Icons: Lucide React + Radix Icons
- Themes: next-themes (Dark/Light mode)
- Server State: TanStack Query (React Query)
- Client State: React useState/useReducer
- Form State: React Hook Form + Zod validation
- Tables: TanStack React Table
- Drag & Drop: @hello-pangea/dnd
- Charts: Built-in components
- Linting: ESLint + Next.js config
- Build Tools: PostCSS + Tailwind
- Development: Hot reload + Query devtools
User Model
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
email String @unique
hashedPassword String
role String @default("user") // "user" | "admin"
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// Relations
assignedTests AssignedTest[]
assignedSkillPersonalityTests AssignedSkillPersonalityTest[]
ProductOwnerSimulation ProductOwnerSimulation[]
}EnglishTest Model
model EnglishTest {
id String @id @default(auto()) @map("_id") @db.ObjectId
title String
level String // "Beginner" | "Intermediate" | "Advanced"
questions Json // Flexible question structure
createdAt DateTime @default(now())
createdBy String @db.ObjectId
// Relations
assignedTests AssignedTest[]
}AssignedTest Model (Test Assignment & Progress)
model AssignedTest {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
testId String @db.ObjectId
assignedAt DateTime @default(now())
completedAt DateTime? // Nullable - test may not be completed
score Int? // Nullable - may not be scored yet
startedAt DateTime? // Test start time
timeRemaining Int? // Remaining time in seconds
answers Json? // User responses
// Relations
user User @relation(fields: [userId], references: [id])
test EnglishTest @relation(fields: [testId], references: [id])
}SkillPersonalityTest Model
model SkillPersonalityTest {
id String @id @default(auto()) @map("_id") @db.ObjectId
title String
sections Json // Different test sections (skill, personality, etc.)
createdAt DateTime @default(now())
createdBy String @db.ObjectId
// Relations
assignedTests AssignedSkillPersonalityTest[]
}AssignedSkillPersonalityTest Model
model AssignedSkillPersonalityTest {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
testId String @db.ObjectId
assignedAt DateTime @default(now())
completedAt DateTime?
startedAt DateTime?
timeRemaining Int?
answers Json? // User responses
results Json? // AI analysis results
// Relations
user User @relation(fields: [userId], references: [id])
test SkillPersonalityTest @relation(fields: [testId], references: [id])
}ProductOwnerSimulation Model (AI-Powered Simulations)
model ProductOwnerSimulation {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
startedAt DateTime @default(now())
completedAt DateTime?
currentTask String? // Current task identifier
teamMeeting Json? // Team meeting scenarios (AI generated)
backlogPrioritization Json? // Backlog prioritization tasks
userStoryWriting Json? // User story writing exercises
score Int? // Overall performance score
// Relations
user User @relation(fields: [userId], references: [id])
}🔍 Key Design Decisions
- MongoDB ObjectId: Native MongoDB ID usage
- JSON Storage: Flexible schema for questions, answers, and AI results
- Nullable Fields: Support for incomplete/in-progress tests
- Time Tracking: Comprehensive timestamp management
- Relational Design: Proper foreign key relationships despite NoSQL
📊 Data Relationships
- One-to-Many: User → AssignedTests
- One-to-Many: User → Simulations
- Many-to-One: AssignedTest → EnglishTest
- Cascade Operations: Handled at application level
Proje, özellik bazlı (feature-based) mimari kullanarak organize edilmiştir. Bu yaklaşım, kod organizasyonunu iyileştirir ve maintainability sağlar.
Her feature aşağıdaki standart yapıyı takip eder:
features/[feature-name]/
├── components/ # Feature'a özel UI bileşenleri
├── services/ # API çağrıları ve business logic
├── queries/ # TanStack Query hooks
└── constants/ # Sabitler ve konfigürasyonlar
🔐 Auth Feature (features/auth/)
- Components: LoginForm, RegisterForm
- Services: login(), register() functions
- Queries: useLogin, useRegister hooks
- Constants: Auth endpoints
👥 Users Feature (features/users/)
- Components: UserTable, UserTableActions, DeleteUserDialog, LoadingState
- Services: fetchUsers(), updateUserRole(), deleteUser()
- Queries: useFetchUsers, useUpdateUserRole, useDeleteUser
- Constants: User management endpoints
⚙️ Account Feature (features/account/)
- Components: AccountForm
- Services: updateAccount()
- Queries: useUpdateAccount
- Constants: Account endpoints
🏠 Home Feature (features/home/)
- Data: Static content configuration (features, steps, interview types)
- Landing page için yapılandırılmış data structures
Her feature, service layer pattern kullanarak API çağrılarını soyutlar:
// Örnek Service
export const fetchUsers = async () => {
const response = await axios.get(Endpoints.USERS.DEFAULT)
return response.data
}TanStack Query ile optimize edilmiş data fetching:
// Örnek Query Hook
const useFetchUsers = () => {
return useQuery({
queryKey: ['users'],
queryFn: fetchUsers,
})
}Consistent mutation handling ve error management:
// Örnek Mutation
const useUpdateUserRole = () => {
return useMutation({
mutationFn: updateUserRole,
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['users'] })
toast.success('Rol başarıyla güncellendi')
},
})
}Uygulama, middleware seviyesinde güvenlik kontrolü sağlar:
- Public Routes:
/,/login,/register - Protected Routes: Tüm
/panel/*sayfaları - Role-based Access: Admin ve user rolleri için farklı erişim seviyeleri
- Tüm API endpoints server-side session kontrolü
- Admin yetkisi gerektiren işlemler için ek güvenlik katmanı
- CORS ve rate limiting koruması
- Projeyi klonlayın:
git clone <repository-url>
cd hr-app-v1- Bağımlılıkları yükleyin:
npm install- Ortam değişkenlerini ayarlayın:
cp .env.example .env.local- Veritabanı şemasını güncelleyin:
npm run prisma:generate
npm run prisma:push- Geliştirme sunucusunu başlatın:
npm run dev# Database
DATABASE_URL=mongodb://...
# NextAuth
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000
# AWS Bedrock (Product Owner Simulations)
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key# Development
npm run dev # Start development server
npm run lint # Run ESLint
# Database
npm run prisma:generate # Generate Prisma client
npm run prisma:push # Push schema to database
# Production
npm run build # Build for production (includes prisma generate)
npm start # Start production serverPOST /api/register- Kullanıcı kaydıGET/POST /api/auth/[...nextauth]- NextAuth endpoints
GET /api/users- Kullanıcı listesiPOST /api/users/update-role- Rol güncellemePOST /api/users/delete- Kullanıcı silme
GET /api/english-test- Test listesiPOST /api/english-test/create- Test oluşturmaPOST /api/english-test/assign- Test atamaGET /api/english-test/assigned/[id]- Atanmış test detayıPOST /api/english-test/submit- Test sonucu gönderme
GET /api/skill-personality-test- Test listesiPOST /api/skill-personality-test/create- Test oluşturmaPOST /api/skill-personality-test/assign- Test atamaGET /api/skill-personality-test/results- Sonuçlar
POST /api/product-owner-simulation- Simülasyon başlatmaGET /api/product-owner-simulation/[id]- Simülasyon detayıPOST /api/product-owner-simulation/[id]/complete-task- Görev tamamlama
POST /api/account/update- Profil güncelleme
├── app/ # Next.js App Router
│ ├── (auth)/ # Authentication pages
│ ├── api/ # API routes
│ ├── panel/ # Protected dashboard pages
│ └── globals.css # Global styles
├── components/ # Reusable UI components
│ ├── main/ # Main feature components
│ └── ui/ # Base UI components (Radix)
├── features/ # Feature-based organization
│ ├── auth/ # Authentication feature
│ │ ├── components/ # LoginForm, RegisterForm
│ │ ├── services/ # Auth API calls
│ │ ├── queries/ # TanStack Query hooks
│ │ └── constants/ # Auth endpoints
│ ├── users/ # User management feature
│ │ ├── components/ # UserTable, UserActions, etc.
│ │ ├── services/ # User CRUD operations
│ │ ├── queries/ # User query hooks
│ │ └── constants/ # User endpoints
│ ├── account/ # Account management feature
│ │ ├── components/ # AccountForm
│ │ ├── services/ # Account services
│ │ ├── queries/ # Account mutations
│ │ └── constants/ # Account endpoints
│ └── home/ # Home page data
│ └── data.js # Static content configuration
├── lib/ # Utilities and configurations
│ ├── AuthOptions.js # NextAuth configuration
│ ├── prismadb.js # Prisma client
│ └── utils.js # Helper functions
├── prisma/ # Database schema
│ └── schema.prisma # Database models and relations
├── providers/ # React context providers
└── middleware.js # Route protection
components/ui/ # Base UI components (Radix UI)
├── button.jsx # Button primitives
├── dialog.jsx # Modal dialogs
├── table.jsx # Data tables
└── ...
components/main/ # Application-specific components
├── LogoutButton.jsx # Logout functionality
├── TestButton.jsx # Test management
└── ...
features/[feature]/components/ # Feature-specific components
├── [Feature]Form.jsx # Forms
├── [Feature]Table.jsx # Data tables
└── [Feature]Actions.jsx # Action components
npm run build
npm startProduction ortamında aşağıdaki servislerin yapılandırılması gerekir:
- MongoDB Atlas veya MongoDB instance
- AWS Bedrock erişimi (Product Owner simülasyonları için)
- SSL sertifikası (HTTPS)
- ESLint ve Prettier kullanımı
- Feature-based modular organization
- Custom hooks ile logic separation
- Consistent naming conventions
- Server-side rendering (SSR)
- Dynamic imports ile code splitting
- TanStack Query ile efficient caching
- Image optimization
- Service Layer Pattern for API abstraction
- Custom Query Hooks for data fetching
- Consistent error handling with toast notifications
- Form validation with React Hook Form + Zod
- Production Dependencies: 43 packages
- Development Dependencies: 5 packages
- Package Size: Optimized bundle size
- Security: Regular dependency updates