Prerequisites
- Python 3.9 or higher
- Git
- uv — the package manager used by this project
Setup
Install uv
If you don’t have uv installed, the Makefile will install it for you during the next step. To install it manually:See the uv installation docs for more options.
Install dependencies
Run the install target, which syncs submodules and installs all Python dependencies including dev tools:This runs
uv sync --extra dev under the hood. You can also run that command directly if you prefer.Makefile command reference
All common tasks are available as Makefile targets. Run them from the repository root.| Command | Description |
|---|---|
make setup | Sync submodules and install uv if not present |
make install | Install all Python dependencies (uv sync --extra dev) |
make upgrade | Upgrade all dependencies to their latest allowed versions |
make start | Start the backend server |
make watch | Start the backend server with auto-reload on file changes |
make lint | Run black, isort, and flake8 checks |
make build | Full build: version check, install, wheel, and exe |
make build-wheel | Build a Python wheel (.whl) only |
make build-exe | Build a standalone executable via PyInstaller |
make add-dep PKG | Add a runtime dependency (e.g. make add-dep httpx) |
make add-dev PKG | Add a dev-only dependency (e.g. make add-dev black) |
make rm-dep PKG | Remove a runtime dependency |
make rm-dev PKG | Remove a dev-only dependency |
make docker-build | Build the Docker application image |
make docker-up | Start the stack with Docker Compose (background) |
make docker-down | Stop the Docker Compose stack |
make docker-logs | Stream logs from running containers |
make clean | Remove .venv, build, dist, and cache directories |
make pull | Git pull with rebase and update submodules |
make version | Print the current version from lncrawl/VERSION |
Linting
Run the full lint suite before opening a pull request:- black — code formatting
- isort — import ordering
- flake8 — style and error checking (configured in
.flake8)
Building
Docker development
You can also develop and test using Docker:scripts/local-compose.yml.
Managing dependencies
Add and remove dependencies with uv through the Makefile targets. This keepspyproject.toml and uv.lock in sync automatically.
Project structure
Key directories and what they contain:| Path | Description |
|---|---|
lncrawl/ | Main application package |
lncrawl/core/ | Core base classes: Crawler, Scraper, TaskManager |
lncrawl/templates/ | Crawler templates: soup/, browser/, madara.py, etc. |
lncrawl/models/ | Data models: Chapter, Volume, Novel, SearchResult |
lncrawl/server/ | FastAPI server and REST API endpoints |
lncrawl/services/ | Application services: binder, sources registry, jobs |
lncrawl/dao/ | Database access objects (SQLAlchemy/SQLModel) |
sources/ | All source crawlers, organized by language |
sources/_examples/ | Template examples for new crawlers |
sources/en/ | English-language crawlers, split by first letter |
sources/multi/ | Multi-language crawlers |
scripts/ | Build and Docker scripts |
All core services (config, db, http, sources, binder, jobs) are accessed through the
AppContext singleton (ctx). See lncrawl/context.py for details.