|
1 | 1 | # Disturb-AI Chrome Extension |
2 | 2 |
|
3 | | -Disturb-AI is a proposed browser extension that helps you stay mindful of distractions while working online. It prompts you to state your focus goal, detects distracting browsing behavior using the OpenAI API, and alerts you when your focus strays for too long. The extension is meant to be subtle and customizable, letting you set thresholds, alert style, and site whitelist. |
| 3 | +Disturb-AI helps you stay mindful of distractions while working online. It lets you set a focus goal, detects distracting browsing behavior and alerts you when your focus strays too long. |
4 | 4 |
|
5 | 5 | ## Development Setup |
6 | 6 |
|
7 | 7 | 1. Clone this repository. |
8 | | -2. Install dependencies and load the extension in Chrome's developer mode. |
9 | | -3. Provide your OpenAI API key in the settings page to enable distraction detection. |
| 8 | +2. Run `npm install` to install dependencies. |
| 9 | +3. During development, use `npm run dev` and load the `src` folder as an unpacked extension. |
| 10 | +4. For production, run `npm run build` to generate the extension in the `dist/` folder. |
| 11 | +5. Load the `dist` folder as an unpacked extension in Chrome. |
| 12 | +6. Provide your OpenAI API key on the settings page to enable distraction detection. |
| 13 | +7. Saved options and focus goals are automatically loaded the next time you open the popup or options page. |
| 14 | +8. Optionally add your own extension icons under `src/icons` and reference them in `manifest.json`. |
10 | 15 |
|
11 | | -For details on planned features, see the [idea document](prompts.md). |
| 16 | +The source under `src/` contains a minimal working skeleton. Edit the scripts to add advanced distraction detection logic. |
| 17 | + |
| 18 | +### Bootstrapping From Scratch |
| 19 | + |
| 20 | +If you'd like to recreate this extension completely from scratch, follow these basic steps. They mirror how this repository was initialized. |
| 21 | + |
| 22 | +1. Initialise a new Node project: |
| 23 | + ```sh |
| 24 | + npm init -y |
| 25 | + ``` |
| 26 | +2. Install React, Vite and the React plugin for Vite: |
| 27 | + ```sh |
| 28 | + npm install -D vite @vitejs/plugin-react react react-dom |
| 29 | + ``` |
| 30 | +3. Create a `src/` directory and within it add `popup.html` and `options.html`. |
| 31 | +4. Create React entry points (e.g. `popup-main.jsx` and `options-main.jsx`) that mount your React components. |
| 32 | +5. Write a minimal `manifest.json` referencing your HTML files and a background service worker script. |
| 33 | +6. Add a `vite.config.js` (see this repo for reference) so that `npm run dev` and `npm run build` work correctly. |
| 34 | +7. Update `package.json` scripts to include `dev`, `build` and optionally `test` commands. |
| 35 | + |
| 36 | +## CI |
| 37 | + |
| 38 | +A simple GitHub Actions workflow installs dependencies and runs `npm test` on pull requests. |
12 | 39 |
|
13 | 40 | ## License |
14 | 41 |
|
|
0 commit comments