samiahraf/study-dost-ai
Sobre
๐ง Study Dost AI - Your AI study buddy that explains STEM concepts 3 ways, helps you practice, and rewards your curiosity
IA e aprendizado de mรกquinaO que vocรช pode fazer
- ๐ค Voice Input - Ask questions using speech recognition
- ๐ฃ๏ธ Text-to-Speech - Listen to explanations hands-free
- ๐ LaTeX Math - Beautiful equation rendering with KaTeX
- ๐ป Code Highlighting - Syntax-highlighted code blocks
Crescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- 0
- em 15 dias
- +1
- em 1 mรชs
- Coletando histรณrico
Variaรงรตes lรญquidas em perรญodos sobrepostos, nรฃo totais diรกrios. Mediรงรตes ausentes ficam em branco. Estrelas indicam interesse, nรฃo qualidade.
README.md
Original๐ฏ The Problem
"Textbooks explain things one way. But every student's brain learns differently."
๐ก The Solution
Study Dost AI explains any STEM concept in 3 different ways simultaneously โ step-by-step, real-world analogy, and visual cue โ so the explanation that clicks with YOU is always one click away.
|
3 Explanation Styles Step-by-step โข Analogy โข Visual |
Gamified Learning XP โข Levels โข Badges โข Streaks |
Country-Aware Bangladesh โข India โข Global |
๐ Table of Contents
๐ Click to expand
โจ Features
๐ Core Learning Engine
๐ข Triple Explanation EngineGet any concept explained 3 different ways at once:
|
๐ฏ Smart Practice ProblemsAI-generated practice with adaptive difficulty:
|
๐ถ ELI10 Mode"Explain Like I'm 10" โ ultra-simple breakdowns when something just isn't clicking. Perfect for breaking through learning blocks. |
๐ Country-Aware CurriculumTailored to your education system:
|
๐ฎ Gamification System
| ๐ XP & Levels Level up as you learn |
๐ฅ Daily Streaks Build consistency |
๐๏ธ Achievement Badges Unlock milestones |
๐ Confetti Rewards Celebrate wins |
| ๐พ Pet Mascot Animated companion |
๐จ 5 Themes Midnight, Cosmic+ |
๐พ Favorites Save explanations |
๐ History Auto-saved sessions |
๐ Advanced Features
๐ค Click to see all power features
| Feature | Description |
|---|---|
| ๐ค Voice Input | Ask questions using speech recognition |
| ๐ฃ๏ธ Text-to-Speech | Listen to explanations hands-free |
| ๐ LaTeX Math | Beautiful equation rendering with KaTeX |
| ๐ป Code Highlighting | Syntax-highlighted code blocks |
| ๐ฑ Mobile-First | Drawer navigation, touch-optimized |
| โก Offline-Capable | localStorage for instant load |
| ๐ API Failover | Multi-key rotation for 99.9% uptime |
| ๐ก๏ธ CORS Protected | Locked to your domain |
| ๐ฏ Suggestion Chips | Quick-start prompts |
| โฟ Accessible | Screen-reader friendly |
๐ฌ Live Demo
๐ Try it now โ samiahrafnirob.com/study-dost
|
Best for full experience |
Optimized drawer UI |
Easy on the eyes |
๐ Architecture
graph LR
A[๐จโ๐ Student] -->|HTTPS| B[๐ Frontend<br/>InfinityFree]
B -->|API Call| C[๐ Cloudflare Tunnel]
C -->|Proxy| D[๐ FastAPI Backend<br/>RDP Server]
D -->|LLM Request| E[๐ค Featherless.ai<br/>DeepSeek-V3]
E -->|Response| D
D -->|JSON| C
C -->|HTTPS| B
B -->|Rendered| A
style A fill:#FFD93D,stroke:#333,color:#000
style B fill:#4ECDC4,stroke:#333,color:#000
style C fill:#F38BA8,stroke:#333,color:#000
style D fill:#A8DADC,stroke:#333,color:#000
style E fill:#C9ADA7,stroke:#333,color:#000
๐งฑ Why Split Architecture?
| Component | Where It Lives | Why |
|---|---|---|
| ๐จ Frontend HTML/CSS/JS |
InfinityFree, Netlify, GitHub Pages, any static host | Fast CDN delivery, zero server cost, no build step |
| โ๏ธ Backend FastAPI + Python |
RDP / VPS / Cloud VM | Hides API keys, full Python ecosystem, scalable |
| ๐ Connection | Cloudflare Tunnel (HTTPS) | Free HTTPS, no port forwarding, DDoS protected |
๐ Project Structure
๐ Click to view full directory tree
study-dost-ai/
โ
โโโ ๐จ frontend/ # Static web app (deploy anywhere)
โ โโโ index.html # Main app shell
โ โโโ styles.css # Themes + responsive design
โ โโโ app.js # Application logic
โ โโโ config.js # Backend URL configuration
โ โโโ README.md # Frontend docs
โ
โโโ โ๏ธ backend/ # FastAPI service
โ โโโ main.py # API endpoints + CORS
โ โโโ utils.py # LLM client + response parser
โ โโโ prompts.py # Prompt templates
โ โโโ requirements.txt # Python dependencies
โ โโโ install.bat # Windows installer
โ โโโ start.bat # Windows launcher
โ โโโ .env.example # Config template
โ โโโ README.md # Backend docs
โ
โโโ ๐ infinityfree/ # InfinityFree-ready bundle
โ โโโ (same as frontend/)
โ
โโโ ๐ฅ๏ธ rdp/ # RDP deployment bundle
โ โโโ (same as backend/)
โ
โโโ ๐ LICENSE # MIT License
โโโ ๐ README.md # You are here โจ
โโโ ๐ GIT_SETUP_GUIDE.md # Git + GitHub walkthrough
โโโ ๐ซ .gitignore # Protects your secrets
โก Quick Start
Get running in 5 minutes โฑ๏ธ
๐ Prerequisites
| ๐ | Python 3.10+ |
| ๐ | Featherless.ai API Key (free tier available) |
| ๐ | Any web browser |
๐ Installation
๐ง Step 1: Clone the repository
git clone https://github.com/samiahrafnirob/study-dost-ai.git
cd study-dost-ai
โ๏ธ Step 2: Set up the backend
cd backend
# Create virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1 # Windows PowerShell
# source .venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt
# Configure environment
copy .env.example .env
# Edit .env โ paste your FEATHERLESS_API_KEY
# Launch server ๐
python main.py
โ
Backend running at http://localhost:8000
๐ Swagger docs at http://localhost:8000/docs
๐จ Step 3: Launch the frontend
cd ../frontend
# Edit config.js
# window.CC_CONFIG = {
# API_BASE: "http://localhost:8000",
# API_KEY: ""
# };
# Serve locally
python -m http.server 5500
โ
Open http://localhost:5500 in your browser ๐
๐ฆ Deployment
Choose your deployment combo:
| ๐จ Frontend Host | โ๏ธ Backend Host | ๐ HTTPS Bridge |
|---|---|---|
|
โ
InfinityFree โ Netlify โ Vercel โ GitHub Pages โ Cloudflare Pages |
โ
Windows RDP โ Linux VPS โ AWS EC2 โ DigitalOcean โ Railway / Render |
โ
Cloudflare Tunnel โ Caddy (auto-HTTPS) โ Nginx + Certbot โ ngrok โ Tailscale Funnel |
๐ฅ๏ธ Deploy Backend on Windows RDP
๐ Click for full RDP deployment guide
# 1. Copy the rdp/ folder to your RDP
# 2. Install dependencies
.\install.bat
# 3. Configure .env
notepad .env
# 4. Launch the server
.\start.bat
# 5. Expose with Cloudflare Tunnel (free HTTPS)
Invoke-WebRequest `
-Uri "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe" `
-OutFile "$env:USERPROFILE\cloudflared.exe"
& "$env:USERPROFILE\cloudflared.exe" tunnel --url http://localhost:8000
# โ Copy the https://xxxxx.trycloudflare.com URL
Then paste that URL into frontend/config.js as your API_BASE. Done! ๐
๐ Deploy Frontend on InfinityFree
๐ Click for full InfinityFree deployment guide
- Sign up at infinityfree.net
- Create site:
samiahrafnirob.com/study-dost/ - Upload all files from
infinityfree/tohtdocs/study-dost/via FTP - Edit
config.json the server to point to your backend HTTPS URL - Visit your live site โ ๐
// infinityfree/config.js
window.CC_CONFIG = {
API_BASE: "https://your-cloudflare-tunnel-url.trycloudflare.com",
API_KEY: "" // optional, must match backend APP_API_KEY
};
โ๏ธ Configuration
๐ Backend .env file
# ๐ REQUIRED: Featherless.ai API key
FEATHERLESS_API_KEY=rc_your_api_key_here
# ๐ OPTIONAL: Backup keys for failover
FEATHERLESS_API_KEY_BACKUP=rc_backup_key_1
FEATHERLESS_API_KEY_BACKUP_2=rc_backup_key_2
# ๐ก๏ธ OPTIONAL: App-level authentication
APP_API_KEY=your_optional_shared_secret
# ๐ CORS: Comma-separated allowed origins
ALLOWED_ORIGINS=https://samiahrafnirob.com,http://localhost:5500
# ๐ Server settings
PORT=8000
HOST=0.0.0.0
๐จ Frontend config.js file
window.CC_CONFIG = {
// Your backend's HTTPS URL
API_BASE: "https://your-backend-url.com",
// Must match backend's APP_API_KEY (if set)
API_KEY: "",
// Default country: "default" | "bangladesh" | "india"
DEFAULT_COUNTRY: "default",
// Default theme: "midnight" | "cosmic" | "sunset" | "forest" | "light"
DEFAULT_THEME: "midnight"
};
๐งฉ Tech Stack
๐ ๏ธ Built With
|
Python 3.10+ |
FastAPI |
JavaScript |
HTML5 |
CSS3 |
|
Uvicorn |
Cloudflare |
OpenAI SDK |
KaTeX |
Marked.js |
๐ Full dependency breakdown
| Layer | Library | Purpose |
|---|---|---|
| Backend | FastAPI | Web framework |
| Backend | Uvicorn | ASGI server |
| Backend | OpenAI SDK | Featherless API client |
| Backend | python-dotenv | Env var loading |
| Backend | Pydantic | Data validation |
| Frontend | marked.js | Markdown rendering |
| Frontend | DOMPurify | XSS protection |
| Frontend | KaTeX | LaTeX math rendering |
| Frontend | highlight.js | Code syntax highlighting |
| AI | DeepSeek-V3-0324 | Language model |
| Hosting | Cloudflare Tunnel | HTTPS exposure |
๐ก Security
| ๐ | API keys never reach the browser โ they live only in the backend .env |
| ๐ | CORS locked to your domain via ALLOWED_ORIGINS |
| ๐ | Optional shared secret (APP_API_KEY) for extra auth layer |
| ๐ | HTTPS enforced via Cloudflare Tunnel / Caddy |
| ๐งน | Input sanitized with DOMPurify before rendering |
| ๐ซ | .env always gitignored โ no leaks ever |
๐ฏ Roadmap
| Status | Feature | Target |
|---|---|---|
| โ | Triple explanation engine | v1.0 |
| โ | Country-aware curriculum | v1.0 |
| โ | Gamification (XP, badges) | v1.0 |
| โ | Mobile responsive UI | v1.0 |
| โ | Voice input/output | v1.0 |
| ๐ง | Multi-language UI (Bengali, Hindi) | v1.1 |
| ๐ | User accounts + cloud sync | v1.2 |
| ๐ | PDF export for notes | v1.2 |
| ๐ | Quiz mode with leaderboards | v1.3 |
| ๐ | Collaborative study rooms | v2.0 |
| ๐ | Native mobile apps | v2.0 |
๐ค Contributing
All contributions are welcome! ๐
๐ง How to contribute
- Fork the repository
- Create your feature branch
git checkout -b feature/AmazingFeature - Commit your changes
git commit -m "feat: add AmazingFeature" - Push to the branch
git push origin feature/AmazingFeature - Open a Pull Request
๐ Commit Convention
We follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentationstyle:Formattingrefactor:Code restructuretest:Testschore:Maintenance
๐ License
This project is licensed under the MIT License โ see LICENSE for details.
Copyright (c) 2026 Sami Ahraf Nirob
You are free to use, modify, and distribute this software. ๐
๐ฌ Contact
๐ Show Your Support
If this project helped you, please consider:
โญ Starring this repo
๐ฆ Sharing on social media
๐ Reporting bugs
๐ก Suggesting features
๐ค Contributing code
Explore projetos relacionados
Carregandoโฆ