Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ PUBLIC_GA_ID=
# Set to 1 to emit robots noindex on every page. Auto-set to 1 for non-main
# branch builds in CI; leave empty otherwise.
PUBLIC_NOINDEX=

# Production Google Analytics 4 ID, injected by the deploy env (e.g. Cloudflare
# build variable SITE_GA_ID). Consumed by astro.config.mjs on `main` builds.
# Leave unset to disable analytics. Local dev: set PUBLIC_GA_ID above instead.
SITE_GA_ID=
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Bug report
description: Something in a tool is broken or behaves unexpectedly
labels: ["bug"]
body:
- type: input
id: tool
attributes:
label: Which tool?
placeholder: e.g. Image Compressor, DB Diagram, PDF to Image
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: What did you do, what did you expect, what happened instead?
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
placeholder: |
1. Open the tool
2. Drop file X
3. Click Y
- type: input
id: env
attributes:
label: Browser / OS
placeholder: e.g. Chrome 130 on macOS 15
- type: textarea
id: console
attributes:
label: Console errors (if any)
description: Open DevTools → Console and paste any errors.
render: shell
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & ideas (Discussions)
url: https://github.com/slaveofcode/goodwebtools/discussions
about: Ask questions or discuss ideas before filing an issue.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Feature or tool request
description: Suggest a new tool or an improvement
labels: ["enhancement"]
body:
- type: textarea
id: idea
attributes:
label: What would you like?
description: Describe the tool or improvement and the problem it solves.
validations:
required: true
- type: checkboxes
id: constraints
attributes:
label: Fits the project?
options:
- label: This can work fully client-side (no server / no data leaving the browser)
required: true
- type: textarea
id: notes
attributes:
label: Anything else?
description: Prior art, links, or libraries that could help.
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## What does this PR do?

<!-- A short description. Link any related issue: Closes #123 -->

## Checklist

- [ ] `npm test -- --run` passes
- [ ] `npm run build` succeeds
- [ ] `npm run lint` is clean
- [ ] New tool? It's registered in `src/registry/tools.ts` with an island + tests
- [ ] No owner-specific deploy assets changed (wrangler bucket names, secrets, domain)
- [ ] Everything still runs fully client-side (no data leaves the browser)
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
pull_request:
push:
branches: [main, develop]

jobs:
verify:
name: Test · Build · Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Test
run: npm test -- --run
- name: Build
run: npm run build
- name: Lint
run: npm run lint
133 changes: 133 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement via GitHub's
private vulnerability reporting on this repository, or by opening a confidential
report to the maintainers.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
70 changes: 70 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Contributing to GoodWebTools

Thanks for wanting to help! GoodWebTools is a collection of privacy-first tools
that run entirely in the browser. Contributions — new tools, fixes, docs — are
welcome.

## Setup

```bash
git clone https://github.com/slaveofcode/goodwebtools
cd goodwebtools
npm install --legacy-peer-deps # a peer-dep conflict (tfjs/upscaler) needs this
npm run dev # http://localhost:4321
```

Some tools need ML model files staged locally: `npm run stage:models`.

## Checks (run before opening a PR)

```bash
npm test -- --run # unit tests (Vitest)
npm run build # production build
npm run lint # ESLint
```

CI runs all three on every PR.

## Branching

- Base your work on `develop` (not `main`). Open PRs against `develop`.
- Keep PRs focused; one tool or fix per PR.

## Adding a new tool

Tools are self-registering. To add one:

1. **Pure logic** → `src/tools/<category>/<name>.lib.ts` with Vitest tests
(`<name>.lib.test.ts`). Keep DOM/canvas out of the pure functions so they're
testable.
2. **UI island** → `src/islands/<category>/<Name>.tsx`, a default-exported React
component with **no required props**. Use the shared UI (`Dropzone`,
`ImageResult`/`ResultActions`, `usePasteImage`, etc.).
3. **Register it** in `src/registry/tools.ts` — append a `ToolDef`:
```ts
{
id: 'my-tool',
name: 'My Tool',
category: 'Image', // Dev | PDF | Image | Files | Draw | Media | Playground
route: '/tools/my-tool',
keywords: ['...'],
icon: SomeLucideIcon,
summary: 'One-line description',
load: () => import('@/islands/image/MyTool'),
status: 'stable',
}
```
The route and page are generated automatically from the registry.

That's it — no routing or page files to touch.

## Principles

- **Client-side only.** No servers, no uploads; user data never leaves the browser.
- **Follow existing patterns.** Match the surrounding code's style and structure.
- **Test the logic.** Pure `*.lib.ts` functions get unit tests.

## Reporting bugs / ideas

Use the issue templates, or start a [Discussion](https://github.com/slaveofcode/goodwebtools/discussions).
By contributing you agree to the [Code of Conduct](./CODE_OF_CONDUCT.md).
20 changes: 20 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,23 @@ npm run deploy # = npm run build && wrangler deploy
Cloudflare's free tier covers this comfortably: static assets have unlimited
bandwidth, and R2 has a generous free tier for storage + egress (models are
immutable and hard-cached, so they download once per visitor).

## Deploy your own instance

GoodWebTools is self-hostable on Cloudflare Workers. To run your own copy:

1. **Fork** this repo and clone it.
2. **Rename the deployment identifiers** in `wrangler.jsonc` (`name`,
`env.staging.name`) and the R2 bucket names to values you own.
3. **Create the R2 buckets:**
`npx wrangler r2 bucket create <your-bucket>` (and a `-staging` one).
4. **Point branding at your domain** in `src/config.ts` (`SITE_URL`, `REPO_URL`)
and `astro.config.mjs` (`site`); update `public/robots.txt`.
5. **(Optional) analytics:** set `SITE_GA_ID` as a production build variable
(Workers Builds → Settings → Build). Leave unset to disable.
6. **Stage & upload the ML models to R2:** `npm run stage:models` then
`npm run sync:r2` (see the section above).
7. **Connect Workers Builds** to your fork (production branch `main`, build
command `npm run build`) and push.

Nothing sends data anywhere except your own Cloudflare account.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 slaveofcode

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.
Loading
Loading