first chrome implementation

This commit is contained in:
DEV Sam Hayes
2025-01-10 19:37:10 +01:00
parent dc7a980dc5
commit a652718bc7
175 changed files with 18526 additions and 610 deletions

View File

@@ -1,59 +1,48 @@
# GootiExtension
# Gooti
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.7.
## Nostr Identity Manager & Signer
## Development server
Gooti is a browser extension for managing multiple [Nostr](https://github.com/nostr-protocol/nostr) identities and for signing events on web apps without having to give them your keys.
To start a local development server, run:
It implements these mandatory [NIP-07](https://github.com/nostr-protocol/nips/blob/master/07.md) methods:
```bash
ng serve
```typescript
async window.nostr.getPublicKey(): string
async window.nostr.signEvent(event: { created_at: number, kind: number, tags: string[][], content: string }): Event
```
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
It also implements these optional methods:
## Code scaffolding
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
```bash
ng generate component component-name
```typescript
async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} }
async window.nostr.nip04.encrypt(pubkey, plaintext): string
async window.nostr.nip04.decrypt(pubkey, ciphertext): string
```
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
The repository is configured to hold the extensions for Chrome and Firefox. While the Chrome extension is yet already available, the Firefox extension will follow later.
```bash
ng generate --help
[Chrome Extension](https://chromewebstore.google.com/detail/cgikhnoggbhdblnckhcahgkipmiiohbk)
Firefox Extension (yet to come)
## Develop Chrome Extension
To run the Chrome extension from this code:
```
git clone https://github.com/sam-hayes-org/gooti-extension
cd gooti-extension
npm i
npm run watch:chrome
```
## Building
then
To build the project run:
1. within Chrome go to `chrome://extensions`
2. ensure "developer mode" is enabled on the top right
3. click on "Load unpackaged"
4. select the `dist/chrome` folder of this repository
```bash
ng build
```
---
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
## Running unit tests
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
```bash
ng test
```
## Running end-to-end tests
For end-to-end (e2e) testing, run:
```bash
ng e2e
```
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
## Additional Resources
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
LICENSE: Public Domain