Skip to content

Instantly share code, notes, and snippets.

@up1
Last active May 26, 2026 08:57
Show Gist options
  • Select an option

  • Save up1/190c03f9c6abad3fd79cd3c53bd94648 to your computer and use it in GitHub Desktop.

Select an option

Save up1/190c03f9c6abad3fd79cd3c53bd94648 to your computer and use it in GitHub Desktop.
Demo Req
# Report management web
## Technology stack
* Python
* Web framework: Flask
* https://flask.palletsprojects.com/en/stable/
* Use openai library
* https://pypi.org/project/openai/
## Features
1. Report generation
* User fill in data (textarea)
* User click "Generate Report" button
* Show report result in web page
## Flow
1. User access the web page use design UI (HTML/CSS/JS) from file report.html
2. User fill in data (textarea)
3. User click "Generate Report" button
4. Web page send data to backend (Flask)
5. Backend receive data and call OpenAI API to generate report
* OpenAI generate SQL query based on user input and table schema
* OpenAI execute SQL query and get result
6. Backend send report result back to web page
* Dydnamic result display in web page
## Prompt 1
```
Create Report generation in folder web
and use spec from @file:req.md
and use poc code from @file:demo-sql-openai.py to call to openai api to generate SQL with prompt template
and read data from sqlite @file:test_db.db
```
## Prompt 2
```
Update css for report that use design from file @file:report.html
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment