Files
mcpapp/project_planning/PLAN.md

1.2 KiB

Streamlit Chat App Implementation Plan

Project Setup

# Create and activate virtual environment
uv venv -p 3.12 env
source env/bin/activate

# Install dependencies using UV
uv pip install -e .

Configuration Management

  1. Edit config/config.ini:
[openai]
api_key = your_api_key_here
base_url = https://api.openai.com/v1
model = gpt-3.5-turbo
  1. Security practices:
  • Never commit config.ini to version control
  • Use environment variables for production deployment

Modular Code Structure

graph TD
    A[app.py] --> B[OpenAIClient]
    B --> C[config.ini]
    A --> D[Streamlit Components]

    style A fill:#4CAF50
    style B fill:#2196F3
    style C fill:#FF9800

Key Modules:

  1. openai_client.py: API communication layer
  2. app.py: Streamlit UI and business logic
  3. config/: Centralized configuration management

Development Workflow

  1. Testing:
streamlit run src/app.py
  1. Maintenance:
  • Update dependencies with uv pip install -r requirements.txt
  • Validate config changes before deployment

Best Practices

  • Type hints for all function signatures
  • Separate UI logic from business logic
  • Use Streamlit session state judiciously