# Crawl Audit Engine

This folder contains the Crawl Audit Engine scaffold for the Content Automation Engine.

## Setup

1. Copy `.env.example` to `.env`.
2. Update database credentials in `Crawl/.env` if needed.
3. Run `php Crawl/migrate.php` to create the crawl schema.
4. Run `php Crawl/seed.php` to insert the sample crawl project.

## Running the app

Open the app in a browser at:

`http://localhost/Content/Crawl/public`

The Content app sidebar now includes a direct entry point to the Crawl UI.

## Worker

Start the crawl worker from the Crawl directory:

`php Crawl/bin/worker.php --interval=2`

Optional flags:

- `--interval=SECONDS` — seconds between worker ticks
- `--iterations=N` — stop after N iterations

## Tests

Run simple smoke checks from the Crawl root:

`php Crawl/tests/smoke_api.php`

`php Crawl/tests/repository_test.php`

## Notes

- The Crawl app shares the existing `content_engine` database.
- Migrations create tables for `crawl_runs`, `crawl_pages`, `crawl_links`, `crawl_images`, and `crawl_queue`.
- The Content app sidebar now links to `/Content/Crawl/public` through a `/crawl` redirect route.
