How howard115/phrasal-verb-app-v2 works
Main Components
A. Frontend Layer (Streamlit):
• Three sub-components for the main pages:
• Story Generator
• Favorite Stories
• API Key Configuration
• Use blue coloring to distinguish frontend components
B. Backend Layer (FastAPI):
• Four main router components:
• Auth Router
• API Keys Router
• Phrasal Verbs Router
• Numbers Router
• Use green coloring for backend components
C. External Services:
• Google SSO (Authentication)
• OpenAI GPT-4 (AI Integration)
• Use purple coloring for external services
D. Database Layer:
• SQLite Database with tables for:
• Users
• API Keys
• Saved Stories
• Use orange coloring for database components
Connection Flows to Illustrate
A. Authentication Flow:
• JWT token flow from Backend → Frontend
B. Data Flow:
• Frontend → Backend API endpoints
• Backend → Database (CRUD operations)
• Backend → OpenAI (story generation)
• Database → Backend (data retrieval)
Key Technical Elements to Highlight
A. Security Components:
• JWT token validation
• Fernet encryption for API keys
• As security layers between components
B. Integration Points:
• LangChain integration with OpenAI
• Google SSO integration
• Database ORM (SQLAlchemy)
Specific Implementation Details
[User Interface Layer]
• ↓
[Authentication Layer]
• ↓
[Application Layer]
• ↓
[Data Access Layer]
Critical Flows to Emphasize
A. Story Generation Flow:
User → Frontend → Backend → OpenAI → Backend → Frontend
B. Authentication Flow:
User → Frontend → Google SSO → Backend → JWT → Frontend
C. Data Persistence Flow:
Backend → SQLAlchemy → SQLite
Remember to:
• Keep components proportional to their importance
• Use consistent styling for similar components
• Version information for major components
• Clear labels for all interfaces and connections
• Document any rate limits or scaling considerations