Skip to content

Lyradd/ITSDojo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ITSDojo

This is a Next.js project bootstrapped with create-next-app, designed as a Gamified Learning Management System.

Project Setup & Installation (Important)

Before running the development server, ensure you have installed all necessary dependencies and UI components used in this project.

1. Install Core Dependencies

Run this command to install state management, utility libraries, icons, and visualization tools:

npm install zustand clsx tailwind-merge lucide-react class-variance-authority reactflow

2. Initialize Shadcn UI

If you haven't initialized Shadcn UI yet, run:

npx shadcn@latest init

3. Install Required UI Components

This project relies on specific Shadcn UI components. Install them using the following command:

npx shadcn@latest add button card input label progress separator

Database Setup (Neon & Drizzle)

This project uses Neon (Serverless PostgreSQL) as the database and Drizzle ORM for type-safe database interactions.

1. Install Database Dependencies

Install the ORM, Neon driver, and development tools for migrations:

npm install drizzle-orm @neondatabase/serverless dotenv
npm install -D drizzle-kit

2. Configure Environment Variables

Create a .env file in the root directory. You need to add your Neon connection string here.

Important: Use the "Pooled" connection string from your Neon Dashboard. Ensure there are no psql prefixes or single quotes '.

Cuplikan kode

.env

DATABASE_URL="postgresql://neondb_owner:YOUR_PASSWORD@ep-your-endpoint.aws.neon.tech/neondb?sslmode=require"

3. Sync Database Schema

Whenever you make changes to db/schema.ts, you must push the changes to the Neon database:

npx drizzle-kit push

4. Manage Data (Drizzle Studio)

To view, edit, or add dummy data to your database using a GUI (similar to phpMyAdmin):

npx drizzle-kit studio

This will open a local web interface to interact with your live Neon database.


Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.


๐Ÿ†• Version History & Changelog

Version 1.4 - WebSocket Live Leaderboard (Current)

Release Date: 4 Januari 2026

๐ŸŒ Real-Time WebSocket Integration

โœ… Live Leaderboard Updates

  • Real-time synchronization via WebSocket (Socket.io)
  • Zero database polling - event-driven architecture
  • In-memory cache for instant updates
  • 99.5% bandwidth reduction vs polling approach

โœ… Connection Status Indicator

  • Live indicator badge (green "Live" / red "Offline")
  • Auto-reconnection up to 5 attempts
  • Visual feedback untuk connection state
  • Graceful degradation pada network issues

โœ… Custom Next.js Server

  • Custom server dengan Socket.io integration
  • Event handlers: leaderboard:initial, leaderboard:update, leaderboard:add-user
  • In-memory cache management
  • Broadcast system untuk multi-client sync

๐ŸŽฏ Balanced Scoring System

Before:

  • Rank #1: 300 XP
  • Rank #2-10: 62-95 XP (gap terlalu besar โŒ)

After:

  • Rank #1: 300 XP
  • Rank #2-10: 120-280 XP (progression lebih realistic โœ…)

๐Ÿ› Critical Bug Fixes

โœ… Duplicate User Bug

  • Fixed: Current user muncul 2x di leaderboard
  • Solution: Filter existing user before re-adding
  • Impact: Clean leaderboard display

โœ… State Synchronization

  • Fixed: User entry sync between client & server
  • Proper cleanup on component unmount
  • No memory leaks

๐Ÿ“Š Performance Improvements

Network Efficiency:

  • Before: 720 requests/hour (polling every 5s)
  • After: Event-driven (only on changes)
  • Bandwidth saved: ~10MB โ†’ ~50KB per hour

Responsiveness:

  • WebSocket connection: ~200ms
  • Update broadcast: <50ms
  • UI update latency: <100ms

๐Ÿ› ๏ธ Technical Implementation

New Files:

  • server.js - Custom Next.js server with WebSocket
  • lib/websocket-client.ts - Client wrapper dengan auto-reconnect
  • lib/leaderboard-cache.ts - In-memory cache manager
  • lib/websocket-server.ts - Server-side Socket.io setup

Modified Files:

  • app/(dashboard)/leaderboard/page.tsx - WebSocket integration + live indicator
  • lib/evaluation-data.ts - Balanced mock data (120-280 range)
  • package.json - Added Socket.io dependencies

Dependencies Added:

{
  "socket.io": "^4.8.3",
  "socket.io-client": "^4.8.3"
}

๐Ÿ“ˆ Architecture

Client Browser โ†โ†’ Socket.io โ†โ†’ Custom Server โ†โ†’ In-Memory Cache
                                      โ†“
                                  Database (event-driven only)

๐ŸŽฎ User Experience Enhancements

  • Visual Feedback: Instant rank updates tanpa refresh
  • Live Badge: Shows when connected to real-time server
  • Offline Mode: Graceful fallback saat disconnected
  • Auto-sync: Multiple tabs auto-update simultaneously

Version 1.3 - UI/UX Refinement & Critical Bug Fixes

Release Date: 28 Desember 2025

๐ŸŽจ Sidebar Improvements

  • โœ… Simplified navigation (removed redundant Profile/More menu)
  • โœ… Scrollable navigation dengan custom scrollbar
  • โœ… Cleaner interface tanpa bottom profile section
  • โœ… Optimized menu items (essential only)

๐Ÿ” Login Enhancements

  • โœ… "Remember Me" checkbox functionality restored
  • โœ… Better UX positioning (antara password & login button)
  • โœ… Consistent styling dengan design system

๐Ÿ› Critical Bug Fixes

Quiz State Bug (Major):

  • โœ… Fixed: Selecting answer di Q1 mempengaruhi semua soal
  • โœ… Independent state per question
  • โœ… Proper state persistence untuk answered questions
  • โœ… Fresh state untuk unanswered questions

Quiz Answer Visibility:

  • โœ… No spoilers: Correct answer tidak ter-highlight before submit
  • โœ… Proper feedback flow (hanya after submission)
  • โœ… Conditional hover effects

๐Ÿ“ฑ Mobile Responsiveness

  • โœ… Fixed bottom navbar overlap (pb-24 md:pb-8)
  • โœ… Sticky navigation properly positioned
  • โœ… All content accessible & scrollable di mobile

๐Ÿงน UI Cleanup

  • โœ… Removed unnecessary tips sections (Leaderboard, Evaluation)
  • โœ… Cleaner layout tanpa distraction
  • โœ… Focus on core functionality

๐Ÿ› ๏ธ Developer Experience

  • โœ… VSCode settings.json untuk Tailwind CSS
  • โœ… Suppressed CSS lint warnings untuk Tailwind directives
  • โœ… Enhanced IntelliSense & autocomplete

Version 1.2 - Admin Dashboard & Role-Based System

Release Date: November 2025

๐Ÿ” Role-Based Authentication

  • โœ… Login sebagai Mahasiswa atau Dosen
  • โœ… Auto-redirect berdasarkan role
  • โœ… Route protection untuk admin pages
  • โœ… Role persistence di localStorage

๐Ÿ‘จโ€๐Ÿซ Admin Dashboard (Dosen)

Dashboard Features:

  • Stats overview (Total Mahasiswa, Aktif, Avg Akurasi, Evaluasi Aktif)
  • Recent activity feed dengan real-time updates
  • Active evaluations list
  • Quick action cards

Course Management:

  • Create, edit, delete courses
  • Search functionality
  • Course stats & difficulty badges
  • Lesson management per course

Student Monitoring:

  • 20 mock students dengan realistic data
  • Search & sort (by XP, accuracy, name)
  • Progress tracking & streak monitoring
  • Last active timestamps

Evaluations Management:

  • List active & completed evaluations
  • Stats cards (submissions, avg score)
  • Create & edit evaluations
  • Close/archive functionality

Analytics & Reports:

  • Activity trend charts (7 days)
  • Score distribution graphs
  • Course popularity metrics
  • Top 5 performers list
  • Export functionality (CSV/PDF)

๐ŸŽจ Enhanced Navigation

  • Unified Blue/Cyan color scheme
  • Role-based menus
  • Gradient active states
  • Animated indicators
  • Profile section dengan role badge

๐Ÿ“Š Mock Data System

  • 20 realistic mock students
  • Linked evaluation results
  • Activity logs
  • Charts data untuk visualization

New Pages:

  • /admin - Dashboard home
  • /admin/courses - Course management
  • /admin/students - Student monitoring
  • /admin/evaluations - Evaluations management
  • /admin/analytics - Analytics & reports

Version 1.1 - Live Leaderboard Integration

Release Date: Oktober 2025

๐ŸŽฏ Comprehensive Evaluation System

  • โœ… 3 Question Types: Multiple choice, Short answer, True/False
  • โœ… Instant Feedback: Visual response <500ms
  • โœ… Real-time Progress: Score, accuracy, timer
  • โœ… Question Navigation: Next/Previous dengan indicators
  • โœ… Results Page: Comprehensive review

๐Ÿ† Live Leaderboard (Octalysis Framework)

  • โœ… Real-time updates (3-second intervals)
  • โœ… Rank animations dengan smooth transitions
  • โœ… Social comparison (top performers + nearby ranks)
  • โœ… Current user highlight (blue glow + "YOU" badge)
  • โœ… Live indicator dengan pulsing dot
  • โœ… Medal system ๐Ÿฅ‡๐Ÿฅˆ๐Ÿฅ‰ untuk top 3

๐Ÿ“Š Standalone Leaderboard Page

  • โœ… Top 3 podium dengan gradient colors
  • โœ… Stats overview cards
  • โœ… Full rankings dengan scroll
  • โœ… User progress tracking
  • โœ… Quick action shortcuts

New Pages:

  • /evaluation - Evaluations list
  • /evaluation/[id] - Active evaluation
  • /evaluation/[id]/results - Results review
  • /leaderboard - Standalone leaderboard

New Components:

  • components/leaderboard/live-leaderboard.tsx
  • components/leaderboard/leaderboard-entry.tsx
  • components/evaluation/question-card.tsx

Version 1.0 - Gamified LMS Foundation

Release Date: September 2025

Core Features

  • โœ… Learning path dengan skill tree visualization
  • โœ… Course management (Frontend, React, Backend)
  • โœ… Daily goals dengan XP rewards
  • โœ… Basic gamification (XP, levels, streak)
  • โœ… Profile page dengan stats
  • โœ… Static leaderboard preview

Pages:

  • /learn - Main learning page
  • /courses - Course list
  • /courses/[id] - Course detail
  • /goals - Daily goals
  • /profile - User profile

Limitations:

  • โŒ No evaluation/quiz system
  • โŒ Static leaderboard only
  • โŒ No real-time updates
  • โŒ No instant feedback
  • โŒ No competitive elements

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •