OpenLearnX
OpenLearnX is an open-source decentralized learning and assessment platform combining adaptive AI quizzes, real-time sandboxed code execution, and blockchain-based NFT certificates.
Language: TypeScript (frontend), Python (backend)
License: AGPL-3.0
npm package: @th30d4y/openlearnx
Repository: github.com/th30d4y/OpenLearnX
Features
Section titled “Features”- Adaptive learning via IRT (Item Response Theory) — questions adjust based on learner performance
- NFT certificates — ERC-721 tokens minted on Ethereum
- Multi-language sandboxed code execution: Python, JavaScript, Java, C++, Go, Rust, and more
- AI-powered quiz generation with auto-grading
- Peer review with AI-monitored grading bias detection
- Decentralized peer-to-peer encrypted chat
- Student and instructor dashboards
Tech Stack
Section titled “Tech Stack”| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19, TypeScript, TailwindCSS |
| Backend | Python 3, Flask |
| Database | MongoDB |
| Cache | Redis |
| Blockchain | Ethereum (Solidity, Foundry/Anvil) |
| Wallet | MetaMask (ethers.js v6) |
| ML/AI | TensorFlow, LLM integration |
| Storage | IPFS |
| Container | Docker |
Prerequisites
Section titled “Prerequisites”- Node.js 18+
- Python 3.10+
- MongoDB
- Git
- MetaMask browser extension
- Foundry (
forge,anvil)
Installation
Section titled “Installation”1. Install Foundry
Section titled “1. Install Foundry”curl -L https://foundry.paradigm.xyz | bashsource ~/.bashrcfoundryup2. Clone the repository
Section titled “2. Clone the repository”git clone https://github.com/th30d4y/OpenLearnX.gitcd OpenLearnX3. Start a local blockchain
Section titled “3. Start a local blockchain”Keep this terminal open while developing:
anvil --fork-url https://eth.merkle.io4. Set up the backend
Section titled “4. Set up the backend”cd backendpython3 -m venv venvsource venv/bin/activatepip install -r requirements.txtpython3 scripts/deploy.pyNote the contract address printed by deploy.py.
Create backend/.env:
FLASK_ENV=developmentSECRET_KEY=dev-secret-key-change-in-productionMONGODB_URI=mongodb://localhost:27017/openlearnxWEB3_PROVIDER_URL=http://127.0.0.1:8545CONTRACT_ADDRESS=<YOUR_DEPLOYED_CONTRACT_ADDRESS>JWT_SECRET_KEY=jwt-secret-keyStart the backend:
python3 main.pyThe API runs at http://127.0.0.1:5000.
5. Set up the frontend
Section titled “5. Set up the frontend”cd frontendpnpm installCreate frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:5000/apiNEXT_PUBLIC_CHAIN_ID=31337NEXT_PUBLIC_CONTRACT_ADDRESS=<YOUR_DEPLOYED_CONTRACT_ADDRESS>NEXT_PUBLIC_RPC_URL=http://127.0.0.1:8545Start the frontend:
pnpm run devThe frontend runs at http://localhost:3000.
6. Configure MetaMask
Section titled “6. Configure MetaMask”- Add a custom network with RPC
http://127.0.0.1:8545, Chain ID31337, symbolETH. - Import a test account using a private key printed by Anvil.
Docker
Section titled “Docker”Run the full stack with Docker Compose:
docker compose up --buildnpm Package
Section titled “npm Package”npm install @th30d4y/openlearnxProject Structure
Section titled “Project Structure”OpenLearnX/├── backend/ # Flask API, smart-contract scripts, ML models│ ├── contracts/ # Solidity smart contracts│ ├── models/ # Database models│ ├── routes/ # API route handlers│ ├── services/ # Business logic│ └── scripts/ # Deployment and utility scripts├── frontend/ # Next.js application│ ├── app/ # App Router pages│ ├── components/ # Reusable UI components│ ├── context/ # React context providers│ └── hooks/ # Custom React hooks├── chatApp/ # Decentralized chat application└── docker-compose.ymlDocumentation Files
Section titled “Documentation Files”The repository includes:
| File | Purpose |
|---|---|
DOCUMENTATION.md | Full technical documentation |
ARCHITECTURE.md | System architecture |
QUICK_START.md | Step-by-step setup guide |
SECURITY.md | Security policies |
DEPLOYMENT_COMPLETE.md | Deployment guide |