A web application built for Hacklahoma 2025 using React frontend and Python/LangGraph backend using GenAI.
project/
├── frontend/ # React frontend
│ ├── public/
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ └── App.tsx
│ └── package.json
│
├── backend/ # Python backend
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ ├── graphs/ # LangGraph flows
│ │ │ ├── nodes/ # Individual graph nodes
│ │ │ └── flows/ # Graph flow definitions
│ │ ├── models/ # Data models
│ │ ├── routes/ # API routes
│ │ ├── utils/ # Utility functions
│ │ └── api/ # API endpoints
│ ├── tests/ # Test files
│ │ ├── test_nodes.py # Node unit tests
│ │ ├── test_flow.py # Flow integration tests
│ │ └── test_api.py # API endpoint tests
│ ├── .env # Environment variables
│ └── requirements.txt
│
└── README.md
- Python 3.8+
- Node.js 16+
- MongoDB installed locally or MongoDB Atlas account
- OpenAI API key
- Groq API key
-
Set up Python virtual environment:
cd backend python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate
-
Install Python dependencies:
pip install -r requirements.txt
-
Configure environment variables:
# Copy the example environment file cp .env.example .env # Edit .env with your settings # Particularly, add your Groq API key
Required environment variables:
GROQ_API_KEY: Your Groq API keyMONGODB_URL: MongoDB connection stringDATABASE_NAME: Name of the MongoDB databaseMODEL_NAME: Groq model to use (default: mixtral-8x7b-32768)MODEL_TEMPERATURE: Model temperature (default: 0.2)MAX_ITERATIONS: Maximum feedback loop iterations (default: 3)LOG_LEVEL: Logging level (default: INFO)
-
Start the backend server:
uvicorn main:app --reload
- Install Node.js dependencies:
cd frontend npm install dependencies
cd backend
pytest tests/Available test suites:
test_nodes.py: Unit tests for individual LangGraph nodestest_flow.py: Integration tests for the graph flowtest_api.py: API endpoint tests
cd frontend
npm test- Local MongoDB:
Or ensure your MongoDB Atlas cluster is running
mongod
cd backend
source venv/bin/activate # On Windows: .\venv\Scripts\activate
uvicorn main:app --reloadcd frontend
npm run dev- Planning Node: Analyzes user input and creates integration plan
- Supervisor Node: Divides work into coding and testing tasks
- Parallel Execution:
- Coder Node: Generates implementation code
- Tester Node: Creates test cases
- Evaluator Node: Reviews code and test results
- Feedback Loop: Supervisor reviews and decides on next steps
- Frontend:
- React
- TypeScript
- Tailwind
- Vite
- Axios
- Backend:
- Python
- FastAPI
- LangGraph
- LangChain
- PyTest (Testing)
- Run tests before committing changes
- Check logs in
backend/logs/for debugging - Maximum 3 iterations for API integration feedback loop
- Use type hints and documentation
- Follow error handling patterns in BaseNode
Louis, Raeed, Kyumin, and Devi
[Add license information]