chore: add Makefile + .env.example for rmi-backend
Makefile: standard targets (install/dev/build/lint/format/check/ typecheck/test/test-all/security/ci/clean) matching fleet convention. .env.example: documents all env vars used by the backend: - Runtime, Database, Auth, CORS, Rate limiting - AI providers (Ollama, OpenRouter, DeepSeek, HuggingFace) - Langfuse observability - External APIs (CoinGecko, Etherscan, Birdeye, GoPlus, Basescan) - Supabase, Telegram bot, Scan limits, Apify, RAG
This commit is contained in:
parent
aee1c048b6
commit
3c7d1638f2
2 changed files with 114 additions and 0 deletions
65
.env.example
Normal file
65
.env.example
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# RMI Backend — Environment Variables
|
||||
# Copy this to .env and fill in real values for local dev.
|
||||
# DO NOT commit .env — it's in .gitignore.
|
||||
|
||||
# ── Runtime ──────────────────────────────────────────────────────
|
||||
ENVIRONMENT=dev
|
||||
LOG_LEVEL=INFO
|
||||
PORT=8000
|
||||
|
||||
# ── Database / Cache ────────────────────────────────────────────
|
||||
DATABASE_URL=postgresql+asyncpg://rmi:rmi@localhost/rmi
|
||||
REDIS_URL=redis://localhost:6379/0
|
||||
|
||||
# ── Auth ────────────────────────────────────────────────────────
|
||||
JWT_SECRET=dev-secret-CHANGE-ME
|
||||
JWT_ALGORITHM=HS256
|
||||
JWT_EXPIRE_MINUTES=1440
|
||||
|
||||
# ── CORS ────────────────────────────────────────────────────────
|
||||
CORS_ORIGINS=["*"]
|
||||
|
||||
# ── Rate limiting ───────────────────────────────────────────────
|
||||
RATE_LIMIT_PER_MINUTE=100
|
||||
|
||||
# ── AI providers ────────────────────────────────────────────────
|
||||
OLLAMA_URL=http://localhost:11434
|
||||
OPENROUTER_API_KEY=
|
||||
HUGGINGFACE_TOKEN=
|
||||
DEEPSEEK_API_KEY=
|
||||
OLLAMA_API_KEY=
|
||||
|
||||
# ── Langfuse v4 (observability) ─────────────────────────────────
|
||||
LANGFUSE_PUBLIC_KEY=
|
||||
LANGFUSE_SECRET_KEY=
|
||||
LANGFUSE_HOST=http://localhost:3002
|
||||
|
||||
# ── External APIs ───────────────────────────────────────────────
|
||||
COINGECKO_API_KEY=
|
||||
ETHERSCAN_API_KEY=
|
||||
BIRDEYE_API_KEY=
|
||||
GOPLUS_API_KEY=
|
||||
BASESCAN_API_KEY=
|
||||
|
||||
# ── Supabase (vector embeddings) ────────────────────────────────
|
||||
SUPABASE_URL=
|
||||
SUPABASE_SERVICE_KEY=
|
||||
|
||||
# ── Telegram Bot ────────────────────────────────────────────────
|
||||
RUGMUNCH_BOT_TOKEN=
|
||||
TELEGRAM_ALLOWED_USERS=7075336557
|
||||
RMI_BACKEND_URL=http://localhost:8000
|
||||
BOT_DB_PATH=/root/backend/data/bot_users.db
|
||||
|
||||
# ── Scan rate limits ─────────────────────────────────────────────
|
||||
FREE_SCAN_LIMIT=5
|
||||
PRO_SCAN_LIMIT=100
|
||||
ELITE_SCAN_LIMIT=0
|
||||
RMI_INTERNAL_KEY=rmi-internal-2026
|
||||
|
||||
# ── Apify ────────────────────────────────────────────────────────
|
||||
APIFY_API_TOKEN=
|
||||
|
||||
# ── RAG ──────────────────────────────────────────────────────────
|
||||
RAG_EMBEDDING_DIM=0
|
||||
RAG_TABLE_DIM=640
|
||||
49
Makefile
Normal file
49
Makefile
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
.PHONY: help install dev build lint format check test typecheck security ci clean
|
||||
|
||||
help: ## Show this help
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
install: ## Install dependencies
|
||||
pip install -e ".[dev]"
|
||||
pip install -r requirements.txt
|
||||
|
||||
dev: ## Start dev server
|
||||
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
|
||||
|
||||
build: ## Build Docker image
|
||||
docker build -t rmi-backend .
|
||||
|
||||
lint: ## Lint with ruff
|
||||
ruff check app/ tests/
|
||||
|
||||
format: ## Format with ruff (writes)
|
||||
ruff format app/ tests/
|
||||
ruff check --fix app/ tests/
|
||||
|
||||
check: ## Full check: lint + format + typecheck + test
|
||||
ruff check app/ tests/
|
||||
ruff format --check app/ tests/
|
||||
mypy app/ --ignore-missing-imports
|
||||
pytest tests/ -x -q -m "not integration"
|
||||
|
||||
typecheck: ## MyPy type check
|
||||
mypy app/ --ignore-missing-imports
|
||||
|
||||
test: ## Run tests (non-integration)
|
||||
pytest tests/ -x -q -m "not integration"
|
||||
|
||||
test-all: ## Run ALL tests including integration
|
||||
pytest tests/ -q
|
||||
|
||||
security: ## Security audit
|
||||
bandit -r app/ -q
|
||||
ruff check --select S app/ tests/
|
||||
|
||||
ci: ## Full CI pipeline
|
||||
ruff check app/ tests/
|
||||
ruff format --check app/ tests/
|
||||
mypy app/ --ignore-missing-imports
|
||||
pytest tests/ -x -q -m "not integration"
|
||||
|
||||
clean: ## Remove build artifacts
|
||||
rm -rf dist build *.egg-info .pytest_cache .mypy_cache .ruff_cache
|
||||
Loading…
Add table
Add a link
Reference in a new issue