Skip to content

Latest commit

 

History

History
280 lines (223 loc) · 8.73 KB

File metadata and controls

280 lines (223 loc) · 8.73 KB

WebGenie Backend - Complete Project Index

📖 Documentation Map

Start here for different use cases:

🚀 Getting Started

🔗 Integration

Reference


📁 Directory Structure

webgenie_api/
│
├── 📄 DOCUMENTATION
│   ├── QUICK_START.md                 ← START HERE
│   ├── README.md
│   ├── FRONTEND_INTEGRATION.md
│   ├── TRANSFORMATION_SUMMARY.md
│   ├── IMPLEMENTATION_CHECKLIST.md
│   └── INDEX.md                       ← You are here
│
├── 📦 APPLICATION CODE
│   └── app/
│       ├── main.py                    # FastAPI application
│       ├── __init__.py
│       │
│       ├── core/                      # Configuration & Setup
│       │   ├── config.py             # Pydantic settings
│       │   ├── logging.py            # JSON logging
│       │   ├── tasks.py              # Celery configuration
│       │   └── __init__.py
│       │
│       ├── api/                       # REST Endpoints
│       │   ├── datasets.py           # Dataset CRUD
│       │   ├── jobs.py               # Job management
│       │   ├── results.py            # Results & analysis
│       │   └── __init__.py
│       │
│       ├── services/                  # Business Logic
│       │   ├── datasets_service.py   # Dataset operations
│       │   ├── jobs_service.py       # Job orchestration
│       │   ├── inference_service.py  # Algorithm execution
│       │   ├── __init__.py
│       │   └── runners/              # Algorithm runners
│       │       ├── utils.py          # Shared utilities
│       │       ├── generic_runner.py # Generic GRN runner
│       │       └── __init__.py
│       │
│       ├── models/                    # Data Models (Pydantic)
│       │   ├── job.py                # Job schemas
│       │   ├── dataset.py            # Dataset schemas
│       │   ├── result.py             # Result schemas
│       │   └── __init__.py
│       │
│       └── workers/                   # Background Tasks
│           ├── tasks.py              # Celery tasks
│           └── __init__.py
│
├── 🧪 TESTS
│   └── tests/
│       ├── conftest.py               # Pytest fixtures
│       ├── test_api.py               # API tests
│       └── __init__.py
│
├── 🐳 DEPLOYMENT
│   ├── Dockerfile                    # Container image
│   ├── docker-compose.yml            # Full stack setup
│   ├── .env.example                  # Configuration template
│   └── run.py                        # Production startup
│
├── ⚙️ CONFIGURATION
│   ├── requirements.txt              # Dependencies
│   ├── pyproject.toml               # Project metadata
│   ├── setup-dev.sh                 # Dev setup script
│   └── .gitignore
│
└── 📄 THIS FILE
    └── INDEX.md

🎯 Quick Reference

API Endpoints Summary

15+ Endpoints organized by function:

Datasets (/api/v1/datasets)
  POST   /register                Register new dataset
  GET    /                        List datasets (paginated)
  GET    /{id}                    Get dataset
  GET    /{id}/preview            Preview data
  PATCH  /{id}                    Update metadata
  DELETE /{id}                    Delete dataset

Jobs (/api/v1/jobs)
  POST   /                        Submit job
  GET    /                        List jobs (filterable)
  GET    /{id}                    Get job status
  GET    /{id}/logs               Retrieve logs
  DELETE /{id}                    Cancel job

Results (/api/v1/results)
  GET    /job/{id}                Get result
  GET    /job/{id}/summary        Network summary
  POST   /compare                 Compare networks
  GET    /job/{id}/network/download   Download network
  POST   /job/{id}/export         Export (JSON/GraphML)

System
  GET    /health                  Health check
  GET    /                        API info
  GET    /api/v1/algorithms       Available algorithms

🚀 Getting Started Paths

Path 1: Just Run It (5 minutes)

  1. QUICK_START.md - Follow "Option 1: Docker Compose"
  2. Access http://localhost:8000/docs
  3. Try the endpoints

Path 2: Full Setup (15 minutes)

  1. QUICK_START.md - Follow "Option 2: Local Development"
  2. Run all 3-4 services
  3. Execute test requests
  4. Check logs and monitoring

Path 3: Frontend Integration (30 minutes)

  1. FRONTEND_INTEGRATION.md
  2. Set up frontend
  3. Configure API endpoints
  4. Test integration

Path 4: Deep Dive (1+ hours)

  1. README.md - Full documentation
  2. IMPLEMENTATION_CHECKLIST.md - All features
  3. Explore source code in app/
  4. Run tests in tests/

🔑 Key Technologies

Component Technology Purpose
API Framework FastAPI REST endpoints
Data Validation Pydantic Type safety
Task Queue Celery Async jobs
Cache/Broker Redis Message queue
Async asyncio Async operations
Logging python-json-logger Structured logs
Container Docker Isolation
Orchestration Docker Compose Full stack

🔄 Common Workflows

Register & Run Dataset

# 1. Register dataset
curl -X POST http://localhost:8000/api/v1/datasets/register \
  -d '{"name": "My Data", "source": {...}}'

# 2. Submit job
curl -X POST http://localhost:8000/api/v1/jobs \
  -d '{"dataset_id": "...", "algorithm": "GRNBOOST2"}'

# 3. Monitor
curl http://localhost:8000/api/v1/jobs/job-xxx

# 4. Get results
curl http://localhost:8000/api/v1/results/job/job-xxx/summary

Run Tests

cd webgenie_api
pytest                    # All tests
pytest -v               # Verbose
pytest --cov=app        # With coverage

View Logs

docker-compose logs -f backend      # Backend logs
docker-compose logs -f redis        # Redis logs
docker-compose logs -f celery       # Celery worker

Stop Services

docker-compose down         # Stop
docker-compose down -v      # Stop and remove volumes

🎓 Learning Resources

For API Users

  1. Start with QUICK_START.md
  2. Try interactive docs at http://localhost:8000/docs
  3. Read README.md for details

For Frontend Developers

  1. Read FRONTEND_INTEGRATION.md
  2. Copy example components
  3. Configure CORS and API URL

For Backend Developers

  1. Explore app/core/ for configuration
  2. Read app/services/ for business logic
  3. Check app/api/ for endpoint definitions
  4. Review app/models/ for data schemas

For DevOps/Deployment

  1. Study Dockerfile for container image
  2. Review docker-compose.yml for full stack
  3. Check .env.example for configuration
  4. See README.md production section

✅ Pre-Launch Checklist


🆘 Help & Support

Can't find something?

  1. Quick start issuesQUICK_START.md
  2. API questionshttp://localhost:8000/docs (interactive)
  3. Frontend integrationFRONTEND_INTEGRATION.md
  4. Feature detailsIMPLEMENTATION_CHECKLIST.md
  5. General infoREADME.md
  6. Project overviewTRANSFORMATION_SUMMARY.md

🎉 Ready to Get Started?

  1. First time? → Go to QUICK_START.md
  2. Want details? → Read README.md
  3. Integrating frontend? → Check FRONTEND_INTEGRATION.md
  4. Need reference? → See IMPLEMENTATION_CHECKLIST.md