An AI-based personalized anesthesia guidelines generation system with multi-language support (Chinese, English, French).
anesthesia/
├── frontend-next/ # Next.js frontend application
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── i18n/ # Internationalization config
│ │ └── ...
│ ├── package.json
│ └── ...
├── backend/ # FastAPI backend
│ ├── app/ # Application code
│ ├── scripts/ # Script files
│ ├── requirements.txt
│ └── ...
├── README.md
└── ...
cd backend
pip install -r requirements.txt
python start_demo.py
uvicorn app.main:app --reloadcd frontend-next
npm install
npm run dev- Frontend Interface: http://localhost:3000
- API Documentation: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
The system supports three languages:
- 🇹🇼 繁體中文 (zh-TW)
- 🇺🇸 English (en-US)
- 🇫🇷 Français (fr-FR)
Users can switch languages using the language selector in the top-right corner.
- ✅ Multi-language interface support
- ✅ Patient management (create, search, view, edit)
- ✅ Anesthesia guidelines generation
- ✅ Responsive design
- ✅ Modern UI interface
- ✅ RESTful API
- ✅ Patient management system
- ✅ Medical history management
- ✅ AI anesthesia guidelines generation
- ✅ Local LLM support (Ollama)
- ✅ OpenAI API integration
- Next.js 14
- React 18
- Material-UI (MUI)
- React Hook Form
- i18next (Internationalization)
- Axios
- FastAPI
- SQLAlchemy
- SQLite
- OpenAI API
- Ollama (Local LLM)
- Pydantic
GET /api/v1/patients/- Get all patientsPOST /api/v1/patients/- Create patientGET /api/v1/patients/{id}- Get patient detailsPUT /api/v1/patients/{id}- Update patientDELETE /api/v1/patients/{id}- Delete patientPOST /api/v1/patients/search- Search patients
POST /api/v1/anesthesia/guidelines/generate- Generate anesthesia guidelinesGET /api/v1/anesthesia/guidelines/- Get all anesthesia guidelinesGET /api/v1/anesthesia/guidelines/{id}- Get anesthesia guideline detailsPUT /api/v1/anesthesia/guidelines/{id}- Update anesthesia guidelineDELETE /api/v1/anesthesia/guidelines/{id}- Delete anesthesia guideline
Create a .env file:
# Use local LLM (Ollama)
USE_LOCAL_LLM=true
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=qwen2.5:7b
# Or use OpenAI
OPENAI_API_KEY=your_api_key_here
USE_LOCAL_LLM=false
# Other settings
DEBUG=true
DATABASE_URL=sqlite:///./anesthesia.db- Install Ollama
- Download model:
ollama pull qwen2.5:7b - Start service:
ollama serve - Set environment variable:
USE_LOCAL_LLM=true
cd backend
python scripts/test_api.pycd frontend-next
npm test