{"id":20773028,"url":"https://github.com/tnar/algobreath-api","last_synced_at":"2026-05-05T01:32:10.900Z","repository":{"id":257677168,"uuid":"739991282","full_name":"tnar/algobreath-api","owner":"tnar","description":"Algobreath API is a RESTful API built with TypeScript and the Hono framework, utilizing Drizzle ORM for database interactions with SQLite. It manages notes and tags with a many-to-many relationship.","archived":false,"fork":false,"pushed_at":"2024-09-17T22:09:31.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T10:02:54.547Z","etag":null,"topics":["cloudflare-workers","d1","drizzle","hono","sqlite","typescript"],"latest_commit_sha":null,"homepage":"https://www.algobreath.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tnar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-07T07:06:45.000Z","updated_at":"2024-09-18T01:02:43.000Z","dependencies_parsed_at":"2024-09-18T03:38:24.189Z","dependency_job_id":"b5e65e34-762c-4750-ab9b-498a5e1fa5ef","html_url":"https://github.com/tnar/algobreath-api","commit_stats":null,"previous_names":["tnar/algobreath-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tnar/algobreath-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnar%2Falgobreath-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnar%2Falgobreath-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnar%2Falgobreath-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnar%2Falgobreath-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tnar","download_url":"https://codeload.github.com/tnar/algobreath-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnar%2Falgobreath-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32632154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare-workers","d1","drizzle","hono","sqlite","typescript"],"created_at":"2024-11-17T12:23:58.892Z","updated_at":"2026-05-05T01:32:10.873Z","avatar_url":"https://github.com/tnar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Algobreath API\n\nAlgobreath API is a RESTful API built with TypeScript and the Hono framework, utilizing Drizzle ORM for database interactions with SQLite. It manages notes and tags with a many-to-many relationship.\n\n## Features\n\n- **Notes Management**: Create, read, update, and delete notes.\n- **Tags Management**: Create, read, update, and delete tags.\n- **Relationship Handling**: Associate tags with notes.\n- **Authentication**: Secured with Bearer Token authentication.\n\n## Technologies\n\n- **Framework**: [Hono](https://hono.dev/)\n- **ORM**: [Drizzle ORM](https://drizzle.team/)\n- **Database**: SQLite via Cloudflare Workers D1\n- **Language**: TypeScript\n\n## Getting Started\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/) v16 or higher\n- [npm](https://www.npmjs.com/)\n- [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/) for deploying to Cloudflare Workers\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/yourusername/algobreath-api.git\n   cd algobreath-api\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   npm install\n   ```\n\n3. **Configure Environment Variables**\n\n   Create a `wrangler.toml` file with your Cloudflare Workers D1 database credentials.\n\n4. **Run Migrations**\n\n   Generate and apply database migrations:\n\n   ```bash\n   npm run migrations:gen\n   npm run migrations:apply\n   ```\n\n### Running the Development Server\n\nStart the development server with hot-reloading:\n\n```bash\nnpm run dev\n```\n\nThe API will be available at `http://localhost:8787`.\n\n### Deployment\n\nDeploy the API to Cloudflare Workers:\n\n```bash\nnpm run deploy\n```\n\n## API Endpoints\n\n### Authentication\n\nAll endpoints are secured with Bearer Token authentication. Include the token in the `Authorization` header:\n\n```\nAuthorization: Bearer YOUR_TOKEN_HERE\n```\n\n### Notes\n\n- **GET /notes**\n\n  Retrieve all notes.\n\n- **POST /notes**\n\n  Create a new note.\n\n  ```json\n  {\n    \"slug\": \"unique-slug\",\n    \"title\": \"Note Title\",\n    \"markdown\": \"Note content in markdown.\"\n  }\n  ```\n\n- **PUT /notes**\n\n  Update an existing note.\n\n  ```json\n  {\n    \"id\": 1,\n    \"slug\": \"updated-slug\",\n    \"title\": \"Updated Title\",\n    \"markdown\": \"Updated content.\"\n  }\n  ```\n\n- **GET /notes/latest**\n\n  Retrieve the latest updated note.\n\n- **GET /notes/:slug**\n\n  Retrieve a note by its slug.\n\n- **DELETE /notes/:id**\n\n  Delete a note by its ID.\n\n### Tags\n\n- **GET /tags**\n\n  Retrieve all tags.\n\n- **POST /tags**\n\n  Create a new tag.\n\n  ```json\n  {\n    \"slug\": \"unique-tag-slug\",\n    \"title\": \"Tag Title\"\n  }\n  ```\n\n- **PUT /tags**\n\n  Update an existing tag.\n\n  ```json\n  {\n    \"id\": 1,\n    \"slug\": \"updated-tag-slug\",\n    \"title\": \"Updated Tag Title\"\n  }\n  ```\n\n- **GET /tags/:slug**\n\n  Retrieve a tag by its slug.\n\n- **DELETE /tags/:id**\n\n  Delete a tag by its ID.\n\n### Notes to Tags\n\n- **POST /notesToTags**\n\n  Associate a tag with a note.\n\n  ```json\n  {\n    \"noteId\": 1,\n    \"tagId\": \"2\"\n  }\n  ```\n\n- **GET /notesToTags/notes/:noteId**\n\n  Retrieve all tag IDs associated with a note.\n\n- **GET /notesToTags/tags/:tagId**\n\n  Retrieve all notes associated with a tag.\n\n- **DELETE /notesToTags/:noteId/:tagId**\n\n  Remove the association between a note and a tag.\n\n## Database Schema\n\n### Tables\n\n- **notes**\n  - `id` (integer, primary key, auto-increment)\n  - `slug` (text, unique, not null)\n  - `title` (text, not null)\n  - `markdown` (text, not null)\n  - `createdAt` (integer, not null)\n  - `updatedAt` (integer, not null)\n\n- **tags**\n  - `id` (integer, primary key, auto-increment)\n  - `slug` (text, unique, not null)\n  - `title` (text, not null)\n\n- **notes_to_tags**\n  - `note_id` (integer, not null, foreign key to `notes.id`)\n  - `tag_id` (integer, not null, foreign key to `tags.id`)\n  - **Primary Key**: (`note_id`, `tag_id`)\n\n## Scripts\n\n- **Install Dependencies**\n\n  ```bash\n  npm install\n  ```\n\n- **Run Development Server**\n\n  ```bash\n  npm run dev\n  ```\n\n- **Deploy to Cloudflare Workers**\n\n  ```bash\n  npm run deploy\n  ```\n\n- **Generate Migrations**\n\n  ```bash\n  npm run migrations:gen\n  ```\n\n- **Apply Migrations Locally**\n\n  ```bash\n  npm run local:migrations:apply\n  ```\n\n- **Apply Migrations to Production**\n\n  ```bash\n  npm run migrations:apply\n  ```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnar%2Falgobreath-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftnar%2Falgobreath-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnar%2Falgobreath-api/lists"}