How mahirqt/askly works
Project type and purpose
• This is a full-stack, Flask-based web application (“Askly-doubt-solving-platform”) that allows students to post doubts (text/images), routes them through an AI/NLP logic layer for parsing/classification, persists them to a database (SQLite by default, optional MongoDB), and renders HTML/CSS-based pages for users and teachers.
File structure
• Top level:
• app.py – Flask application entrypoint (all routes, AI integration, database access)
• instance/database.db – SQLite DB file (persisted data)
• requirements.txt – Python dependencies
• .gitignore
• Directories:
• templates/ – Jinja2 HTML templates for views (ask_doubt, chat, dashboard, etc.)
• static/ – CSS, JS, uploaded images
• No separate “frontend” or “backend” repos; it’s a monolithic Flask web server serving both API and UI.
Key insights from README
• Tech stack: Python/Flask backend, SQLite or MongoDB, HTML/CSS front-end, NLP-based AI logic, Postman for API testing.
• Features: ask doubts (text/image), AI-powered responses, categorization, real-time tracking, mentor connection (future).
Main components
a. Client (Web Browser) – end-user interface (students, teachers)
b. Flask Web Server – app.py:
• Routing & Controllers (HTTP endpoints for ask, solve, chat, library, dashboards)
• Business Logic / AI Layer (NLP message parser, classification, smart response generator)
• File-upload handler (static/uploads)
c. Database – SQLite (instance/database.db) or MongoDB
d. Static File Store – CSS, JS, uploaded images
e. (Optional) External AI Service or Microservice – if NLP is offloaded to a separate service or 3rd-party API
f. (Future) Mentor matching service or Notification subsystem
Relationships & interactions
• Within Flask:
• Controller calls AI Logic module → returns parsed/question classification → persists to DB
• Controller reads/writes to database
• Controller renders Jinja template + static assets → HTTP response back to Browser
• File uploads: Browser → Flask upload endpoint → Static/uploads folder
• (Optional) Flask → External AI API over HTTPS → AI response
Architectural patterns & design principles
• Monolithic MVC:
• Models: DB schemas (doubts, users)
• Views: Jinja templates + static resources
• Controllers: Flask route handlers
• Separation of concerns: routing, business logic (AI), persistence, presentation
• Future extensibility: extract AI logic into microservice; swap SQLite for MongoDB
Relevant technologies & frameworks
• Flask (WSGI server, routing, Jinja templating)
• SQLite / MongoDB driver (pymongo or SQLAlchemy)
• Python NLP libraries or external AI API (e.g., spaCy, custom model, OpenAI)
• HTML/CSS for UI; Postman for API testing