{"id":25020712,"url":"https://github.com/shadmeoli/localedge","last_synced_at":"2026-04-29T17:39:17.193Z","repository":{"id":275355351,"uuid":"925841550","full_name":"shadmeoli/localEdge","owner":"shadmeoli","description":"A custom local-first data service built with typescript, utilizing Zustand for state management and SQL.js for complex data storage. This project ensures offline-first capabilities with seamless data persistence in the browser.","archived":false,"fork":false,"pushed_at":"2025-11-10T10:14:53.000Z","size":177,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-10T12:06:24.730Z","etag":null,"topics":["bun","sqljs","typescript","zusta"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shadmeoli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-01T21:48:37.000Z","updated_at":"2025-11-10T10:02:32.000Z","dependencies_parsed_at":"2025-03-30T10:36:24.353Z","dependency_job_id":null,"html_url":"https://github.com/shadmeoli/localEdge","commit_stats":null,"previous_names":["shadmeoli/localedge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shadmeoli/localEdge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadmeoli%2FlocalEdge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadmeoli%2FlocalEdge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadmeoli%2FlocalEdge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadmeoli%2FlocalEdge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shadmeoli","download_url":"https://codeload.github.com/shadmeoli/localEdge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadmeoli%2FlocalEdge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32437109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T17:34:55.123Z","status":"ssl_error","status_checked_at":"2026-04-29T17:34:45.749Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["bun","sqljs","typescript","zusta"],"created_at":"2025-02-05T12:17:12.296Z","updated_at":"2026-04-29T17:39:17.178Z","avatar_url":"https://github.com/shadmeoli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LocalEdge\n\nA custom local-first data service built with **JavaScript**, utilizing **Zustand** for state management and **SQL.js** for complex data storage. This project ensures offline-first capabilities with seamless data persistence in the browser.\n\n## 🚀 Features\n\n- **Local-First Architecture:** Operates entirely in the browser with offline support.\n- **State Management:** Powered by Zustand for efficient store management.\n- **SQL-Based Storage:** Uses SQL.js for managing complex relational data.\n- **Lightweight \u0026 Fast:** Optimized for performance with WebAssembly.\n\n## 📦 Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/your-username/localedge.git\ncd localedge\n\n# Install dependencies\nnpm install\n```\n\n## ⚡ Getting Started\n\n### Installation\n\n```bash\nnpm install localedge\n```\n\n```javascript\nimport initSqlJs from \"sql.js\";\nimport create from \"zustand\";\n\n// Initialize Zustand store\nconst useStore = create((set) =\u003e ({\n  tasks: [],\n  addTask: (task) =\u003e set((state) =\u003e ({ tasks: [...state.tasks, task] })),\n}));\n\n// Initialize SQL.js\ndocument.addEventListener(\"DOMContentLoaded\", async () =\u003e {\n  const SQL = await initSqlJs();\n  const db = new SQL.Database();\n\n  // Create a table\n  db.run(\n    \"CREATE TABLE IF NOT EXISTS tasks (id INTEGER PRIMARY KEY, title TEXT, done BOOLEAN)\"\n  );\n\n  // Insert a task\n  db.run(\"INSERT INTO tasks (title, done) VALUES ('Learn Zustand', 0)\");\n\n  // Fetch tasks\n  const result = db.exec(\"SELECT * FROM tasks\");\n  useStore.getState().addTask(result[0].values);\n\n  console.log(useStore.getState().tasks);\n});\n```\n\n## 📊 Project Structure\n\n```\nlocaledge/\n├── src/\n│   ├── store.js        # Zustand store setup\n│   └── db.js           # SQL.js database logic\n├── index.js            # Main entry point\n├── public/             # Static assets\n├── package.json        # Project metadata\n└── README.md           # Project documentation\n```\n\n## 🔧 Available Scripts\n\n```bash\n# Start the development server\nnpm run dev\n\n# Build for production\nnpm run build\n\n# Run tests\nnpm run test\n```\n\n## 🗂️ Data Persistence\n\nTo export and save the database:\n\n```javascript\nconst data = db.export();\nconst blob = new Blob([data], { type: \"application/octet-stream\" });\nconst a = document.createElement(\"a\");\na.href = URL.createObjectURL(blob);\na.download = \"local.db\";\na.click();\n```\n\n## 🤝 Contributing\n\n1. Fork the project\n2. Create your feature branch (`git checkout -b feature/your-feature`)\n3. Commit your changes (`git commit -m 'Add new feature'`)\n4. Push to the branch (`git push origin feature/your-feature`)\n5. Open a pull request\n\n## Issues and bug fixes\n\n### 🐛 Reporting Issues\n\n1. Check existing issues to avoid duplicates\n2. Use the issue template when creating a new issue\n3. Include the following information:\n   - Clear description of the issue\n   - Steps to reproduce\n   - Expected behavior\n   - Actual behavior\n   - Environment details (browser, OS, versions)\n   - Screenshots or code snippets (if applicable)\n\n### 🔧 Submitting Bug Fixes\n\n1. Issues should be properly labeled with `bug` tag\n2. Branch naming convention:\n   - Format: `fix/brand-name/issue-description`\n   - Example: `fix/localedge/database-sync-error`\n3. Commit message format:\n   - Start with `fix:` followed by the issue description\n   - Example: `fix: resolve database synchronization error (#123)`\n4. Pull Request requirements:\n   - Reference the issue number in PR description\n   - Include before/after test results\n   - Update documentation if necessary\n   - Add tests for the bug fix when applicable\n\n\n\n## Test Suite\n\n### 🧪 Overview\nThe test suite uses Vitest with JSDOM environment for testing browser-like functionality.\n\n### 🛠️ Setup\n\nThe test environment is configured with mocks for browser APIs:\n```typescript\n// Mock setup for browser APIs\nimport { vi } from \"vitest\";\n\nglobal.navigator = {\n  onLine: true,\n  userAgent: \"node\",\n  language: \"en-US\"\n};\n\nglobal.window = {\n  addEventListener: vi.fn(),\n  removeEventListener: vi.fn()\n  // ... other window properties\n};\n```\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadmeoli%2Flocaledge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadmeoli%2Flocaledge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadmeoli%2Flocaledge/lists"}