YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
HMI - Learning Management System
Full-stack learning management system with FastAPI backend and Next.js frontend.
Project Structure
hmi/
βββ backend/ # FastAPI Python backend
βββ frontend/ # Next.js React frontend
βββ .venv/ # Shared Python virtual environment
Quick Start
Prerequisites
- Python 3.11+
- Node.js 18+
- MySQL 8.0+
- Redis 6.0+
1. Setup Backend
# Install Python dependencies (venv already exists at root)
source .venv/bin/activate
pip install -r backend/requirements.txt
# Configure environment
cd backend
cp .env.example .env
# Edit .env with your database credentials
# Run backend
uvicorn app.main:app --reload --port 8000
Backend will run on http://localhost:8000
- API docs: http://localhost:8000/docs
2. Setup Frontend
cd frontend
npm install
npm run dev
Frontend will run on http://localhost:3000
Features
Backend (FastAPI)
- β JWT Authentication with OAuth2
- β Role-based access control (Teacher/Learner)
- β RESTful API with async SQLModel ORM
- β MySQL database with async driver
- β Redis integration
- β Complete learning management schema
Database Schema
- Users: Teachers and Learners
- Courses: Created by teachers
- Topics: Lesson categorization
- Lessons: Course content with tutorial URLs
- Enrollments: Learner course registration
- Lesson Progress: Track completed lessons
Frontend (Next.js)
- βοΈ React 19 with Next.js 16
- π¨ Tailwind CSS 4
- π± Responsive design
- π Authentication integration (to be implemented)
API Endpoints
See backend/README.md for complete API documentation.
Main Routes
/api/v1/login/access-token- Authentication/api/v1/users/- User management/api/v1/courses/- Course CRUD/api/v1/lessons/- Lesson management/api/v1/topics/- Topic management/api/v1/enrollments/- Course enrollment & progress
Development
Backend Development
cd backend
source ../.venv/bin/activate
# Run with hot reload
uvicorn app.main:app --reload
# Run tests (when implemented)
pytest
Frontend Development
cd frontend
# Development server
npm run dev
# Build for production
npm run build
# Lint code
npm run lint
Database Setup
-- Create database
CREATE DATABASE appdb;
-- Tables are auto-created by SQLModel on startup
For production, use migrations:
cd backend
pip install alembic
alembic init migrations
alembic revision --autogenerate -m "Initial migration"
alembic upgrade head
Environment Variables
Backend (.env)
DATABASE_URL=mysql+asyncmy://user:password@127.0.0.1:3306/appdb
REDIS_URL=redis://127.0.0.1:6379/0
SECRET_KEY=your-secret-key-change-in-production
Frontend (.env.local)
NEXT_PUBLIC_API_URL=http://localhost:8000
Docker Deployment (Coming Soon)
docker-compose up
Tech Stack
Backend:
- FastAPI
- SQLModel + SQLAlchemy (async)
- MySQL (asyncmy driver)
- Redis
- Python-JOSE (JWT)
- Pydantic validation
Frontend:
- Next.js 16
- React 19
- Tailwind CSS 4
- TypeScript
License
MIT
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support