git clone https://github.com/InfiniteBloom-max/PathTree.git
cd PathTree# Create backend .env file
echo "MISTRAL_API_KEY=GtJJSeLN4KB2ZSHRiFW4mPwjeIIOUfG2" > backend/.envcd backend
pip install -r requirements.txtcd ../frontend
npm install# From the root directory
./start.shOr manually:
cd backend
python main.pycd frontend
npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- ✅ Document upload (PDF, PPTX, TXT)
- ✅ Multi-agent AI processing system
- ✅ Knowledge tree generation with React Flow
- ✅ Summary generation (1-page, 5-page, detailed)
- ✅ Flashcard creation with Q&A pairs
- ✅ AI tutor chat interface
- ✅ Assessment and quiz generation
- ✅ FastAPI backend with async endpoints
- ✅ Next.js frontend with modern React
- ✅ TailwindCSS styling with JoyCode theme
- ✅ File upload handling
- ✅ CORS configuration
- ✅ Error handling
- ✅ Responsive design
POST /upload- Upload and process documentsPOST /generate/graph- Generate knowledge treePOST /generate/summary- Create summariesPOST /generate/flashcards- Generate flashcards
POST /tutor- AI tutoring chatPOST /generate/quiz- Create assessmentsGET /health- Health check
backend/
├── agents/ # 7 AI agents
│ ├── extraction_agent.py
│ ├── simplifier_agent.py
│ ├── knowledge_tree_agent.py
│ ├── summary_agent.py
│ ├── flashcard_agent.py
│ ├── tutor_agent.py
│ └── assessment_agent.py
├── utils/ # Utilities
│ ├── mistral_client.py
│ └── document_processor.py
└── main.py # FastAPI app
frontend/
├── src/
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ │ ├── features/ # Feature components
│ │ └── ui/ # UI components
│ └── lib/ # Utilities
└── public/ # Static assets
- FastAPI - High-performance Python web framework
- Mistral AI - Advanced language model
- pdfplumber - PDF text extraction
- python-pptx - PowerPoint processing
- uvicorn - ASGI server
- Next.js 14 - React framework with App Router
- React 18 - Modern React with hooks
- TailwindCSS - Utility-first CSS
- React Flow - Interactive node graphs
- Lucide React - Beautiful icons
- Python: 3.12+
- Node.js: 18+
- npm: 9+
- Create Dockerfile for Backend
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "main.py"]- Create Dockerfile for Frontend
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]- Docker Compose
version: '3.8'
services:
backend:
build: ./backend
ports:
- "8000:8000"
environment:
- MISTRAL_API_KEY=${MISTRAL_API_KEY}
frontend:
build: ./frontend
ports:
- "3000:3000"
depends_on:
- backendcd frontend
npm install -g vercel
vercel --prod- Connect GitHub repository
- Set environment variables
- Deploy automatically
-
Module not found errors
- Ensure virtual environment is activated
- Install dependencies:
pip install -r requirements.txt
-
CORS errors
- Backend includes CORS middleware
- Check frontend API URL configuration
-
File upload issues
- Check file size limits (50MB max)
- Verify supported formats: PDF, PPTX, TXT
-
Mistral API errors
- Verify API key is set correctly
- Check API quota and limits
-
Backend
- Use async/await for I/O operations
- Implement caching for processed documents
- Add database for persistent storage
-
Frontend
- Enable Next.js image optimization
- Implement lazy loading for components
- Use React.memo for expensive components
-
API Key Management
- Store in environment variables
- Never commit to version control
- Use secrets management in production
-
File Upload Security
- Validate file types and sizes
- Scan for malicious content
- Implement rate limiting
-
CORS Configuration
- Restrict origins in production
- Use HTTPS in production
-
Backend Logging
- Add structured logging
- Monitor API response times
- Track error rates
-
Frontend Analytics
- Add user analytics
- Monitor performance metrics
- Track feature usage
- Fork the repository
- Create feature branch
- Make changes
- Test thoroughly
- Submit pull request
MIT License - see LICENSE file for details.
PathTree - Successfully deployed and ready for production! 🌳✨