Web app that analyzes Python code for security issues using Semgrep (static analysis) and an OpenAI Agents workflow via the Semgrep MCP server.
- Security scanning: Semgrep findings with AI-assisted explanation and remediation hints
- Simple local dev: Next.js UI (port
3000) + FastAPI API (port8000) - Single-container production: FastAPI serves the statically exported frontend on port
8000 - Infrastructure as code: Terraform stacks for AWS / Azure / GCP (optional)
| Layer | Tech |
|---|---|
| Frontend | Next.js (TypeScript), Tailwind |
| Backend | Python 3.12, FastAPI, uv |
| Analysis | Semgrep, MCP, OpenAI Agents |
| Infra | Terraform (AWS, Azure, GCP) |
- Python 3.12+ and uv
- Node.js 20+ and npm
- Docker (optional, for container run)
- Terraform (optional, for cloud deploy)
Create a .env in the repo root (do not commit it):
OPENAI_API_KEY— OpenAI API accessSEMGREP_APP_TOKEN— Semgrep (Semgrep Cloud / App token as required by your setup)
Backend (port 8000):
cd backend
uv sync
uv run server.pyFrontend (port 3000, separate terminal):
cd frontend
npm install
npm run devOpen http://localhost:3000.
From the repo root (with .env present):
docker build -t cyber-analyzer .
docker run --rm -p 8000:8000 --env-file .env cyber-analyzerOpen http://localhost:8000.
├── backend/ # FastAPI app, MCP / agent wiring
├── frontend/ # Next.js UI (static export in production)
├── terraform/ # azure/, gcp/, aws/ — infra as code
├── scripts/ # deploy-aws.sh, destroy-aws.sh
├── Dockerfile # Single-container production build
Terraform stacks live under:
terraform/aws(AWS App Runner + ECR)terraform/azure(Azure Container Apps)terraform/gcp(GCP Cloud Run)
See terraform/README.md for per-cloud details and prerequisites.
From the repo root:
aws sts get-caller-identity
./scripts/deploy-aws.shIt prints the Service URL at the end.
./scripts/check-aws-deploy.sh
./scripts/check-aws-cleanup.shUse the Terraform stacks in terraform/azure and terraform/gcp. The quickest way to get oriented is to start with:
terraform/README.md(overview + commands)terraform/azure(Azure Container Apps)terraform/gcp(GCP Cloud Run)