web/README.md

104 lines
3.3 KiB
Markdown
Raw Normal View History

2026-08-23 21:52:51 +02:00
# Anagram Finder
[![License](https://img.shields.io/badge/license-AGPL--3.0-blue)](LICENSE)
[![Release](https://img.shields.io/gitea/v/release/anagram-finder/web?gitea_url=https%3A%2F%2Fforge.lvl0.xyz)](https://forge.lvl0.xyz/anagram-finder/web/releases)
Type a handful of letters, get every word you can build from them. Self-hosted, no accounts,
no tracking — one input and a list of results.
![Anagram Finder](docs/screenshots/anagram-finder.png)
## Features
- Finds every dictionary word that fits your letters, longest first
- 466,000-word English dictionary, bundled — no external lookups
- Results are cached, so a repeated search is instant
- Shareable result URLs (`/find/eamstoxil`)
- Works without JavaScript; the whole thing is one form and one page
- Terminal-styled, dark by default, readable on a phone
## Self-hosting
Images are published to `forge.lvl0.xyz/anagram-finder/web`. Grab
[`compose.yaml`](compose.yaml), set the three required variables, and start it:
```bash
mkdir anagram-finder && cd anagram-finder
curl -O https://forge.lvl0.xyz/anagram-finder/web/raw/branch/main/compose.yaml
cat > .env <<EOF
APP_KEY=base64:$(openssl rand -base64 32)
APP_URL=http://localhost:8000
DB_PASSWORD=$(openssl rand -hex 16)
DB_ROOT_PASSWORD=$(openssl rand -hex 16)
EOF
docker compose up -d
```
The app is then on <http://127.0.0.1:8000>. It binds to localhost only; put a reverse proxy in
front of it for anything public-facing.
`compose.yaml` pins `:latest`. Check [Releases](https://forge.lvl0.xyz/anagram-finder/web/releases)
and pin a version tag if you would rather upgrade deliberately.
### Configuration
The snippet above generates everything required. In full:
| Variable | Description |
|---|---|
| `APP_KEY` | Encryption key, `base64:` prefixed |
| `APP_URL` | The address people will actually use |
| `DB_PASSWORD` | Database password |
| `DB_ROOT_PASSWORD` | MariaDB root password |
`DB_DATABASE` and `DB_USERNAME` both default to `anagram`. Anything else you might want to
override is listed in [`.env.example`](.env.example).
Migrations run automatically on first boot.
## Development
```bash
git clone https://forge.lvl0.xyz/anagram-finder/web.git
cd web
nix-shell
```
The shell prints the available commands and offers to start the containers.
| Command | Description |
|---|---|
| `dev-up` | Start the development environment |
| `dev-down` | Stop it (`-v` also drops the database volume) |
| `dev-rebuild` | Rebuild images and restart |
| `dev-shell` | Enter the app container |
| `dev-artisan <cmd>` | Run an artisan command |
| `dev-composer <cmd>` | Run composer in the container |
| `dev-test` | Run the test suite |
| `dev-db` | MariaDB client on the dev database |
| `dev-logs` / `dev-logs-db` | Follow the app or database log |
| Service | URL |
|---|---|
| App | http://localhost:8001 |
| Vite | http://localhost:5174 |
| MariaDB | localhost:3308 |
## Related
The matching logic and the dictionary live in
[anagram-finder/core](https://forge.lvl0.xyz/anagram-finder/core), shared with
[anagram-finder/tui](https://forge.lvl0.xyz/anagram-finder/tui), a terminal client.
Styling comes from [lvl0/ui](https://forge.lvl0.xyz/lvl0/ui).
## Contributing
Issues and pull requests are welcome at
[Issues](https://forge.lvl0.xyz/anagram-finder/web/issues).
## License
Anagram Finder is free software, licensed under the [GNU AGPL-3.0](LICENSE).