Open-Source Student Coding Performance Analytics Platform
Features β’ Quick Start β’ Documentation β’ Contributing
- Overview
- The Problem
- Our Solution
- Key Features
- System Architecture
- Technology Stack
- Quick Start
- API Documentation
- Security
- Roadmap
- Contributing
- License
CodeLens is a comprehensive analytics platform designed for educational institutions to track, analyze, and improve students' coding proficiency through structured performance snapshots, data-driven insights, and dynamic leaderboards.
Transform manual, inconsistent coding performance tracking into a structured, measurable, transparent system that enables data-driven student development and mentoring at institutional scale.
- Self-Hosted: Each college deploys its own instance
- Single-Tenant: Complete data isolation per institution
- Scalable: Handles 500β5000+ students per deployment
Most educational institutions face critical challenges in coding education management:
|
|
graph LR
A[Student] --> B[Performance Snapshot]
B --> C[Approval Workflow]
C --> D[Analytics Engine]
D --> E[Leaderboards]
D --> F[Growth Metrics]
D --> G[Insights]
style A fill:#667eea
style B fill:#764ba2
style C fill:#f093fb
style D fill:#4facfe
style E fill:#00f2fe
style F fill:#43e97b
style G fill:#38f9d7
Snapshots are the source of truth.
Analytics are computed from snapshots.
Leaderboards are generated from analytics.
This separation ensures scalability, clarity, and long-term maintainability.
| π Authentication | π₯ Role Management | π Analytics | π Leaderboards |
|---|---|---|---|
| JWT-based auth | 5-tier hierarchy | Growth tracking | Class/Dept/Institution |
| Secure password hashing | Multi-role support | Weekly/Monthly metrics | Real-time rankings |
| Session management | Permission enforcement | Historical trends | Multi-platform aggregation |
- π Track progress across multiple platforms (LeetCode, Codeforces, etc.)
- π View personal analytics and growth metrics
- π See class/department rankings
- π Historical performance timeline
- π Monitor assigned students' progress
- β Approve/reject performance snapshots
- π Identify struggling students early
- π Batch approval workflows
- π’ Department-wide analytics
- π Comparative performance analysis
- π― Identify at-risk students
- π Track cohort improvement
- ποΈ Department management
- π₯ Staff & student assignment
- π Department-level insights
- π Placement readiness tracking
- βοΈ System configuration
- π€ User management
- π’ Department setup
- π Institution-wide analytics
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Layer (React SPA) β
β Components β’ Pages β’ Routes β’ State Management β’ API Client β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β HTTPS/REST API
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Application Layer (Flask) β
β ββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ β
β β Auth β Students β Snapshotsβ Analyticsβ Admin β β
β β Blueprintβ Blueprintβ Blueprintβ Blueprintβ Blueprintβ β
β ββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Business Logic β’ Authorization β’ Validation β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β SQLAlchemy ORM
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Database Layer (PostgreSQL) β
β Users β’ Students β’ Departments β’ Snapshots β’ Analytics β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sequenceDiagram
participant S as Student
participant P as Platform API
participant A as Advisor/Counsellor
participant D as Database
participant L as Leaderboard
S->>P: Submit Snapshot
P->>D: Store (status: pending)
A->>D: Review Snapshot
D->>D: Update (status: approved)
D->>L: Trigger Analytics
L->>D: Compute Rankings
D->>S: Display Analytics
| Layer | Technology | Purpose |
|---|---|---|
| Runtime | Python 3.10+ | Server-side language |
| Framework | Flask 3.1.2 | Web application framework |
| Database | PostgreSQL 15 | Relational data storage |
| ORM | SQLAlchemy 2.0 | Database abstraction |
| Migration | Alembic | Schema versioning |
| Auth | Flask-JWT-Extended | JWT token management |
| Password | bcrypt | Password hashing |
| Frontend | React 18 + Vite | UI library + build tool |
| Styling | Tailwind CSS | Utility-first CSS |
| Charts | Recharts | Data visualization |
| Container | Docker + Compose | Containerized deployment |
| Proxy | Nginx | Reverse proxy (production) |
# 1. Clone the repository
git clone https://github.com/sangsaist/codelens.git
cd codelens
# 2. Configure environment
cp .env.example .env
# Edit .env with your settings (DB password, JWT secret, etc.)
# 3. Start all services
docker-compose -f docker-compose.dev.yml up -d --build
# 4. Initialize database
docker-compose -f docker-compose.dev.yml exec backend flask db upgrade
# 5. Seed roles
docker-compose -f docker-compose.dev.yml exec backend python -c \
"from app import create_app; from app.auth.seed import seed_roles; app = create_app(); app.app_context().push(); seed_roles()"
# 6. Generate & import test data
docker-compose -f docker-compose.dev.yml exec backend python scripts/generate_all_data.py
docker-compose -f docker-compose.dev.yml exec backend python scripts/seed_data.py
# 7. Open the app
# Frontend: http://localhost:5173
# Backend: http://localhost:5000See the full Setup Guide for step-by-step manual installation.
| Role | Password | |
|---|---|---|
| Admin | admin@college.edu |
Admin@12345 |
| HOD (CSE) | hod.cse@college.edu |
Hod@12345 |
| Student | See backend/data/students.csv |
Student@123 |
π Student emails are randomly generated. Check
backend/data/students.csvfor exact emails.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/auth/register |
Register new user | No |
POST |
/auth/login |
Login and receive JWT | No |
GET |
/analytics/my-summary |
Student dashboard data | Student+ |
GET |
/analytics/institution-summary |
Institution overview | Admin/HOD |
GET |
/platforms/my |
Linked platform accounts | Student+ |
POST |
/platforms/link |
Link coding platform | Student+ |
POST |
/snapshots |
Submit performance snapshot | Student+ |
GET |
/counsellor/pending-snapshots |
Review queue | Advisor+ |
PUT |
/counsellor/snapshots/<id>/approve |
Approve snapshot | Advisor+ |
POST |
/staff/create |
Create staff member | Admin/HOD |
GET |
/staff/my-team |
View team hierarchy | Staff+ |
GET |
/academics/departments |
List departments | Any |
π API Request/Response Examples
Login:
curl -X POST http://localhost:5000/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "admin@college.edu",
"password": "Admin@12345"
}'Response:
{
"success": true,
"message": "Login successful",
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "admin@college.edu",
"full_name": "System Administrator",
"roles": ["admin"]
}
}
}- β JWT Authentication β Stateless, token-based auth
- β Password Hashing β bcrypt with salt
- β Role-Based Access Control β 5-tier hierarchical permissions (Admin β HOD β Counsellor β Advisor β Student)
- β SQL Injection Prevention β SQLAlchemy ORM parameterized queries
- β CORS Protection β Configurable origin restrictions
- β Non-root Docker containers β Least-privilege execution
- β Secrets via environment variables β No hardcoded credentials in code
β οΈ Production Security Checklist
- Generate strong JWT secret:
openssl rand -hex 32 - Set strong database password
- Restrict CORS to your institution's domain
- Configure HTTPS with valid SSL certificates
- Implement rate limiting (Flask-Limiter)
- Enable audit logging
- Set up database backups
- Keep dependencies updated
Project started: February 2025 β currently in active development.
- β JWT authentication & role-based access control
- β 5-tier role hierarchy (Admin, HOD, Counsellor, Advisor, Student)
- β Department & academic structure management
- β Student profile management
- β Manual performance snapshot entry
- β Snapshot approval workflow
- β Basic analytics & growth metrics
- β Leaderboard generation
- β React frontend with role-based dashboards
- β Docker dev & production deployment
- β Bulk data import via CSV
- π§ HOD student-to-advisor assignment (in progress)
- π Automated LeetCode data sync
- π Automated GitHub activity tracking
- π Background job processing (Celery/Redis)
- π Snapshot auto-generation from synced data
- π Email notifications
- π Placement readiness scoring
- π At-risk student detection
- π Performance trend visualization
- π Department comparative analysis
- π Custom report builder
- π€ Personalized learning recommendations
- π€ Predictive analytics
- π€ Smart mentoring suggestions
- π€ Automated risk alerts
codelens/
βββ backend/
β βββ app/
β β βββ auth/ # Login, Register, Roles
β β βββ staff/ # Staff Profiles (HOD, Advisor, Counsellor)
β β βββ academics/ # Departments & Batches
β β βββ students/ # Student Profiles
β β βββ platforms/ # External Account Linking
β β βββ snapshots/ # Progress Tracking
β β βββ analytics/ # Data Aggregation
β β βββ counsellor/ # Review Dashboards
β β βββ review/ # Approval Logic
β β βββ common/ # Utilities (RBAC, Responses)
β β βββ setup/ # Bootstrapping Scripts
β β βββ __init__.py # App Factory
β βββ scripts/ # Data generation & seeding
β βββ migrations/ # Alembic DB migrations
β βββ data/ # Generated CSV test data
β βββ Dockerfile
β βββ requirements.txt
β βββ run.py
βββ frontend/
β βββ src/
β β βββ api/ # Axios API clients
β β βββ context/ # React context (Auth)
β β βββ hooks/ # Custom hooks
β β βββ pages/ # Page components
β β βββ routes/ # Route definitions
β β βββ utils/ # Utility functions
β βββ Dockerfile
β βββ nginx.conf
β βββ package.json
βββ nginx/ # Reverse proxy (production)
βββ docs/ # Documentation
βββ docker-compose.dev.yml # Development environment
βββ docker-compose.prod.yml # Production environment
βββ .env.example # Environment template
βββ .gitignore
Contributions are welcome! Whether it's bug reports, feature requests, or code β your input helps make CodeLens better.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'feat: Add your feature' - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
- π Report bugs via GitHub Issues
- π‘ Suggest features via GitHub Discussions
This project is licensed under the MIT License β see the LICENSE file for details.
- π Architecture β System design & data flow
- βοΈ Setup Guide β Docker & manual installation
- π¨ Frontend Guide β React components & pages
Making Coding Education Data-Driven, One Institution at a Time
Β© 2025 CodeLens. Open Source Project under MIT License.