diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..3cc1495e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +# Version control +.git/ +.gitignore + +# Python +__pycache__/ +*.pyc +*.pyo +.venv/ + +# Node +node_modules/ + +# Dev tooling +.pre-commit-config.yaml +ruff.toml +justfile +.claude/ + +# CI/CD & deployment configs +.gitlab-ci.yml +install/vagrant/ + +# Documentation (not needed in image) +*.md +LICENSE + +# OS files +.DS_Store +Thumbs.db diff --git a/.gitignore b/.gitignore index 01fe9620..e1393d80 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,7 @@ outputs # Pyenv # ######### .python-version + +# Dev virtualenv # +################### +.venv/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..43d3ca98 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.7 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..91fa8bfe --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,32 @@ +# iKy - OSINT Tool + +## Project Structure + +- `backend/` — Python 3.12 Flask + Celery backend +- `frontend/` — Angular frontend +- `install/docker/` — Dockerfiles and compose config + +## Coding Style + +All Python code MUST comply with the project's `ruff.toml` configuration: + +- **Formatter**: ruff format (black-compatible), line-length 88, target py312 +- **Linter rules**: E, F, W (pycodestyle/pyflakes), I (isort), B (bugbear), UP (pyupgrade), SIM (simplify), C4 (comprehensions), A (builtins), RUF (ruff-specific) +- **Ignored**: E203 (black-compatible whitespace), E501 (line length handled by formatter) +- **Tests**: S101 (assert usage) is allowed in `**/tests/**` + +When writing or modifying Python code: + +1. Use modern Python 3.12 idioms (f-strings, `|` union types, `match`, etc.) +2. Keep lines at 88 chars max +3. Sort imports with isort style (stdlib, third-party, local — separated by blank lines) +4. Prefer list/dict/set comprehensions over map/filter +5. Avoid shadowing Python builtins (rule A) +6. Use `pathlib.Path` over `os.path` where practical + +## Dev Workflow + +- `just setup` — create `.venv/` with pre-commit and ruff (pinned to match pre-commit config) +- `just lint` / `just fmt` — check or auto-fix with ruff from the venv +- `just build` / `just up` / `just down` — Docker lifecycle +- `just test` — run pytest inside the backend container diff --git a/README.es.md b/README.es.md index d692b594..9319b96e 100644 --- a/README.es.md +++ b/README.es.md @@ -6,11 +6,12 @@
Redis - Python + Python Celery Flask - Node - Angular + Node + Angular + Docker