feat: scaffold snipe repo

This commit is contained in:
pyr0ball 2026-03-25 12:38:08 -07:00
parent 3053285ba5
commit ac114da5e7
9 changed files with 115 additions and 0 deletions

4
.env.example Normal file
View file

@ -0,0 +1,4 @@
EBAY_CLIENT_ID=your-client-id-here
EBAY_CLIENT_SECRET=your-client-secret-here
EBAY_ENV=production # or: sandbox
SNIPE_DB=data/snipe.db

9
.gitignore vendored Normal file
View file

@ -0,0 +1,9 @@
__pycache__/
*.pyc
*.pyo
.env
*.egg-info/
dist/
.pytest_cache/
data/
.superpowers/

15
Dockerfile Normal file
View file

@ -0,0 +1,15 @@
FROM python:3.11-slim
WORKDIR /app
# Install circuitforge-core from sibling directory (compose sets context: ..)
COPY circuitforge-core/ ./circuitforge-core/
RUN pip install --no-cache-dir -e ./circuitforge-core
# Install snipe
COPY snipe/ ./snipe/
WORKDIR /app/snipe
RUN pip install --no-cache-dir -e .
EXPOSE 8506
CMD ["streamlit", "run", "app/app.py", "--server.port=8506", "--server.address=0.0.0.0"]

0
app/__init__.py Normal file
View file

8
compose.override.yml Normal file
View file

@ -0,0 +1,8 @@
services:
snipe:
volumes:
- ../circuitforge-core:/app/circuitforge-core
- ./app:/app/snipe/app
- ./data:/app/snipe/data
environment:
- STREAMLIT_SERVER_RUN_ON_SAVE=true

10
compose.yml Normal file
View file

@ -0,0 +1,10 @@
services:
snipe:
build:
context: ..
dockerfile: snipe/Dockerfile
ports:
- "8506:8506"
env_file: .env
volumes:
- ./data:/app/snipe/data

45
manage.sh Executable file
View file

@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -euo pipefail
SERVICE=snipe
PORT=8506
COMPOSE_FILE="compose.yml"
usage() {
echo "Usage: $0 {start|stop|restart|status|logs|open|update}"
exit 1
}
cmd="${1:-help}"
shift || true
case "$cmd" in
start)
docker compose -f "$COMPOSE_FILE" up -d
echo "$SERVICE started on http://localhost:$PORT"
;;
stop)
docker compose -f "$COMPOSE_FILE" down
;;
restart)
docker compose -f "$COMPOSE_FILE" down
docker compose -f "$COMPOSE_FILE" up -d
echo "$SERVICE restarted on http://localhost:$PORT"
;;
status)
docker compose -f "$COMPOSE_FILE" ps
;;
logs)
docker compose -f "$COMPOSE_FILE" logs -f "${@:-$SERVICE}"
;;
open)
xdg-open "http://localhost:$PORT" 2>/dev/null || open "http://localhost:$PORT"
;;
update)
docker compose -f "$COMPOSE_FILE" pull
docker compose -f "$COMPOSE_FILE" up -d --build
;;
*)
usage
;;
esac

24
pyproject.toml Normal file
View file

@ -0,0 +1,24 @@
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
[project]
name = "snipe"
version = "0.1.0"
description = "Auction listing monitor and trust scorer"
requires-python = ">=3.11"
dependencies = [
"circuitforge-core",
"streamlit>=1.32",
"requests>=2.31",
"imagehash>=4.3",
"Pillow>=10.0",
"python-dotenv>=1.0",
]
[tool.setuptools.packages.find]
where = ["."]
include = ["app*"]
[tool.pytest.ini_options]
testpaths = ["tests"]

0
tests/__init__.py Normal file
View file