https://github.com/aashishtimalsina/fastapi-ai-edu-tools
A FastAPI-based backend application integrating OpenAI's GPT to build AI-powered educational tools. Includes user management, prompt-based AI responses, modular structure, and scalable architecture for EdTech platforms.
https://github.com/aashishtimalsina/fastapi-ai-edu-tools
ai-tools e-learning edtech fastapi gpt langchain llm openai python
Last synced: about 2 months ago
JSON representation
A FastAPI-based backend application integrating OpenAI's GPT to build AI-powered educational tools. Includes user management, prompt-based AI responses, modular structure, and scalable architecture for EdTech platforms.
- Host: GitHub
- URL: https://github.com/aashishtimalsina/fastapi-ai-edu-tools
- Owner: aashishtimalsina
- Created: 2025-07-14T05:08:03.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-14T05:13:06.000Z (12 months ago)
- Last Synced: 2025-07-14T07:35:21.534Z (12 months ago)
- Topics: ai-tools, e-learning, edtech, fastapi, gpt, langchain, llm, openai, python
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI Google AI Edu Tools ๐๐ค
A FastAPI-based backend integrating Google AI Studio's Gemini APIs to power AI-driven educational tools and services. This project is designed to be the backend foundation for EdTech platforms that require dynamic content generation, Q&A bots, and interactive AI-based features.
---
## ๐ Features
- โจ AI-powered Q&A endpoint using Google AI Studio (Gemini 1.5 Flash)
- ๐ค User creation and management
- โ๏ธ Modular and clean project structure
- ๐ก RESTful API with FastAPI
- ๐ง Easily extensible to other AI models
- ๐พ SQLite with SQLAlchemy ORM (easy to switch DB)
- โ๏ธ Ready for cloud deployment (Heroku, GCP, AWS)
- ๐ Secure API key management with environment variables
---
## ๐ Project Structure
```
fastapi-ai-edu-tools/
โโโ app/
โ โโโ main.py # FastAPI app setup
โ โโโ models.py # SQLAlchemy models
โ โโโ schemas.py # Pydantic schemas
โ โโโ database.py # DB engine and session
โ โโโ google_ai_integration.py # Google AI Studio integration
โ โโโ routes/
โ โโโ user.py # /users/ route
โ โโโ ai.py # /ask-ai/ route
โโโ .env # Environment variables (create from .env.example)
โโโ .env.example # Environment variables template
โโโ requirements.txt
โโโ setup.sh # Quick setup script
โโโ README.md
```
---
## ๐ง Setup Instructions
### Quick Setup (Recommended)
```bash
# Clone the repository
git clone https://github.com/your-username/fastapi-ai-edu-tools.git
cd fastapi-ai-edu-tools
# Run the setup script
./setup.sh
# Edit .env file with your Google AI Studio API key
nano .env # or use your preferred editor
```
### Manual Setup
### 1. Clone the repository
```bash
git clone https://github.com/your-username/fastapi-ai-edu-tools.git
cd fastapi-ai-edu-tools
```
### 2. Create a virtual environment
```bash
python3 -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
```
### 3. Install dependencies
```bash
pip install -r requirements.txt
```
### 4. Add your Google AI Studio API Key
Create a `.env` file in the root directory (or copy from `.env.example`) and add:
```ini
GOOGLE_API_KEY=your_google_ai_studio_api_key_here
```
To get your Google AI Studio API key:
1. Go to [Google AI Studio](https://aistudio.google.com/)
2. Sign in with your Google account
3. Click on "Get API key"
4. Create a new API key or use an existing one
5. Copy the API key and paste it in your `.env` file
### 5. Run the FastAPI server
```bash
uvicorn app.main:app --reload
```
Server will start at: http://127.0.0.1:8000
---
## ๐งช API Endpoints
### โ
Ask AI
**POST** `/ask-ai/`
Body:
```json
{
"prompt": "What is Newton's First Law?"
}
```
Response:
```json
{
"response": "Newton's First Law states that..."
}
```
### โ
Create User
**POST** `/users/`
Body:
```json
{
"name": "Ashish",
"email": "ashish@example.com"
}
```
---
## ๐ Technologies Used
- **FastAPI** โ high-performance API framework
- **Google AI Studio** โ Gemini AI model integration
- **SQLAlchemy** โ ORM for database models
- **Pydantic** โ Data validation
- **Uvicorn** โ ASGI server
- **python-dotenv** โ for environment variable handling
---
## ๐ Future Enhancements
- ๐ JWT Authentication
- ๐ง Multiple AI model support (OpenAI, Anthropic, etc.)
- ๐งฉ Vector DB support (e.g., Pinecone, Chroma)
- ๐ WebSocket/streaming responses
- ๐ Analytics dashboard
- ๐ฏ Fine-tuned models for educational content
---
## ๐ค Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
---
## ๐ License
This project is licensed under the MIT License.
---
## ๐ Contact
**Built by Aashish Timalsina**
- ๐ง aashish@example.com
- ๐ Danson Solutions
---
Let me know if you'd like:
- Swagger UI screenshots
- A hosted version (on Render/Heroku)
- CI/CD setup via GitHub Actions
- README badges (build passing, license, OpenAI-powered, etc.)
Happy coding!