Graveyard Mining is an evidence-based risk assessment platform that mines abandoned GitHub repositories, diagnoses why they failed using GPT-4o-mini, performs security audits via OSV and Socket, and generates risk-armored 5-phase project roadmaps before writing code.
+----------------------------------+
| Users / Web Client |
+----------------------------------+
|
| HTTPS
v
+----------------------------------+
| Vercel (Next.js 14 UI) |
+----------------------------------+
|
| REST API (JSON)
v
+----------------------------------+
| Railway (FastAPI Service) |
| |
| - SlowAPI Rate Limiter |
| - Gunicorn Multi-Worker |
| - AnalysisService Pipeline |
+----------------------------------+
/ | \
/ | \
v v v
+---------------+ +---------------+ +------------------------+
| OpenAI API | | GitHub API | | Supabase PostgreSQL |
| GPT-4o-mini | | Search/Triage | | Transaction Pooler |
| Embeddings | | Tavily Web | | Alembic Migrations |
+---------------+ +---------------+ +------------------------+
├── backend/
│ ├── alembic/ # Database migration scripts
│ ├── api/
│ │ └── routes.py # Thin FastAPI route handlers
│ ├── models/
│ │ └── models.py # SQLAlchemy ORM schemas
│ ├── schemas/
│ │ └── schemas.py # Pydantic request/response models
│ ├── services/
│ │ ├── ai_service.py # OpenAI LLM diagnoses, embeddings & roadmaps
│ │ ├── analysis_service.py # Core pipeline orchestrator
│ │ ├── github_service.py # GitHub REST API & Tavily context
│ │ ├── security_service.py # OSV/Libraries.io/Socket security checks
│ │ ├── report_service.py # DB persistence & JSON serialization
│ │ ├── repo_triage.py # Abandonment scoring heuristics
│ │ └── clustering.py # KMeans failure vector clustering
│ ├── app.py # FastAPI entry point & security middleware
│ ├── database.py # SQLAlchemy engine configuration
│ ├── logging_config.py # Centralized structured logger
│ ├── Dockerfile # Multi-stage production container
│ ├── railway.toml # Railway platform deployment spec
│ ├── alembic.ini # Migration configuration
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── app/ # Next.js App Router pages
│ ├── components/ # UI components (Dashboard, Form, Roadmap)
│ ├── package.json # Node.js dependencies
│ └── tailwind.config.js # Tailwind styling rules
├── .github/workflows/ci.yml # GitHub Actions CI pipeline
├── start.ps1 # Single-command local dev launcher
└── README.md # Project documentation
- Python 3.10+
- Node.js 18+
- PowerShell (Windows)
Run both backend (http://localhost:8000) and frontend (http://localhost:3000) concurrently with live color-coded logs:
.\start.ps1Flags available:
.\start.ps1 -BackendOnly— Run FastAPI backend only.\start.ps1 -FrontendOnly— Run Next.js frontend only.\start.ps1 -NoBrowser— Suppress auto-opening the browser
Spin up the entire stack (PostgreSQL 16, pgAdmin 4, FastAPI Backend, Next.js Frontend) with a single command:
cp .env.example .envUpdate .env with your OPENAI_API_KEY and optional GITHUB_TOKEN.
docker compose up --build| Service | URL | Credentials |
|---|---|---|
| Next.js Frontend | http://localhost:3000 |
N/A |
| FastAPI Backend | http://localhost:8000 |
N/A |
| Swagger API Docs | http://localhost:8000/docs |
N/A |
| pgAdmin 4 | http://localhost:5050 |
admin@example.com / admin |
| PostgreSQL DB | localhost:5432 |
postgres / postgres / DB: graveyard_mining |
Note on Database Portability: The backend detects
DATABASE_URL. Switching from local Docker PostgreSQL to Railway or Supabase PostgreSQL requires changing only theDATABASE_URLenvironment variable. SQLite is retained as a fallback for lightweight development whenDATABASE_URLis omitted.
Copy .env.example in backend/ and frontend/:
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL URI (postgresql://...) or local SQLite (sqlite:///./graveyard_mining.db) |
OPENAI_API_KEY |
Yes | OpenAI API key for GPT-4o-mini diagnosis & embeddings |
GITHUB_TOKEN |
Recommended | GitHub Personal Access Token (increases rate limit from 60 to 5000 req/hr) |
TAVILY_API_KEY |
Optional | Tavily Web Search API key for repo post-mortem context |
CORS_ORIGINS |
Yes | Comma-separated allowed origins (e.g. http://localhost:3000,https://app.vercel.app) |
SENTRY_DSN |
Optional | Sentry monitoring DSN |
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_API_URL |
Yes | Full URL of the backend service (e.g. https://api.up.railway.app or http://localhost:8000) |
The application uses SQLAlchemy with Alembic migration support. In Docker, migrations run automatically on startup via entrypoint.sh.
cd backend
alembic upgrade headcd backend
alembic revision --autogenerate -m "Add new column"- Create a project at supabase.com.
- Navigate to Project Settings → Database → Connection String → URI.
- Copy the transaction pooler connection string and set
DATABASE_URLin Railway.
- Connect your GitHub repository to Railway.
- Select the
backend/directory for deployment. - Railway auto-detects
Dockerfileorrailway.toml. - Add environment variables under Railway service settings.
- Import repository on Vercel.
- Set root directory to
frontend. - Add Environment Variable:
NEXT_PUBLIC_API_URL=https://<your-railway-backend-url>
| Method | Endpoint | Description | Rate Limit | Reasoning |
|---|---|---|---|---|
GET |
/health |
Health check endpoint | Unlimited | Unthrottled system monitoring |
GET |
/ |
Root API metadata | Unlimited | Lightweight metadata |
POST |
/api/analyze |
Execute full project risk analysis | 7 req / min | Heavy GitHub API + OpenAI LLM + DB write pipeline |
GET |
/api/analyses |
List recent project analyses | 40 req / min | Read-only lightweight DB queries |
GET |
/api/analysis/{id} |
Get specific analysis report by ID | 40 req / min | Read-only report lookup |
Verify production setup after deployment:
# 1. Health Check
curl -I https://your-backend.up.railway.app/health
# Expected: HTTP/1.1 200 OK -> {"status": "ok"}
# 2. Open Swagger Documentation
https://your-backend.up.railway.app/docs