An AI-powered leadership coaching platform for modern leadership and professional development. Built with OpenAI's GPT-4.1 model, featuring file search and web search capabilities for intelligent leadership guidance.
- Expert Leadership Guidance: In-depth guidance from curated leadership resources
- File Search: Intelligent search and analysis through uploaded documents
- Web Search: Automatic internet research for current information
- Real-time Responses: Streaming chat experience
- Professional Tone: Sharp and effective communication suitable for business world
- Conversation History: Chat memory for context preservation
- Modern Stack: Next.js 13 + FastAPI + TypeScript
- AI Integration: OpenAI GPT-4.1 Responses API
- Streaming: Real-time response streaming
- Docker Support: Full containerization
- Responsive UI: Modern and user-friendly interface
- Framework: Next.js 13 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS + shadcn/ui
- State Management: React Hooks
- Icons: Lucide React
- Animations: Framer Motion
- Framework: FastAPI (Python)
- AI Integration: OpenAI Python SDK
- Tools: File Search + Web Search Preview
- Streaming: Server-Sent Events (SSE)
- Configuration: Environment-based settings
- Containerization: Docker + Docker Compose
- Development: Hot reload for both frontend and backend
- Production: Optimized builds
- Python: 3.10 or higher
- Node.js: 18.0.0 or higher
- OpenAI API Key: Account with GPT-4.1 access
- Docker (optional): For container-based development
git clone https://github.com/your-username/leadership_coach.git
cd leadership_coach
# Create .env file
cp .env.example .env
# Edit .env file
OPENAI_API_KEY=your_openai_api_key_here
pip install -r requirements.txt
npm install
For file search functionality, update the vector_store_ids
in api/utils/prompt.py
with your own vector store ID.
# Terminal 1: Backend (FastAPI)
npm run fastapi-dev
# Terminal 2: Frontend (Next.js)
npm run next-dev
npm run dev
docker-compose up --build
The application will be available at http://localhost:3000
.
Endpoint | Method | Description |
---|---|---|
/api/chat |
POST | Chat with leadership coach |
/api/chat/reset |
POST | Reset conversation history |
/api/chat/history |
GET | Get current conversation history |
/api/youtube/process |
POST | Process YouTube playlist and create vector store |
"What are the key qualities of an effective leader?"
"How can I improve my team's communication?"
"What strategies can I use for better decision making?"
"How do I handle conflict in my team?"
"What professional development goals should I set?"
"Which company received the largest investment in 2024?"
"What are the current market trends?"
"What are digital transformation strategies?"
leadership_coach/
โโโ ๐ app/ # Next.js App Router
โ โโโ ๐ (chat)/ # Chat pages
โ โโโ ๐ api/ # API route handlers
โ โโโ layout.tsx # Main layout
โโโ ๐ components/ # React components
โ โโโ chat.tsx # Main chat component
โ โโโ message.tsx # Message component
โ โโโ multimodal-input.tsx # Input component
โ โโโ ๐ ui/ # UI components
โโโ ๐ api/ # FastAPI backend
โ โโโ ๐ services/ # Business logic services
โ โ โโโ leadership_coach.py
โ โโโ ๐ utils/ # Utility functions
โ โ โโโ prompt.py # AI configuration
โ โโโ index.py # FastAPI main file
โโโ ๐ assets/ # Static files
โโโ ๐ hooks/ # React hooks
โโโ ๐ lib/ # Helper libraries
โโโ docker-compose.yml # Docker configuration
โโโ Dockerfile.frontend # Frontend Docker
โโโ Dockerfile.backend # Backend Docker
โโโ package.json # Node.js dependencies
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
- FastAPI: Modern Python web framework
- Async/Await: Asynchronous programming
- Streaming: Real-time response streaming
- OpenAI Integration: GPT-4.1 Responses API
- App Router: Next.js 13 new routing system
- TypeScript: Type safety
- Tailwind: Utility-first CSS
- shadcn/ui: Modern UI components
api/services/leadership_coach.py
: Main AI serviceapi/utils/prompt.py
: AI system prompt and tool configurationcomponents/chat.tsx
: Main chat componentcomponents/multimodal-input.tsx
: User input component
docker-compose up --build
docker-compose -f docker-compose.prod.yml up --build
- API keys stored in environment variables
- Input validation and sanitization
- Rate limiting (recommended for production)
- CORS configuration
-
OpenAI API Key Error
# Check .env file cat .env | grep OPENAI_API_KEY
-
Port Conflicts
# Check ports lsof -i :3000 lsof -i :8000
-
Python Dependency Error
# Create virtual environment python -m venv venv source venv/bin/activate # macOS/Linux # venv\Scripts\activate # Windows pip install -r requirements.txt
MIT License - See LICENSE file for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
โก AI-powered coaching experience for modern leadership โก