An open API service indexing awesome lists of open source software.

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.

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!