chore: establish Arrmate project foundation

This commit is contained in:
Zebratic committed 2026-08-16 02:34:07 +00:00
commit 38ef1ada0b
8 files changed
+660

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
# Arrmate local development template. Copy to .env.local or .env.
# Never commit the copied file or place real secrets in source control.
NODE_ENV=development
NEXT_PUBLIC_APP_URL=http://localhost:3000
DATABASE_URL=postgresql://arrmate:arrmate_dev_password@localhost:5432/arrmate
AUTH_SECRET=replace-with-a-long-random-development-secret
# Server-side integration settings. None of these are NEXT_PUBLIC_* values.
JELLYFIN_URL=http://localhost:8096
JELLYFIN_API_KEY=replace-me
SONARR_URL=http://localhost:8989
SONARR_API_KEY=replace-me
RADARR_URL=http://localhost:7878
RADARR_API_KEY=replace-me
PROWLARR_URL=http://localhost:9696
PROWLARR_API_KEY=replace-me
BAZARR_URL=http://localhost:6767
BAZARR_API_KEY=replace-me
SEERR_URL=http://localhost:5055
SEERR_API_KEY=replace-me
QBITTORRENT_URL=http://localhost:8080
QBITTORRENT_USERNAME=replace-me
QBITTORRENT_PASSWORD=replace-me
# Optional integrations, not implemented in the first slice.
# HUNTARR_URL=http://localhost:9700
# HUNTARR_API_KEY=replace-me
# LIDARR_URL=http://localhost:8686
# LIDARR_API_KEY=replace-me
# REDIS_URL=redis://localhost:6379
# Keep false unless a future test explicitly opts into local fixtures.
ARRMATE_DEMO_MODE=false
INTEGRATION_REQUEST_TIMEOUT_MS=8000
INTEGRATION_POLL_INTERVAL_MS=15000
LOG_LEVEL=info
LOG_REDACT_SECRETS=true
# Production deployments must use a secret manager or deployment platform secrets.
# API keys and passwords belong in the Vault, never in Git.
ARRMATE_ENV_TEMPLATE=1
+192
View File
@@ -0,0 +1,192 @@
# Dependencies
node_modules/
.pnpm-store/
# Next.js / build output
.next/
out/
dist/
coverage/
# Local environment and secrets
.env
.env.*
!.env.example
# Runtime state and local databases
.data/
data/
*.db
*.db-shm
*.db-wal
# Logs and local tooling
*.log
npm-debug.log*
pnpm-debug.log*
.DS_Store
# IDE / OS
.vscode/
.idea/
*.swp
# Generated screenshots and test artifacts
playwright-report/
test-results/
# Temporary files
.tmp/
tmp/
.cache/
# Local deployment overrides
docker-compose.override.yml
# Keep the repository free of credentials
.credentials/
secrets/
# TypeScript build metadata
*.tsbuildinfo
next-env.d.ts
# Do not commit private prompt scratchpads
NEXT_PROMPT.local.md
automation/
# Environment-specific local configuration
config/local.*
config/*.local.*
# Generated public assets (source assets belong in public/assets)
public/generated/
# Editor backups
*~
*.bak
# Keep empty runtime directories out of Git
runtime/
# Local test media
fixtures/media/
# Python tooling if integration adapters use Python
__pycache__/
.pytest_cache/
.venv/
venv/
# macOS / Windows
Thumbs.db
.DS_Store
# Secret-bearing exports
*.secret.json
*.credentials.json
# Local AI/coding agent state
.claude/
.codex/
# Keep the root clean
*.local.md
# Allow the public template
!.env.example
# Do not ignore documentation
!docs/
!docs/**
!NEXT_PROMPT.md
!README.md
!LICENSE
!CONTRIBUTING.md
!SECURITY.md
!CODE_OF_CONDUCT.md
!CHANGELOG.md
!package.json
!pnpm-lock.yaml
!tsconfig.json
!next.config.*
!src/
!src/**
!public/
!public/**
!tests/
!tests/**
!docker/
!docker/**
!prisma/
!prisma/**
!migrations/
!migrations/**
!scripts/
!scripts/**
# Explicitly prevent common accidental secret files
**/.env
**/.env.*
!**/.env.example
**/*token*
**/*password*
**/*apikey*
**/*api-key*
**/*secret*
**/*credential*
!docs/**
!**/*.example
!**/*.template
!**/*-example.*
!**/*-template.*
# Do not commit service exports or media metadata snapshots
exports/
backups/
*.torrent
*.nzb
# Local generated images/videos
*.mp4
*.mov
*.mkv
*.webm
*.png
*.jpg
*.jpeg
*.gif
!public/assets/**/*.png
!public/assets/**/*.jpg
!public/assets/**/*.jpeg
!public/assets/**/*.gif
!docs/**/*.png
!docs/**/*.jpg
!docs/**/*.jpeg
!docs/**/*.gif
# Keep sample fixtures explicitly opt-in
!fixtures/**/*.json
!fixtures/**/*.yaml
!fixtures/**/*.yml
# Local package manager files
.yarn/
.pnp.*
# Deployment secrets and state
.coolify/
.dokploy/
.terraform/
*.tfstate*
# OS mount / editor state
.nfs*
.directory
# Scratch planning files
PLAN.local.md
DESIGN.local.md
# End of intentionally boring, security-first ignore rules
+40
View File
@@ -0,0 +1,40 @@
# Code of Conduct
Arrmate is a community project for people building and maintaining self-hosted media systems. Participation should be practical, welcoming, and respectful.
## Expected behavior
- Be respectful and assume good faith.
- Give useful, specific feedback about code, UX, documentation, and security.
- Welcome newcomers and explain homelab-specific assumptions.
- Keep disagreements focused on the work, not the person.
- Respect privacy. Do not share credentials, private media metadata, private hostnames, or screenshots without permission.
- Follow the licenses and terms of the services Arrmate integrates with.
## Unacceptable behavior
- Harassment, threats, discrimination, or targeted insults.
- Publishing private information without consent.
- Credential theft, malicious code, destructive testing against systems you do not own, or instructions intended to bypass authorization.
- Deliberately filing deceptive reports or submitting code that hides dangerous side effects.
- Sexualized or otherwise inappropriate behavior in project spaces.
## Enforcement
Project maintainers may remove content, close discussions, or restrict participation when these standards are violated. Security issues should be reported privately according to `SECURITY.md`, not posted with working exploit details or secrets.
If enforcement is needed, provide maintainers with links, dates, and a concise description. Do not include private credentials or personal data.
This code of conduct is intentionally short. The standard is simple: build useful things, protect people and their data, and do not make the homelab community worse.
## Scope
This applies to repository issues, pull requests, discussions, documentation, project chat, and other spaces used for Arrmate collaboration.
## Attribution
Adapted from the Contributor Covenant principles and kept concise for this early-stage project.
## End
Thank you for helping make Arrmate a project people can trust.
+82
View File
@@ -0,0 +1,82 @@
# Contributing to Arrmate
Thanks for helping build a calmer, safer control plane for self-hosted media stacks.
## Before opening a change
- Read `README.md`, `SECURITY.md`, and `NEXT_PROMPT.md`.
- Keep the change focused and explain the user-facing behavior.
- Never include service credentials, personal media metadata, private URLs, screenshots, logs, or database exports.
- If the change touches an integration, document the upstream API behavior and the disconnected/error state.
- If the change touches authorization or destructive actions, include tests for both allowed and denied roles.
## Development expectations
- Use the repository's committed package manager and scripts once the application foundation is present.
- Run formatting, lint, typecheck, unit tests, and relevant browser tests before submitting.
- Prefer small commits with descriptive messages.
- Avoid adding a dependency when a small typed utility is clearer and safer.
- Keep mobile behavior intentional at a 360px viewport and check keyboard/focus behavior.
- Support reduced motion and accessible labels for interactive controls.
## Pull requests
Describe:
1. What changed and why.
2. Which roles and screens are affected.
3. How external service failure is represented.
4. Which commands were run and their real results.
5. Any migration, deployment, backup, or security implications.
Do not claim a live integration was tested unless it was tested against a real authorized local service. Fixtures and mocks must be labeled as such.
## Scope
Arrmate is independent software and is not affiliated with the services it integrates. Contributions must respect the licenses and terms of those services and the laws applicable to the operator.
## Code of conduct
By participating, you agree to follow `CODE_OF_CONDUCT.md`.
## License
Contributions are made under the MIT License in `LICENSE` unless a contribution states otherwise and the maintainers accept it.
## Maintainer note
The project is at foundation stage. Product boundaries and adapter contracts are intentionally more important than adding a long list of integrations quickly.
Keep the first releases trustworthy. A boring honest error state beats a flashy fake success state.
## End
Questions that materially change the product boundary should be raised before implementation rather than hidden in a large pull request.
Thank you for contributing to Arrmate.
## Final checklist
- [ ] No secrets or private data are present.
- [ ] Authorization is enforced server-side.
- [ ] Destructive actions are explicit and audited.
- [ ] External failures have honest UI states.
- [ ] Tests cover the changed behavior.
- [ ] Documentation is updated.
- [ ] Git diff is focused.
## Repository hygiene
Do not commit `.env`, generated media, downloaded torrents, database dumps, screenshots containing private data, or local agent state. The repository ignore file is intentionally strict; do not weaken it to make a local build convenient.
## Reporting bugs
Use a private report for security issues. See `SECURITY.md` rather than opening a public issue with credentials or exploit details.
## Versioning
There is no release contract yet. Avoid creating public compatibility promises until the first working vertical slice and deployment documentation exist.
## Thank you
Build it with sweat, care, and a little less dashboard chaos.
+31
View File
@@ -0,0 +1,31 @@
MIT License
Copyright (c) 2026 Arrmate contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Arrmate note
This license applies to the Arrmate project source unless a file states otherwise.
Arrmate is independent software and is not affiliated with, sponsored by, or endorsed by Jellyfin, Sonarr, Radarr, Prowlarr, Bazarr, Seerr, Jellyseerr, qBittorrent, Huntarr, nzb360, or their respective contributors.
Any third-party logos, names, trademarks, and service documentation remain the property of their respective owners.
Do not use Arrmate to violate copyright, licensing terms, or the laws applicable to your location.
+116
View File
@@ -0,0 +1,116 @@
# Next coding-AI prompt: Arrmate foundation and first vertical slice
You are the implementation agent for **Arrmate**, an open-source, self-hosted, mobile-first media management control plane inspired by the unified feel of nzb360.
## Mission
Turn this repository foundation into a small, real, tested vertical slice for managing a Jellyfin-oriented *arr stack. Do not build a fake dashboard, do not invent successful API responses, and do not create a huge speculative scaffold. Work in small milestones and leave the repository in a runnable state after each milestone.
The product vision is documented in `README.md`. Preserve it, but verify assumptions against current project files and upstream API documentation before coding. The first release direction includes:
- Jellyfin, Sonarr, Radarr, Prowlarr, Bazarr, Seerr/Jellyseerr, qBittorrent, and optional Huntarr-style integrations;
- live download and service health stats;
- media discovery and requests;
- admin-only operational actions such as manual torrent selection, queue controls, deleting/replacing media, and subtitle searches;
- a public/friend-facing request experience with reduced permissions and configurable movie/series limits;
- user-level permissions, quotas, auditability, and a smartphone-first responsive UI.
## Non-negotiable constraints
1. **Inspect first.** Read `README.md`, `.gitignore`, and the complete repository state before making architectural decisions.
2. **Use the project root.** Work only in the verified Arrmate checkout. Do not write into the Hermes workspace or another project.
3. **No secrets in Git.** Check the vault before using any existing credential. Never place upstream API keys, passwords, tokens, personal data, or real service URLs in source, tests, fixtures, logs, screenshots, or commits. Use `.env.example` with obvious placeholders and keep `.env` ignored.
4. **No fake integration claims.** If a service is not configured, show a disconnected/unknown state. Tests may use explicit local fixtures or mocked adapter responses, but the UI must not imply that mocked data is live.
5. **Server-side authorization is mandatory.** Requester/guest UI restrictions are not sufficient. Every mutation must pass a server-side permission check, including destructive media and torrent operations.
6. **Keep external actions reversible and explicit.** Destructive actions need typed confirmation, clear scope, and audit events. Do not auto-delete, auto-replace, or auto-start downloads as a shortcut.
7. **Mobile first, not mobile only.** Design for a 360px-wide viewport first, then make tablet and desktop layouts feel intentional. Use accessible touch targets, keyboard support, reduced-motion behavior, and visible loading/error/empty states.
8. **Do not overbuild.** Start with a thin vertical slice, not all integrations and all screens at once.
9. **Test continuously.** Run formatting, lint, typecheck, unit tests, and browser tests where applicable. Fix failures before moving on.
10. **Document non-obvious discoveries.** If an upstream API quirk or deployment issue appears, add a concise guide under `docs/`.
## First milestone: verified local vertical slice
Implement the smallest coherent feature set:
### A. Project and runtime foundation
- Choose and document the package manager and supported Node.js version.
- Create a clean Next.js + TypeScript application foundation only if the repository is empty.
- Add Tailwind and shadcn/ui primitives only as needed. Create Arrmate-specific design tokens rather than copying a generic starter aesthetic.
- Add `.env.example` containing placeholders for database URL, session/auth secret, public app URL, and integration base URLs/API keys. Do not put actual values in it.
- Add a local Docker Compose setup for the Arrmate-owned database if needed. Keep it isolated from any homelab production database.
- Add scripts for dev, build, lint, typecheck, unit tests, and browser tests.
### B. Domain and authorization core
Create typed domain boundaries for:
- users and roles;
- per-user movie and series request limits;
- request records and lifecycle states;
- integration records and connection health;
- audit events.
Implement server-side authorization helpers with tests covering at least:
- admin can manage integrations, users, quotas, and destructive operations;
- maintainer can operate permitted media workflows but cannot change owner/security settings;
- requester can search and submit requests within quota;
- guest cannot access admin routes or mutate integrations;
- quota checks are enforced atomically enough to prevent simple double-submit races.
Use a real persistence layer for Arrmate-owned state or clearly isolate a temporary development repository behind interfaces with an explicit follow-up issue. Do not bury authorization in React components.
### C. Adapter contracts and one real integration path
Define typed adapter interfaces for media servers, media managers, indexers, subtitle providers, and download clients. Include capability/error types so an unavailable endpoint is distinguishable from an empty result.
Implement one real, server-side adapter end to end first, preferably qBittorrent or Jellyfin, after checking its current official API documentation. The adapter must:
- read credentials only on the server;
- validate responses;
- set request timeouts;
- return normalized domain data;
- expose health/error information;
- have unit tests for success, authentication failure, timeout, malformed response, and empty result;
- never log credentials or full authorization headers.
Stub other adapters only behind the same interfaces, with an honest “not configured” state.
### D. Mobile-first screens
Create a polished but restrained UI with these flows:
1. Sign-in or local development sign-in boundary.
2. Dashboard showing service health, request activity, and live download status from the adapter boundary.
3. Search/discover screen with an explicit “not connected” or fixture state when no media provider is configured.
4. Request detail/action flow with quota feedback.
5. Admin integration health screen and a safe settings/users view.
6. A requester/guest view that does not render or call admin mutations.
Use a small number of real components. Prefer skeletons, optimistic states only where rollback is real, and clear retry actions. Add accessibility labels and reduced-motion handling.
### E. Verification and documentation
- Add a concise architecture document under `docs/architecture/` explaining the adapter boundary, data ownership, auth boundary, and first integration.
- Add a product/UX note under `docs/product/` describing the mobile navigation, admin vs requester surfaces, and quota behavior.
- Add a threat-model note covering API-key handling, public request access, SSRF risks from user-supplied integration URLs, destructive actions, and audit logs.
- Add automated tests and run them for real.
- Run a production build. If browser tests require a server, start it with a bounded process and verify the actual HTTP response.
- Finish with an exact report containing changed files, commands run, real test/build output, remaining limitations, and the next smallest milestone.
## Quality bar
The result should feel like the beginning of a product, not a template demo. Avoid neon dashboard clutter, giant unbounded tables, fake charts, and placeholder buttons that do nothing. Use calm hierarchy, fast perceived response, strong empty/error states, and a visual language that can scale to a future native wrapper.
When uncertain, make the smallest reversible choice, document it, and continue. Ask the human only when the decision changes the product boundary or would require an external side effect.
## Handoff discipline
- Keep commits small and descriptive.
- Do not publish a public repository or deploy externally without explicit approval.
- Do not initiate another coding agent from this prompt.
- Before claiming completion, verify the final files from disk and the Git status.
- If the implementation is blocked, report the exact blocker rather than fabricating success.
Begin by inspecting the repository and then produce a short implementation plan in `docs/plans/` before writing application code.
+124
View File
@@ -0,0 +1,124 @@
# Arrmate
**The friendly control plane for your self-hosted media stack.**
Arrmate is a planned open-source, mobile-first management experience for Jellyfin ecosystems. It brings discovery, requests, downloads, library health, subtitle workflows, and service operations into one fast interface instead of making people jump between a pile of separate dashboards.
> **Status:** early project foundation. This repository currently contains product direction and the implementation handoff prompt. It is not yet connected to a live media stack and does not pretend otherwise.
## The idea
The name comes from the *arr* family of services and a friendly companion that helps keep a homelab media setup moving. The product should feel like a polished native app on a phone, while remaining useful on tablets, desktop browsers, and eventually any device with a modern web browser.
Arrmate is inspired by the unified feel of nzb360, but the goal is a self-hosted, open-source product with a first-class request experience rather than a basic launcher for separate services.
## Product goals
- One responsive, smartphone-first interface for a Jellyfin media server and its supporting services.
- Live operational visibility: download queues, speeds, health, storage, jobs, and recent activity.
- Fast discovery and requests for movies and series.
- Admin workflows for manual torrent selection, queue actions, media deletion, replacement, searches, and subtitle management.
- A safe public/friend-facing experience with reduced permissions and configurable movie/series rate limits.
- Per-user permissions, quotas, audit history, and easy limit changes from a phone.
- A visual system that feels calm, quick, modern, and proud to be open source.
- No fake success states: when a service is disconnected or an action is unavailable, the UI should say so clearly.
## Initial integration targets
The first adapter boundary should be designed around these services, without making the core domain model depend on one vendor:
- Jellyfin
- Sonarr
- Radarr
- Prowlarr
- Bazarr
- Seerr or Jellyseerr compatibility where useful
- qBittorrent
- Huntarr and other optional *arr ecosystem tools
Future adapters may include download clients, indexers, media servers, notification providers, transcoding/health tools, and alternative implementations of the same capability.
## Permission model direction
Arrmate should support at least these conceptual roles:
- **Owner/admin:** service configuration, integrations, users, quotas, manual torrent controls, destructive media actions, audit logs, and system settings.
- **Maintainer:** operational controls and library workflows, but no ownership/security changes unless explicitly granted.
- **Requester:** discovery, requests, request status, and permitted subtitle or notification preferences.
- **Guest:** narrowly scoped public discovery/request experience governed by configured limits.
Every mutation should be authorized server-side. Hiding a button is not authorization.
## Suggested technical direction
The implementation handoff should validate the details, but the working direction is:
- Next.js with TypeScript for the web application and API boundary.
- Tailwind CSS plus shadcn/ui primitives, with a custom Arrmate visual system rather than an untouched component template.
- PostgreSQL for Arrmate-owned users, sessions, permissions, quotas, integrations, request records, audit events, and cached normalized state.
- A background job/refresh layer for polling and reconciling external services without blocking the UI.
- Typed adapter interfaces and capability checks so unsupported service features degrade gracefully.
- Docker-first local development with an explicit `.env.example` and no credentials in Git.
- Tests at the domain, adapter, authorization, and browser workflow boundaries.
## Repository layout target
```text
src/
app/ # routes and screens
components/ # reusable UI
features/ # vertical product slices
server/ # application services and adapter orchestration
adapters/ # external service integrations
db/ # schema, migrations, repositories
lib/ # shared utilities and typed contracts
styles/ # design tokens and global styles
docs/
product/ # product and UX decisions
architecture/ # system and adapter decisions
plans/ # implementation plans
public/
tests/
NEXT_PROMPT.md
```
This is a direction, not permission to build every future feature in the first milestone. The first implementation should establish a trustworthy vertical slice: authentication/roles, service connection health, a mobile dashboard, media search, a request, and a visible live download status.
## Safety and privacy
Arrmate is intended for self-hosted deployments. Integrations will handle powerful APIs and potentially destructive actions. The project must therefore:
- keep credentials server-side and encrypted at rest where practical;
- never expose upstream API keys to browsers or requesters;
- require explicit confirmation for destructive operations;
- log who performed destructive and administrative actions;
- make rate limits and public access boundaries explicit;
- avoid assuming that an internet-facing deployment is safe merely because the UI has a login page;
- provide a threat model and deployment security documentation before calling a release production-ready.
## Development
The implementation has not started yet. Read [`NEXT_PROMPT.md`](./NEXT_PROMPT.md) for the next coding-AI handoff. The handoff is deliberately designed to begin with repository inspection, product decisions, and a small verified vertical slice rather than generating a large untested scaffold.
When development begins, the expected local flow will be documented here and should include:
```bash
cp .env.example .env
# install dependencies using the committed package manager
# start the local database and app
# run lint, typecheck, unit tests, and browser tests
```
## Contributing
Arrmate should be welcoming to homelab users who are not enterprise developers. Contributions need clear setup instructions, reproducible tests, security-minded review, and an explanation of how a change behaves when an external service is unavailable.
See [`CONTRIBUTING.md`](./CONTRIBUTING.md), [`SECURITY.md`](./SECURITY.md), and [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md).
## License
MIT. See [`LICENSE`](./LICENSE).
## Name note
The working project name is **Arrmate**, selected by Zeb on 2026-08-16. It can still evolve before the first public release, but the local project and repository foundation use this name consistently.
+33
View File
@@ -0,0 +1,33 @@
# Security policy
Arrmate is designed to connect to powerful self-hosted services. Treat any deployment as security-sensitive.
## Reporting a vulnerability
Please do not open a public issue for a credential leak, authentication bypass, SSRF, authorization bypass, or destructive-action flaw. Until a project security contact is published, report privately to the project maintainer through the repository's private contact mechanism and include:
- affected version/commit;
- deployment context;
- reproducible steps;
- impact and suggested mitigation;
- whether any real credentials or personal data may have been exposed.
Do not include active API keys, passwords, private URLs, media libraries, or user data in the report.
## Security expectations
- Keep upstream service credentials server-side and out of browser bundles.
- Store secrets in a deployment secret manager or Vaultwarden, not `.env` files committed to Git.
- Validate and allow-list integration URLs to reduce SSRF risk.
- Enforce authorization on the server for every mutation.
- Require confirmation and audit destructive actions.
- Rate-limit public requests and authentication attempts.
- Do not expose admin controls through client-side-only route hiding.
- Redact authorization headers, cookies, passwords, and API keys from logs.
- Keep dependencies patched and review adapter changes carefully.
## Scope
The project is early. The absence of a published release does not mean a deployment is safe by default. Operators are responsible for network exposure, TLS, identity provider configuration, backups, and upstream service permissions.
Arrmate is independent software and does not grant permission to access media or services that the operator is not authorized to use.