Skip to content

Repository files navigation

📚 StudyAI – Intelligent Study Assistant

StudyAI is a full‑featured AI‑powered learning platform. It provides:

  • AI chat assistant (powered by Gemini / OpenRouter)
  • YouTube video search & transcript analysis
  • News, images, and visual search
  • Knowledge mapping & summarization
  • Premium subscription plans (Stripe / Razorpay)
  • User authentication (email + Google OAuth)

✨ Features

  • AI Chat Assistant – Ask any study question, get step‑by‑step solutions.
  • YouTube Integration – Search videos, fetch transcripts, and get summaries.
  • News & Image Search – Stay updated with GNews and Unsplash.
  • Visual Learning – Diagram generation, visual search, and image analysis.
  • Knowledge Mapping – Create concept maps from your notes.
  • Payments – Support for Stripe, Razorpay, and UPI.
  • User Dashboard – Track your history, settings, and subscription.

🛠️ Installation

1. Clone the repository

git clone https://github.com/yourusername/StudyAI.git
cd StudyAI

2. Create a virtual environment (recommended)

python -m venv venv
source venv/bin/activate   # Linux/Mac
# or
venv\Scripts\activate      # Windows

3. Install dependencies

pip install -r requirements.txt

4. Set up environment variables

Copy the example file and fill in your real API keys:

cp .env.example .env
nano .env   # or use any text editor

⚠️ Important: Never commit your .env file. Add it to .gitignore.

5. Initialize the database (SQLite)

The app will create studyai.db automatically on first run.
If you use migrations (Alembic), run:

flask db upgrade

6. Run the application

python app.py

The app will be available at http://localhost:5000.

For production, use a WSGI server like Gunicorn:

gunicorn -w 4 app:app

🔧 Configuration

All sensitive data is loaded from environment variables (.env). The main configuration file is config.py – it reads os.getenv() for every key.

Essential environment variables

Variable Description
OPENROUTER_API_KEY OpenRouter API key (for LLM access)
GEMINI_API_KEY Google Gemini API key (or comma‑separated list in GEMINI_API_KEYS for rotation)
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET OAuth credentials for Google login
SECRET_KEY Flask secret – use a long random string
MAIL_USERNAME / MAIL_PASSWORD SMTP credentials for sending emails
STRIPE_SECRET_KEY / RAZORPAY_KEY_SECRET Payment gateway secrets
RECAPTCHA_SITE_KEY / RECAPTCHA_SECRET_KEY Google reCAPTCHA keys
YOUTUBE_API_KEY YouTube Data API v3 key

For the full list, see .env.example.

Payment Plans

The default plans (free, basic, pro, enterprise) are defined in config.py. You can override prices, limits, and feature names via environment variables (see .env.example for overrides).


🧪 Testing

Run unit tests (if available):

pytest tests/

🚀 Deployment

Using Docker (optional)

If a Dockerfile exists:

docker build -t studyai .
docker run -p 5000:5000 --env-file .env studyai

Using a cloud tunnel

For services that need a public URL (e.g., webhooks), you can store your tunnel URL in tunnel.txt – the app reads it via the link() function in config.py.


🤝 Contributing

Contributions are welcome! Please open an issue or pull request.

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

📄 License

This project is licensed under the MIT License – see the LICENSE file for details.


📬 Contact


🙏 Acknowledgements

  • Google Gemini / OpenRouter for AI capabilities
  • Stripe & Razorpay for payment processing
  • Unsplash, GNews, YouTube Data API for content
  • Flask and all open‑source libraries used

Happy Learning! 🎓

About

AI-powered learning platform with Flask backend, Gemini API integration, real-time chat, visual knowledge mapping, and payment gateway support (Stripe/Razorpay).

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages