Welcome to LearnWay Backend
LearnWay is a comprehensive backend service that powers a next-generation learning platform. Built with NestJS on Node.js, it combines traditional course management with cutting-edge features: blockchain-backed rewards, AI tutoring, competitive quiz battles, and a rich gamification layer.Quick Start
Get the server running locally in under 10 minutes
Architecture Overview
Understand how all systems fit together
API Reference
Browse every endpoint with examples
Environment Variables
Configure your environment correctly
What LearnWay Does
LearnWay is more than an LMS. It is a learn-and-earn platform where users complete structured learning paths, compete in quiz battles, and earn verifiable on-chain recognition (XP points, in-app Gems, NFT badges, and Course Certificates) for their progress.Core Feature Areas
π Courses & Learning Paths
π Courses & Learning Paths
Hierarchical content structure: Learning Paths β Courses β Lessons β
Slides. Admins publish content through the admin API; users consume it
through the user API. Both premium and free tiers are supported via the
subscription system.
π€ AI Features
π€ AI Features
- AI Tutor: Powered by Google Gemini. Users can ask the AI tutor questions about any lesson, get explanations, summaries, quiz hints, and more. Responses are Redis-cached per lesson for 24 h. - AI Assessment: A personalised onboarding quiz that evaluates a new userβs existing skill level and recommends an appropriate learning path. - Career Roadmap Generator: Given a career goal, the system generates a structured roadmap of learning paths and courses.
π Gamification
π Gamification
- XP & Gems: Earned by completing lessons, quizzes, battles, and contests. Computational gamification values powering levels, leaderboards, streak freezes, and battle stakes. - Badges: ERC-721 NFT badges minted on-chain when milestone thresholds are hit. - Leaderboard: Weekly and monthly global and category leaderboards. - Contests: Time-boxed competitive events with prize pools. - Quiz Battles: Real-time 1-v-1 or bot-assisted quiz battles via WebSocket.
βοΈ Blockchain Integration
βοΈ Blockchain Integration
LearnWay runs on Lisk L2 (OP Stack rollup). XP and Gems are managed by custom on-chain gamification and accounting state contracts (
XPContract and GemContract); badges are ERC-721 NFTs and course certificates are ERC-1155 credentials. All contracts are coordinated by LearnWayManager and governed by LearnWayAdmin.π³ Payments
π³ Payments
Users can on-ramp fiat to USDT / fUSD via Fonbnk, a mobile-money gateway. Supported fiat currencies include NGN,
KES, GHS, UGX, ZAR, and BRL.
π Notifications
π Notifications
Push notifications via Firebase Cloud Messaging (FCM), in-app notifications
via WebSocket, email via Resend, and admin-targeted notification campaigns.
π Certificates
π Certificates
On-chain certificates are minted when a user completes a
certificate-eligible course. Certificate metadata is stored on IPFS and the
NFT is minted via the
LearnwayManager contract.Tech Stack at a Glance
API Versioning
All endpoints are prefixed with/api/v2/. There are two separate Swagger UIs:
- User API β
https://learnway-backend-dev.up.railway.app/api/v2/docs#/(Local:/api/v2/docs) - Admin API β
https://api.learnway.app/api/v2/admin-docs#(Local:/api/v2/admin-docs)