A comprehensive coding platform designed specifically for computer science students, featuring real-time code execution, competitive programming, and collaborative learning.
- Real-time Code Execution: Integrated Judge0 for instant code testing
- Multi-language Support: Python, Java, C++, and C
- Problem Management: 1000+ curated problems with varying difficulty levels
- User Management: Student, Admin, and Super-Admin roles
- Leaderboards: Global and department-level rankings
- Progress Tracking: Detailed analytics and performance metrics
- Dashboard: Personal progress tracking and goal setting
- Problem Solving: Interactive coding environment with Monaco Editor
- Submission History: Track all submissions with detailed feedback
- Achievements: Badge system for milestones and accomplishments
- Peer Learning: Collaborative problem-solving features
- Student Management: Account approval and user administration
- Problem Management: Create, edit, and manage coding problems
- Analytics: Comprehensive reporting and progress monitoring
- Bulk Operations: Mass problem assignment and user management
- Framework: Next.js 15 with TypeScript
- Styling: Tailwind CSS 4 with shadcn/ui components
- State Management: React Context API
- Forms: React Hook Form with Zod validation
- Animations: Framer Motion
- Code Editor: Monaco Editor
- Charts: Recharts
- Runtime: Node.js with Express.js
- Language: TypeScript
- Database: PostgreSQL with connection pooling
- Authentication: JWT-based with role-based access control
- Code Execution: Judge0 self-hosted instance
- Queue System: BullMQ for asynchronous processing
- Caching: Redis for leaderboards and performance
- Database: PostgreSQL with optimized indexes
- Cache: Redis for session management and caching
- Code Execution: Dockerized Judge0 instance
- Security: Helmet, CORS, rate limiting, input validation
collegecodehub/
βββ frontend/ # Next.js 15 frontend application
β βββ src/
β β βββ app/ # App router pages
β β βββ components/ # Reusable UI components
β β βββ contexts/ # React contexts
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utility functions
β β βββ types/ # TypeScript type definitions
β βββ package.json
βββ backend/ # Express.js backend API
β βββ src/
β β βββ controllers/ # Route controllers
β β βββ middleware/ # Express middleware
β β βββ models/ # Database models
β β βββ routes/ # API routes
β β βββ services/ # Business logic services
β β βββ types/ # TypeScript types
β β βββ utils/ # Utility functions
β βββ package.json
βββ README.md
- Node.js 18+ and npm
- PostgreSQL 13+
- Redis 6+
- Docker (for Judge0)
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Set up environment variables:
cp env.example .env # Edit .env with your database and Redis credentials -
Set up PostgreSQL database:
# Create database createdb collegecodehub -
Start the backend server:
npm run dev
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Set up environment variables:
cp env.local.example .env.local # Edit .env.local with your Supabase credentials -
Start the development server:
npm run dev
This project uses Supabase for authentication and database. Follow these steps:
-
Set up Supabase:
- See SUPABASE_SETUP.md for detailed Supabase configuration
- Run the schema.sql in Supabase SQL Editor
-
Create Demo Users (for testing):
- See DEMO_USERS_SETUP.md for instructions
- This will create test accounts with different roles (student, admin, super-admin)
-
Start Judge0 with Docker:
docker run -p 2358:2358 -d judge0/judge0:1.13.0
-
Verify Judge0 is running:
curl http://localhost:2358/health
The application uses PostgreSQL with the following main tables:
users: User accounts with role-based accessproblems: Coding problems with test casessubmissions: Code submissions and resultsleaderboard: Rankings and statisticsbadges: Achievement system
# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=collegecodehub
DB_USER=postgres
DB_PASSWORD=password
# JWT
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=7d
# Server
PORT=5000
NODE_ENV=development
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# Judge0
JUDGE0_API_URL=http://localhost:2358NEXT_PUBLIC_API_URL=http://localhost:5000- Solve coding problems
- Track personal progress
- Participate in leaderboards
- Earn achievements and badges
- Manage student accounts
- Create and assign problems
- Monitor student progress
- Generate reports
- Full system access
- Manage other admins
- System configuration
- Advanced analytics
- Authentication: JWT-based with secure token handling
- Authorization: Role-based access control (RBAC)
- Input Validation: Comprehensive validation using Zod
- Rate Limiting: API rate limiting to prevent abuse
- Security Headers: Helmet.js for security headers
- CORS: Configurable cross-origin resource sharing
- SQL Injection Protection: Parameterized queries
- XSS Prevention: Input sanitization and validation
- Code Splitting: Dynamic imports for better loading
- Image Optimization: Next.js automatic image optimization
- Caching: Strategic use of React.memo and useMemo
- Bundle Analysis: Regular bundle size monitoring
- Database Indexing: Optimized queries with proper indexes
- Connection Pooling: Efficient database connections
- Redis Caching: Leaderboard and session caching
- Queue Processing: Asynchronous code execution
cd backend
npm testcd frontend
npm test- Connect your GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
- Connect your GitHub repository
- Set environment variables
- Configure PostgreSQL and Redis add-ons
- Deploy with automatic builds
- Deploy Judge0 on a VPS or cloud instance
- Configure network access
- Update backend environment variables
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Judge0: For providing the code execution engine
- Next.js Team: For the amazing React framework
- Tailwind CSS: For the utility-first CSS framework
- shadcn/ui: For the beautiful component library
- Monaco Editor: For the code editor integration
For support, email [email protected] or join our Discord community.
Built with β€οΈ for computer science students