A full-stack application for generating hierarchical test cases (L1, L2, L3) based on business requirements using LangGraph and AI.
- 🔐 User authentication (Signup/Login)
- 📝 Create multiple test case generation sessions
- 🤖 AI-powered test case generation
- 🌳 Interactive tree visualization of test cases
- 📊 Session history and management
- 💾 Persistent storage of all sessions
- FastAPI
- SQLAlchemy (SQLite/PostgreSQL)
- JWT Authentication
- LangGraph for workflow management
- OpenAI API
- React 18
- Vite
- Tailwind CSS
- React Router
- Axios
- Python 3.8+
- Node.js 18+
- OpenAI API Key
- Navigate to backend directory:
cd backend- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create
.envfile in the root directory:
OPENAI_API_KEY=your-openai-api-key-here
DATABASE_URL=sqlite:///./testcasegen.db
SECRET_KEY=your-secret-key-change-this-in-production
- Run the backend server:
python main.pyThe API will be available at http://localhost:8000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will be available at http://localhost:3000
- Sign Up: Create a new account
- Login: Sign in with your credentials
- Create Session: Click "New Session" and enter your business description
- Answer Questions: Answer optional clarification questions
- Select Test Cases: Click on L1/L2 test cases to explore further
- View Tree: See the complete hierarchical tree of test cases
.
├── backend/
│ ├── main.py # FastAPI application
│ ├── database.py # Database configuration
│ ├── models.py # SQLAlchemy models
│ ├── schemas.py # Pydantic schemas
│ ├── auth.py # Authentication utilities
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── src/
│ │ ├── pages/ # Page components
│ │ ├── components/ # Reusable components
│ │ ├── contexts/ # React contexts
│ │ └── services/ # API services
│ └── package.json # Node dependencies
├── testcasegen.py # Core test case generation logic
└── README.md
POST /api/auth/signup- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user
GET /api/sessions- Get all user sessionsPOST /api/sessions- Create new sessionGET /api/sessions/{id}- Get session detailsDELETE /api/sessions/{id}- Delete session
POST /api/sessions/{id}/start- Start test case generationPOST /api/sessions/{id}/l1/answers- Submit L1 answersPOST /api/sessions/{id}/l1/select- Select L1 casePOST /api/sessions/{id}/l2/answers- Submit L2 answersPOST /api/sessions/{id}/l2/select- Select L2 casePOST /api/sessions/{id}/l3/answers- Submit L3 answersGET /api/sessions/{id}/state- Get session state
cd backend
uvicorn main:app --reloadcd frontend
npm run dev- Make sure to set your OpenAI API key in the
.envfile - The backend uses SQLite by default. For production, consider PostgreSQL
- Change the SECRET_KEY in
backend/auth.pyfor production use - CORS is configured for localhost:3000 and localhost:5173