This is a full-stack application for analyzing and ranking pitch decks. The application has a React frontend and a Python Flask backend. The backend processes PDF pitch decks and ranks them based on analysis criteria, while the frontend provides a user-friendly interface for uploading, analyzing, and managing pitch decks.
- Prerequisites
- Project Setup
- Backend - Python Flask Setup
- Frontend - React Setup
- Running the Application
- API Endpoints
- Usage
- Troubleshooting
To run this application, you need:
- Node.js (for React frontend)
- Python 3.x (for Flask backend)
- MongoDB (for data storage)
- pip (Python package manager)
-
Clone the repository:
git clone https://github.com/your-repository-url/pitch-deck-analyzer.git cd pitch-deck-analyzer -
The project structure should look like this:
pitch-deck-analyzer/ ├── backend/ # Python Flask backend └── frontend/ # React frontend
-
Navigate to the backend directory:
cd backend -
Install dependencies:
- Set up a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
- Install Python packages:
pip install -r requirements.txt
- Set up a virtual environment (optional but recommended):
-
Configure MongoDB:
- Ensure MongoDB is running on your system.
- In
app.py, adjust the MongoDB connection string as needed:client = MongoClient("mongodb://localhost:27017/")
-
Set up OpenAI API Key:
- Add your OpenAI API key in
app.py:openai.api_key = "YOUR_OPENAI_API_KEY"
- Add your OpenAI API key in
-
Run the Flask server:
python app.py
- The server should start on
http://localhost:5000.
- The server should start on
-
Navigate to the frontend directory:
cd ../frontend -
Install dependencies:
npm install
-
Configure API URL:
- In the frontend source code, ensure all API calls point to
http://localhost:5000(default Flask server URL).
- In the frontend source code, ensure all API calls point to
-
Run the React application:
npm start
- The React app should start on
http://localhost:3000.
- The React app should start on
With both backend and frontend running:
- Go to
http://localhost:3000in your browser to view the application. - The frontend communicates with the backend at
http://localhost:5000for API requests.
The backend provides several endpoints for interacting with the pitch decks:
-
File Upload and Analysis:
POST /api/upload: Upload a new pitch deck (PDF).POST /api/analyze: Analyze an uploaded pitch deck.POST /api/round_two_analysis: Run a detailed analysis on pitch decks.
-
File Management:
GET /api/local-uploads: List all locally stored uploads.DELETE /api/delete/<filename>: Delete an uploaded file by filename.
-
Analysis Retrieval and Ranking:
GET /api/r2_analyses: Retrieve all Round 2 analysis files.GET /api/r2_analyses/<filename>: Retrieve the analysis details of a specific pitch deck.
-
Upload Pitch Decks:
- Use the upload form on the frontend to select and upload PDF files.
-
Analyze Pitch Decks:
- Click the Analyze button on individual files to run an analysis on a specific pitch deck.
- Click the Analyze All button to analyze all uploaded pitch decks in one go.
-
View Rankings:
- The frontend displays a ranked list of pitch decks based on analysis scores.
-
Delete Files:
- Delete individual files by clicking the Delete button.
- Delete all files by clicking the Delete All button.
-
Backend Errors:
- Check if MongoDB is running.
- Confirm the OpenAI API key is correctly configured.
- Check Flask server logs for errors.
-
Frontend Errors:
- Ensure the frontend API URLs are correct.
- Check console logs in the browser for debugging.
-
CORS Issues:
- If CORS errors occur, ensure
flask-corsis installed and properly configured inapp.py.
- If CORS errors occur, ensure