A Django-based LMS for neurologic music therapy education built for NMTSA, serving two audiences:
- Healthcare professionals pursuing continuing education (CE) and NMT certification
- Clients/families needing free resources and premium courses to support therapy journeys
This LMS consolidates scattered resources (previously on Google Drive) into a secure, trackable platform with dual authentication, autism-friendly UI, course management, video streaming, payments, certificates, discussions, and an AI assistant.
- Dual authentication and RBAC
- OAuth (Auth0) for Students/Teachers
- Django Admin auth for Admins (admins do NOT use OAuth)
- Teacher onboarding + verification workflow (admin approval required)
- Course management (courses → modules → lessons)
- Lesson types: VideoLesson (file + transcript) and BlogLesson (content + images)
- Publish/review process with auto-unpublish on edits
- Student enrollment and progress tracking
- Completed lessons, video resume (last position), completion thresholds
- Payments (PayPal)
- Paid/free courses, capture + idempotent processing
- Certificates for CE credits (PDF generation with metadata)
- Discussions per course/module
- AI chat assistant with memory + semantic course search (Supermemory)
- Accessibility and autism-friendly UI
- 4 themes (Light/Dark/High Contrast/Minimal), font size controls, zero animations/auto-play
- Localization (EN/ES), SEO + sitemaps
- Analytics (engagement, completions), export CSV
nmtsa_lms/— Django project rootmanage.py— Django CLI entrynmtsa_lms/— core settings, URLs, OAuth views, Tailwind pipelineauthentication/— custom user, profiles, OAuth session middleware, onboardingteacher_dash/— course and lesson modeling, review workflowstudent_dash/— enrollment, progressadmin_dash/— admin verification + course reviewlms/— shared models, AI chat/search APIs, sitemaps, course memorystatic/andtemplates/— Tailwind CSS, base templates and components
docs/— project documentation, integration guides, SRS
See also: docs/SRS_NMTSA_LMS_FULL.md for the complete SRS.
- Backend: Python 3.10+, Django 4.x+
- Frontend: Django templates + Tailwind CSS
- Auth: Auth0 (OAuth/OIDC) for users, Django admin for admins
- Payments: PayPal Checkout/Payments
- AI: Supermemory (chat and semantic search)
- Database: SQLite (dev), PostgreSQL (prod recommended)
- Video: HTML5 video, optional MoviePy utilities
- Python 3.10+
- Node.js 18+ and npm (for Tailwind)
- An Auth0 tenant (Domain, Client ID, Client Secret)
- PayPal credentials (Sandbox first: Client ID/Secret)
- Supermemory API key and base URL
On Windows using bash.exe (Git Bash/WSL-friendly commands below).
- Clone and create a virtual environment
git clone https://github.com/2025-Arizona-Opportunity-Hack/Coderz-NMTSAEducationPlatfo.git nmtsaeducationlms
cd nmtsaeducationlms
python -m venv .venv
source .venv/Scripts/activate- Install Python dependencies
pip install -r requirements.txt- Install Tailwind dependencies
cd nmtsa_lms
npm install
cd ..- Create a
.envfile at the repo root
cat > .env << 'EOF'
# Django
SECRET_KEY=change-me
DEBUG=true
ALLOWED_HOSTS=localhost,127.0.0.1
# Auth0 (OAuth for Students/Teachers only)
AUTH0_DOMAIN=your-tenant.us.auth0.com
AUTH0_CLIENT_ID=your-auth0-client-id
AUTH0_CLIENT_SECRET=your-auth0-client-secret
# PayPal
PAYPAL_CLIENT_ID=your-paypal-sandbox-client-id
PAYPAL_CLIENT_SECRET=your-paypal-sandbox-client-secret
PAYPAL_MODE=sandbox
# Supermemory
SUPERMEMORY_API_KEY=your-supermemory-key
SUPERMEMORY_BASE_URL=https://api.supermemory.ai
SUPERMEMORY_PROJECT_ID=nmtsa-lms
# Google Gemini (free tier)
GEMINI_API_KEY=your-gemini-api-key
# Database (dev)
# SQLite is default; for Postgres (prod), prefer: DATABASE_URL=postgres://user:pass@host:5432/dbname
# DATABASE_URL=postgres://...
EOF- Apply migrations and create an admin user
cd nmtsa_lms
python manage.py migrate
python manage.py createsuperuser
# After login to Django admin, set role='admin' and onboarding_complete=True for your admin user- (Optional) Seed demo data
python manage.py seed_demo_courses- Start the dev servers in two terminals
- Terminal A (Django):
cd nmtsa_lms
python manage.py runserver- Terminal B (Tailwind CSS watcher):
cd nmtsa_lms
npm run devVisit http://127.0.0.1:8000
- Students/Teachers: Use OAuth via Auth0.
- Flow:
/login→ Auth0 →/callback→ Select Role (if first time) → Onboarding → Dashboard - Session key:
request.session['user']withuserinfo,role,onboarding_complete
- Flow:
- Admins: Use Django credentials at
/auth/admin-login/.- Admins do NOT use OAuth; enforced by role selection and decorators.
RBAC decorators (enforced at view level):
login_required,student_required,teacher_required,admin_required,teacher_verified_required,onboarding_complete_required
- Teacher onboarding + verification
- Teacher uploads resume/certifications → status
pending→ Admin approves/rejects - Only approved teachers can create/edit courses
- Teacher uploads resume/certifications → status
- Course review and publish
- Create course → add modules/lessons → submit for review
- Admin approves → Teacher can publish
- Editing a published course auto-unpublishes and re-submits for review
- Student progress and CE certificate
- Enrollment tracks progress; video resume stored; completion triggers certificate generation (PDF)
- Payments (PayPal)
- Paid courses require checkout; sandbox and live supported; webhook/idempotent processing recommended
- Discussions
- Course/module discussions with moderation controls (teachers/admins)
- AI chat + semantic search
- Available to all users (including guests); integrates with Supermemory; course data can be synced to memory
- Dev watch:
npm run dev(innmtsa_lms) - Production build:
npm run build
Tailwind compiles static/css/input.css → static/css/output.css. Ensure templates reference the generated output.
cd nmtsa_lms
python manage.py testTargeted apps:
authentication/tests.pyteacher_dash/tests.pylms/tests.pystudent_dash/tests.py
- Set
PAYPAL_ENV=sandboxand provide sandbox credentials in.env. - Start the app, set a course to paid with a price.
- Use a PayPal sandbox buyer to complete a test purchase.
- Verify enrollment unlock and transaction state stored.
See docs/PAYPAL_QUICK_TEST.md and docs/PAYPAL_INTEGRATION_SUMMARY.md for details.
- Provide
SUPERMEMORY_API_KEY,SUPERMEMORY_BASE_URL, andSUPERMEMORY_PROJECT_IDin.env. - Chat endpoints (REST):
GET /lms/api/chat/rooms/GET /lms/api/chat/rooms/<id>/messages/POST /lms/api/chat/rooms/<id>/send/POST /lms/api/chat/rooms/<id>/typing/GET /lms/api/chat/rooms/<id>/typing/status/
- Semantic course search:
POST /lms/api/courses/search/ - Course memory syncing: see
lms/course_memory.pyandlms/supermemory_client.py.
Refer to docs/SUPERMEMORY_SETUP_GUIDE.md and docs/CHAT_IMPLEMENTATION.md for end-to-end steps.
Below is a quick, practical guide to get credentials and wire them up with this repo. For deeper context, see the docs referenced at the end of each section.
What you’ll create in Auth0:
- A Regular Web Application (OIDC)
Allowed URLs (must match your Django routes):
- Allowed Callback URLs: http://127.0.0.1:8000/callback
- Allowed Logout URLs: http://127.0.0.1:8000/
- Allowed Web Origins: http://127.0.0.1:8000
Steps:
- Sign in at https://manage.auth0.com and create a Regular Web Application.
- In Settings, set the Allowed URLs exactly as above for local dev.
- Copy Domain, Client ID, and Client Secret.
- Add these to your
.envat the repo root:- AUTH0_DOMAIN=your-tenant.us.auth0.com
- AUTH0_CLIENT_ID=...
- AUTH0_CLIENT_SECRET=...
- Start the server and test the flow:
- Visit http://127.0.0.1:8000/login
- Complete Auth0 login
- You’ll be routed to role selection → onboarding → dashboard
Notes:
- Admins use Django username/password at /auth/admin-login/ (not Auth0).
- If you see a redirect_mismatch error, re-check your Callback/Logout URLs.
See also: docs/AUTH_SYSTEM_SUMMARY.md, docs/AUTHENTICATION_COMPLETE.md.
What you’ll get:
- An API key (optionally a project ID; base URL defaults to https://api.supermemory.ai)
Steps:
- Create an account at https://supermemory.ai and generate an API key.
- Add to your
.env:- SUPERMEMORY_API_KEY=...
- SUPERMEMORY_BASE_URL=https://api.supermemory.ai
- SUPERMEMORY_PROJECT_ID=nmtsa-lms
- Install required packages (already listed in requirements.txt):
- supermemory
- openai (used for Google Gemini via Memory Router)
- Seed and sync memories (optional but recommended):
- python manage.py seed_website_memory
- python manage.py sync_courses_to_memory
Test:
- Chat endpoints under /lms/api/chat/... will respond using memory.
- Semantic search via POST /lms/api/courses/search/.
See also: docs/SUPERMEMORY_SETUP_GUIDE.md, docs/SUPERMEMORY_INTEGRATION_SUMMARY.md, docs/CHAT_IMPLEMENTATION.md, docs/SUPERMEMORY_QUICK_REF.md.
What you’ll get:
- A free API key from Google AI Studio.
Steps:
- Visit https://makersuite.google.com/app/apikey and create an API key.
- Add to your
.env:- GEMINI_API_KEY=AIza... (your key)
- Ensure packages are installed (requirements.txt includes openai which powers Gemini via Memory Router).
How it’s used here:
- The
lms/supermemory_client.pyuses Supermemory’s Memory Router with Gemini to generate responses while injecting relevant memories. - Env var is read in
nmtsa_lms/settings.pyand in the Supermemory client.
Troubleshooting:
- If chat returns a configuration error, verify SUPERMEMORY_API_KEY and GEMINI_API_KEY are present and correct.
- Check server logs for “Supermemory not configured” or OpenAI client initialization errors.
Recommended stack: Nginx → Gunicorn/Uvicorn → Django (ASGI) + Postgres + object storage (for media) + CDN (optional)
- Environment
- Set
DEBUG=false, strongSECRET_KEY, andALLOWED_HOSTSto your domain(s) - Configure
DATABASE_URLto PostgreSQL - Configure Auth0/PayPal/Supermemory for production (new credentials)
- Build assets
cd nmtsa_lms
npm run build- Collect static files
cd nmtsa_lms
python manage.py collectstatic --noinput- Run migrations
cd nmtsa_lms
python manage.py migrate- Start application server
- Example (ASGI with Gunicorn + Uvicorn worker):
gunicorn nmtsa_lms.asgi:application -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000- Configure Nginx
- Proxy
location /to127.0.0.1:8000 - Serve static (
/static/) and media (/media/) from disk or object storage/CDN - Enable HTTPS (Let’s Encrypt recommended) and HSTS
- Media storage (recommended)
- Use S3-compatible storage for
media/and a CDN for performance
- Background tasks (optional)
- Add Redis + Celery for long-running tasks if needed
- Monitoring
- Logs, metrics, and uptime checks; consider error reporting tools
- DEBUG=false in production
- Strong
SECRET_KEY; rotate credentials regularly ALLOWED_HOSTSrestricted to known domains- CSRF and session cookies set
Secure,HttpOnly,SameSite - CORS locked to allowed origins only
- Security headers: CSP, X-Frame-Options, X-Content-Type-Options, HSTS via proxy
- Validate/sanitize uploads (MIME types, size limits)
- Minimal PII; no PHI; adhere to OWASP Top 10 mitigations
- Admin actions and payment events audited
- OAuth redirect mismatch
- Ensure Auth0 callback URL matches your
http(s)://<host>/callback
- Ensure Auth0 callback URL matches your
- Static/Tailwind not updating
- Verify
npm run devis running or re-runnpm run build
- Verify
- Database errors after pull
- Run
python manage.py migrateand optionallypython manage.py makemigrations
- Run
- Admin login not working
- Use
/auth/admin-login/and ensure your user hasrole='admin'andonboarding_complete=True
- Use
- Media not loading in prod
- Check storage configuration and Nginx location blocks
# Activate venv (Windows bash)
source .venv/Scripts/activate
# Migrations
cd nmtsa_lms
python manage.py makemigrations
python manage.py migrate
# Run dev server
python manage.py runserver
# Tailwind
npm run dev # watch
npm run build # production build
# Seed demo
python manage.py seed_demo_courses
# Tests
python manage.py test- SRS:
docs/SRS_NMTSA_LMS_FULL.md - Auth:
docs/AUTH_SYSTEM_SUMMARY.md,docs/AUTHENTICATION_COMPLETE.md - Payments:
docs/PAYPAL_INTEGRATION_SUMMARY.md,docs/PAYPAL_QUICK_TEST.md - AI Chat/Search:
docs/CHAT_IMPLEMENTATION.md,docs/SUPERMEMORY_SETUP_GUIDE.md - Localization:
docs/LOCALIZATION_GUIDE_EN_ES.md - SEO/Sitemaps/Schema:
docs/SEO_COMPLETE_CHECKLIST.md,docs/SCHEMA_IMPLEMENTATION_GUIDE.md
Built for NMTSA to reduce administrative burden, create new revenue streams, and provide better support for families and healthcare professionals through evidence-based educational content.
Please replace the placeholder values below with your real links and names before submission.
- Team name: NMTSA-LMS Team
- Team members: Alice Example, Bob Example, Carol Example (replace with real names)
- Slack channel: #nmtsa-lms (replace with your workspace channel or invite link)
Problem statement
- Provide an accessible, trackable online learning platform for neurologic music therapy education that supports dual authentication, teacher verification, course review workflows, student progress tracking, and an AI assistant for search and chat.
Live demo / Judges
- Working project (live/demo): <REPLACE_WITH_LIVE_URL>
- DevPost: <REPLACE_WITH_DEVPOST_URL>
- Final demo video: <REPLACE_WITH_FINAL_VIDEO_URL>
Designs & repo links
- Figma (designs): <REPLACE_WITH_FIGMA_LINK>
- GitHub (this repo): <REPLACE_WITH_GITHUB_REPO_URL>
Notes
- The canonical "Tech Stack" and "Quick Start (Development)" / run instructions are provided earlier in this README — please use those sections as the authoritative source to avoid duplication.
- Replace all <REPLACE_...> placeholders with final values before submitting to judges. If you send me the final values I can fill them in for you.