How ziyad-alabduljabbar/al-warraq works
Al-Warraq is a Flask academic-book discovery and recommendation application. Students search the catalogue, optionally using corrected queries or personalized signals from interests and favorites; the application returns book results and supports book-detail chatbot conversations. Account management and favorites persist through the application database. The README also documents Groq and SambaNova chatbot providers. The main runtime is concentrated in app.py; excerpts do not expose every route or model, so some capability links rely on the README rather than sampled route code.
Main entry points: app.py Book search · templates Web interface · app.js Chat interface · train_model.py Model preparation
Components 21
Web experience
- Web interface
templates - Browser interactions
static/app.js - Application routes
app.py
Book discovery
- Book search
app.py - Query correction
app.py - TF-IDF recommender
app.py - Interest recommendations
app.py - Favorite-based recommendations
app.py - Book details
templates/book_details.html
Accounts and personalization
- Authentication
app.py - Profile and password
templates/profile.html - Favorites management
app.py - Application database
app.py
AI librarian
- Chat interface
static/app.js - Chatbot service
app.py - Groq API
- SambaNova API
Catalogue artifacts
- Model preparation
train_model.py - Book dataset
dataset/AlWarraq_Final_Version.csv - TF-IDF artifacts
models
Other components
- Student
Connections 23
- Student → Web interface: uses
README.md - Web interface → Application routes: submits requests
app.py - Browser interactions → Application routes: posts chat
static/app.js - Application routes → Book search: routes search
app.py - Book search → Query correction: corrects query
README.md - Book search → TF-IDF recommender: gets recommendations
app.py - Book search → Interest recommendations: uses interests
app.py - Book search → Favorite-based recommendations: uses favorites
app.py - TF-IDF recommender → TF-IDF artifacts: loads artifacts
app.py - Application routes → Book details: renders pages
app.py - Student → Authentication: registers or logs in
README.md - Application routes → Authentication: handles accounts
app.py - Authentication → Application database: queries users
app.py - Student → Profile and password: manages profile
README.md - Application routes → Favorites management: handles favorites
app.py - Favorites management → Application database: reads and writes
app.py - Book search → Application database: reads favorites
app.py - Student → Chat interface: asks about books
README.md - Chat interface → Chatbot service: sends context
static/app.js - Chatbot service → Groq API: queries provider
README.md - Chatbot service → SambaNova API: falls back
README.md - Book dataset → Model preparation: provides book data
train_model.py - Model preparation → TF-IDF artifacts: saves model files
train_model.py