Skip to content

Wert1996/interactive-tutor-be

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Tutor Backend

A FastAPI-based backend application for an interactive tutoring system with WebSocket support.

Project Overview

Interactive Tutor Backend powers real-time, AI-assisted learning experiences. It manages users, sessions, courses, dashboards, and orchestrates WebSocket-based tutoring flows. Optional integrations for language and speech services are available via modules in app/resources (OpenAI, ElevenLabs, Deepgram).

Frontend: The companion React frontend lives in the interactive-tutor-v3 codebase.

Demo

Watch a short walkthrough of the experience: Loom demo.

Features

  • FastAPI web framework
  • WebSocket support for real-time communication
  • CORS configuration for localhost development
  • Modular structure with separate routes and logic folders
  • Learning interface WebSocket endpoint

Project Structure

interactive-tutor-be/
├── main.py                    # Main application entry point
├── requirements.txt           # Python dependencies
├── routes/                    # API routes
│   ├── __init__.py
│   └── websocket_routes.py    # WebSocket routes
├── logic/                     # Business logic
│   ├── __init__.py
│   ├── websocket_manager.py   # WebSocket connection management
│   └── learning_interface.py  # Learning interface logic
└── README.md

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python main.py

Or using uvicorn directly:

uvicorn main:app --reload --host 0.0.0.0 --port 8000

API Endpoints

HTTP Endpoints

  • GET / - Root endpoint
  • GET /health - Health check endpoint

WebSocket Endpoints

  • WS /learning-interface - Main learning interface WebSocket

WebSocket Message Types

The /learning-interface WebSocket endpoint supports the following message types:

Client to Server Messages

  1. Ping
{
  "type": "ping"
}
  1. Learning Request
{
  "type": "learning_request",
  "topic": "mathematics",
  "difficulty": "beginner"
}
  1. User Response
{
  "type": "user_response",
  "content": "user input text",
  "session_id": "session_123"
}
  1. Session Start
{
  "type": "session_start",
  "session_id": "session_123",
  "user_name": "John Doe"
}
  1. Session End
{
  "type": "session_end",
  "session_id": "session_123"
}

Server to Client Responses

The server responds with appropriate JSON messages based on the request type, including error handling and timestamps.

CORS Configuration

The application is configured to allow CORS requests from:

Development

To run in development mode with auto-reload:

uvicorn main:app --reload

The application will be available at http://localhost:8000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages