AI-powered platform for predicting crop growth and yield by alternating genes using CRISPR technology.
AgroTerror is a comprehensive system that combines multiple AI models and services to provide gene editing analysis for agricultural applications. The platform integrates DNABERT for mutation validation, Graph-CRISPR for guide RNA suggestions, and HapMap3 SNP data for comprehensive analysis.
┌─────────────────────────────────────────────────────────────┐
│ Frontend (Next.js) │
│ http://localhost:3000 │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Main Server (FastAPI) │
│ http://localhost:8000 │
│ - Authentication │
│ - LLM Queries (Gemini) │
│ - Gene Analysis Integration │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Gene Edit Service (FastAPI) │
│ http://localhost:8001 │
│ - Graph-CRISPR Integration │
│ - DNABERT Validation │
│ - SNP Analysis │
└──────────────────────┬──────────────────────────────────────┘
│
┌──────────────┴──────────────┐
│ │
┌───────▼────────┐ ┌─────────▼────────┐
│ Graph-CRISPR │ │ DNABERT │
│ Model │ │ Model │
└────────────────┘ └──────────────────┘
AgroTerror/
├── frontend/ # Next.js frontend application
│ ├── app/ # Next.js App Router pages
│ │ ├── dashboard/ # User dashboard
│ │ ├── home/ # Home pages
│ │ ├── analysis/ # Gene analysis interface
│ │ └── login/ # Authentication pages
│ ├── components/ # React components
│ │ ├── animations/ # 3D DNA animations
│ │ ├── chatbot/ # Chatbot widget
│ │ └── ui/ # UI components
│ ├── lib/ # Utility libraries
│ └── public/ # Static assets
├── server/ # Main FastAPI server
│ ├── core/ # Core configuration and utilities
│ ├── routers/ # API route handlers
│ │ ├── auth.py # Authentication endpoints
│ │ ├── llm.py # LLM query endpoints
│ │ └── gene_analysis.py # Gene analysis endpoints
│ ├── services/ # Business logic services
│ ├── schemas/ # Pydantic models
│ └── model/ # Database models
├── microservices/
│ ├── DNABERT/ # DNABERT model and tools
│ ├── Graph-CRISPR/ # Graph-CRISPR model
│ └── gene_edit_service/ # Gene edit microservice
│ ├── services/ # Service implementations
│ │ ├── bim_parser.py # BIM file parser
│ │ ├── graph_crispr_service.py # Graph-CRISPR integration
│ │ ├── dnabert_service.py # DNABERT integration
│ │ ├── redis_cache.py # Redis caching
│ │ └── dataset_manager.py # Dataset management
│ ├── models.py # Pydantic models
│ └── main.py # FastAPI application
└── docs/ # Documentation
├── README.md # Documentation index
├── server.md # Server documentation
├── frontend.md # Frontend documentation
├── gene-edit-service.md # Gene edit service documentation
├── dnabert.md # DNABERT documentation
└── graph-crispr.md # Graph-CRISPR documentation
- JWT-based authentication
- User registration and login
- Protected routes and API endpoints
- DNA sequence analysis
- CRISPR guide RNA suggestions
- Edit efficiency prediction
- Mutation validation using DNABERT
- SNP analysis with HapMap3 data
- Multi-dataset support (maize, rice, soybean, etc.)
- Google Gemini integration
- Multi-language support (English, Hindi, Kannada)
- Difficulty levels (Basic, Intermediate, Advanced)
- Educational chatbot for CRISPR and gene editing
- Interactive 3D DNA models
- Real-time editing visualization
- Three.js integration
- Store analysis results
- View past analyses
- Comprehensive reporting
- Python 3.11+
- Node.js 18+
- MongoDB
- Redis (optional)
- CUDA-capable GPU (optional, for model inference)
git clone <repository-url>
cd AgroTerrorcd frontend
npm install
npm run devThe frontend will be available at http://localhost:3000
cd server
# Create .env file with configuration
cp .env.example .env
# Edit .env with your settings
# Install dependencies
pip install -r requirements.txt
# Or using uv
uv sync
# Run server
uvicorn main:app --reloadThe server will be available at http://localhost:8000
cd microservices/gene_edit_service
# Create .env file with configuration
# Edit .env with your settings
# Install dependencies
pip install -r requirements.txt
# Or using uv
uv sync
# Run service
python main.pyThe service will be available at http://localhost:8001
# Install MongoDB
# Start MongoDB service
mongod# Install Redis
# Start Redis service
redis-server
# Or using Docker
docker-compose up -dCreate a .env file in the server/ directory:
# MongoDB Configuration
MONGO_URI=mongodb://localhost:27017
DATABASE_NAME=agroterror
# JWT Configuration
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
# CORS Configuration
CORS_ORIGINS=["*"]
# Gemini LLM Configuration
GEMINI_API_KEY=your-gemini-api-key
# Gene Edit Service Configuration
GENE_EDIT_SERVICE_URL=http://localhost:8001
# Redis Configuration (optional)
REDIS_URL=redis://localhost:6379/0
REDIS_CACHE_TTL=86400Create a .env file in the microservices/gene_edit_service/ directory:
# Graph-CRISPR Configuration
GRAPH_CRISPR_CONFIG_PATH=/path/to/config_BE.json
GRAPH_CRISPR_MODEL_PATH=/path/to/model.pt
# DNABERT Configuration
DNABERT_MODEL_PATH=/path/to/dnabert_model
DNABERT_KMER=6
# BIM File Configuration
BIM_FILE_PATH=/path/to/maize.bim
DEFAULT_DATASET=maize
# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=
REDIS_ENABLED=true
# Server Configuration
HOST=0.0.0.0
PORT=8001
LOG_LEVEL=INFO
# Device Configuration
DEVICE=cudaCreate a .env.local file in the frontend/ directory:
NEXT_PUBLIC_API_URL=http://localhost:8000Comprehensive documentation is available in the docs/ directory:
- Documentation Index - Overview of all documentation
- Server Documentation - Server setup and API endpoints
- Frontend Documentation - Frontend setup and features
- Gene Edit Service Documentation - Microservice documentation
- DNABERT Documentation - DNABERT model documentation
- Graph-CRISPR Documentation - Graph-CRISPR model documentation
Once the servers are running, interactive API documentation is available at:
- Main Server:
http://localhost:8000/docs - Gene Edit Service:
http://localhost:8001/docs
- Frontend:
cd frontend && npm run dev - Server:
cd server && uvicorn main:app --reload - Gene Edit Service:
cd microservices/gene_edit_service && python main.py
# Test server
cd server
pytest
# Test gene edit service
cd microservices/gene_edit_service
pytest
# Test frontend
cd frontend
npm testSee individual service documentation for Docker deployment instructions.
- Build frontend for production
- Deploy server with proper configuration
- Deploy gene edit service with model files
- Configure MongoDB and Redis
- Set up environment variables
- Configure CORS and security settings
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
See LICENSE file for license information.
For issues or questions:
- Check the documentation in
docs/ - Review the troubleshooting sections
- Check the API documentation
- Review code comments and examples
- DNABERT: Pre-trained model for DNA sequence analysis
- Graph-CRISPR: Graph neural network for CRISPR guide RNA prediction
- HapMap3: SNP data for genetic analysis
- Google Gemini: LLM for educational queries