A web application that generates challenging IELTS "Hot Seat" speaking topics with forbidden words, powered by OpenAI's GPT-4 model and deployed as a Google Cloud Function.
- Generate IELTS speaking topics with customizable difficulty
- Specify the number of forbidden words to make topics more challenging
- Filter topics by specialization/category (technology, environment, education, etc.)
- Responsive web interface with printable topic cards
- Serverless backend using Google Cloud Functions
-
Backend:
- Go 1.22
- Google Cloud Functions
- OpenAI GPT-4 API
- Functions Framework for Go
-
Frontend:
- HTML5
- CSS3
- Vanilla JavaScript
- Go 1.22 or later
- Google Cloud SDK
- OpenAI API key
- Git
-
Clone the repository:
git clone https://github.com/t0mk/hotseat.git cd hotseat
-
Install dependencies:
go mod download
-
Set up your OpenAI API key:
export OPENAI_API_KEY=your_api_key_here
-
Make sure you have Google Cloud SDK installed and are logged in:
gcloud auth login
-
Deploy using the provided script:
./deploy.sh
This script will deploy the function to Google Cloud Functions in the europe-west12 region.
-
After deployment, you'll receive a URL for your function that can be used in the frontend.
-
Update the
API_URL
inindex.html
with your deployed function URL:const API_URL = 'your_function_url_here';
-
Host the
index.html
file on any web server or static hosting service.
- Open the web application in your browser.
- Customize the generation parameters:
- Set the number of forbidden words (3-15)
- Optionally specify a specialization area (e.g., technology, environment)
- Click "Generate a Topic" to create a new speaking topic.
- Use the "Print Cards" button to print the generated topic cards.
The application provides speaking topics with a list of words that must not be used while discussing the topic, creating a challenging speaking exercise.
hotseat.go
- Main application code for the Google Cloud Functiongo.mod
&go.sum
- Go module dependenciesdeploy.sh
- Deployment script for Google Cloud Functionsindex.html
- Frontend interface/cmd
- Code to run the function locally
To test the function locally, you can use the Functions Framework for Go:
go run cmd/local/main.go
{
"count": 5,
"specialization": "technology"
}
{
"topics": [
{
"name": "Smart Home Devices",
"forbidden_words": ["internet", "control", "assistant", "connect", "voice"]
}
]
}
OPENAI_API_KEY
- Required for making requests to the OpenAI API
[Add your license information here]
[Add contribution guidelines here]