Django-based API Service for ThinkingParrot AI Learning Platform
Backend service powering the ThinkingParrot English learning platform, providing RESTful APIs for quiz management, speech recognition, AI chatbot integration, and user progress tracking.
- ThinkingParrot - Main project overview, learning methodology, and documentation
- ThinkingParrot-Miniprogram - WeChat Mini Program frontend
- Language-Chatbot-3.0 - CNO-LSTM chatbot engine for Level 6
- Python 3.7+ / Django 2.2.5 - Backend framework
- SQLite (dev) / MySQL (prod) - Database
- PyTorch - Deep learning framework
- CNO-LSTM - Chaotic Neural Oscillatory LSTM for chatbot
- NLTK / Word2Vec - NLP for answer judging
- Google Cloud - Speech-to-Text & Text-to-Speech APIs
- WeChat API - User authentication
ThinkingParrot-Backend/
│
├── Chatbot/ # CNO-LSTM chatbot module
│ ├── ChaoticLSTM.py
│ ├── Chatbot.py
│ └── LeeOscillator.py
│
├── miniproject/ # Django project
│ ├── manage.py
│ │
│ ├── miniproject/ # Project settings
│ │ ├── settings.py
│ │ ├── urls.py
│ │ ├── views.py # Chatbot API (Level 6)
│ │ └── wsgi.py
│ │
│ ├── questionRecord/ # Main app
│ │ ├── models.py # 9 database models
│ │ ├── views.py # 26 API functions
│ │ ├── urls.py
│ │ ├── audioRecognize.py # Speech recognition & NLP judging
│ │ ├── forms.py
│ │ └── migrations/ # Database migrations
│ │
│ ├── static/ # Static files (CSS, images)
│ └── template/ # HTML templates & Excel files
│
├── diagrams/ # Architecture diagrams
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
└── README.md # This file
- Speech-to-Text via Google Cloud
- NLP-based judging using Word2Vec
- 75% similarity threshold
- Real-time feedback
- Powered by Language-Chatbot-3.0
- CNO-LSTM for natural conversations
- Context-aware responses
- Realistic English practice
- Upload lectures via Excel files
- Bulk database operations
- Dynamic question generation
- Rankings & leaderboards
- Daily check-ins
- Progress tracking
- Wrong answer review
POST /ChatbotGetMessage/- AI conversation (Level 6)
POST /questionRecord/userinfo- Login/registrationPOST /questionRecord/getUserInformation/- User profilePOST /questionRecord/getUserRank/- User rankGET /questionRecord/getRank/- Top 100 leaderboardPOST /questionRecord/signAddScore/- Daily check-in
GET /questionRecord/GetLectures/- Available lecturesPOST /questionRecord/getNewQuestion/- Get questions by levelPOST /questionRecord/getOneQuesiton/- Single questionPOST /questionRecord/getWrongQuestion/- Wrong questionsPOST /questionRecord/judgeAnswer/- Judge answer (text/audio)POST /questionRecord/recordAnswer/- Record resultPOST /questionRecord/correctAnswer/- Mark corrected
POST /questionRecord/getHistoryNum/- History countPOST /questionRecord/getWrongNum/- Wrong countPOST /questionRecord/getNotesCollection/- Get collectionsPOST /questionRecord/toCollect/- Add to collectionPOST /questionRecord/toCancelCollect/- Remove from collection
GET /questionRecord/textToSpeechEN/- Generate English audio (MP3)GET /questionRecord/textToSpeechEN_CN/- Generate audio (SSML)
POST /questionRecord/lectureUpdate- Upload/update lecturesPOST /questionRecord/refreshDatabase/- Refresh from ExcelPOST /questionRecord/addNewQuestion/- Add questionsPOST /questionRecord/recognize- Direct audio recognition
9 main models power the learning system:
| Model | Purpose |
|---|---|
Unit |
Learning units/lectures |
Concept |
English concepts |
Example |
Example sentences |
Level2, Level3, Level4 |
Question types |
CommonUser |
User profiles |
Progress |
Learning progress |
History |
Question history |
Wrong |
Wrong answers |
NotesCollection |
Collections |
DailyRank |
Rankings |
- Python 3.7+
- Google Cloud account (Speech & TTS APIs)
- WeChat Mini Program account
- MySQL (production) or SQLite (development)
# 1. Clone repository
git clone https://github.com/liafonx/ThinkingParrot-Backend.git
cd ThinkingParrot-Backend
# 2. Install dependencies
pip install -r requirements.txt
# 3. Create key directory and add your credentials
cd miniproject
mkdir key
# Add these files to key/:
# - django.key (Django secret key)
# - miniprogram.key (WeChat app secret)
# - database.json (Database config)
# - radiant-snow-api.json (Google Cloud service account)
# 4. Run migrations
python manage.py migrate
# 5. Start server
python manage.py runserverServer runs at http://localhost:8000/
For project overview and learning methodology, visit ThinkingParrot

