{"id":34968586,"url":"https://github.com/kristoferlund/ic-sqlite-react-demo","last_synced_at":"2025-12-26T23:28:39.379Z","repository":{"id":313236062,"uuid":"1047598283","full_name":"kristoferlund/ic-sqlite-react-demo","owner":"kristoferlund","description":"An example of a full-stack Internet Computer application with SQLite persistence. ","archived":false,"fork":false,"pushed_at":"2025-10-17T10:27:51.000Z","size":1351,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-18T11:44:08.955Z","etag":null,"topics":["internet-computer","rust","shadcn-ui","sqlite","tanstack-query","tanstack-router","vite"],"latest_commit_sha":null,"homepage":"https://ml463-eyaaa-aaaai-q33mq-cai.icp0.io/","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/kristoferlund.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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-08-30T19:22:24.000Z","updated_at":"2025-10-17T10:27:56.000Z","dependencies_parsed_at":"2025-09-04T19:26:12.810Z","dependency_job_id":"e32d7da6-b223-422a-8c2a-807fa708481e","html_url":"https://github.com/kristoferlund/ic-sqlite-react-demo","commit_stats":null,"previous_names":["kristoferlund/ic-sqlite-react-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kristoferlund/ic-sqlite-react-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fic-sqlite-react-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fic-sqlite-react-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fic-sqlite-react-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fic-sqlite-react-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristoferlund","download_url":"https://codeload.github.com/kristoferlund/ic-sqlite-react-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fic-sqlite-react-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28064601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["internet-computer","rust","shadcn-ui","sqlite","tanstack-query","tanstack-router","vite"],"created_at":"2025-12-26T23:28:38.921Z","updated_at":"2025-12-26T23:28:39.374Z","avatar_url":"https://github.com/kristoferlund.png","language":"TypeScript","readme":"# ICP + SQLite + React + TypeScript + Vite + Tailwind + Shadcn/UI + Tanstack Query/Router\n\nThis template provides a batteries-included, production-ready example of a full-stack Internet Computer application with SQLite persistence. It demonstrates proper architecture patterns for building CRUD applications on the ICP, including database migrations, three-layer validation, and clean separation of concerns.\n\n## What This Template Provides\n\n- **Complete CRUD Example**: A working person management system with Create, Read, Update, and Delete operations\n- **SQLite Integration**: Shows how to properly integrate SQLite into a Rust-based Internet Computer canister\n- **Best Practices**: Demonstrates manager/controller patterns, input validation at multiple layers, and type-safe development\n- **AI-Ready Development**: Includes an `agents.md` file to help LLMs understand and work with your project effectively\n\n\u003e [!TIP]\n\u003e **Getting Started with This Template**\n\u003e\n\u003e 1. Fork this repository as a starting point for your ICP + SQLite project\n\u003e 2. Review the `agents.md` file to understand the project structure\n\u003e 3. Share the `agents.md` file with your LLM for AI-assisted development\n\u003e 4. Replace the Person entity with your own data models\n\u003e\n\u003e Live demo: \u003chttps://ml463-eyaaa-aaaai-q33mq-cai.icp0.io\u003e\n\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]](LICENSE)\n\n![](./media/screenshot.png)\n\n## Features\n\n### Example Application: Person Management CRUD\n\nThis template includes a fully functional person management system that demonstrates:\n- **Create**: Add new persons with name and optional age\n- **Read**: List all persons with pagination support\n- **Update**: Modify existing person records\n- **Delete**: Remove persons from the database\n- **Count**: Get total number of records for pagination\n\n### Backend Architecture\n\nThe Rust-based backend showcases:\n- **SQLite Integration**: Persistent data storage within the canister using [`ic-rusqlite`](https://github.com/wasm-forge/ic-rusqlite)\n- **Database Migrations**: Automatic schema setup on canister initialization\n- **Manager Pattern**: Static methods for all database operations\n- **Controller Pattern**: Clean separation between IC endpoints and business logic\n- **Three-Layer Validation**:\n  1. SQL constraints at the database level\n  2. Rust new types for type-safe validation\n  3. Frontend form validation for immediate user feedback\n- **Automatic Candid Generation**: Interface definitions extracted from Rust code\n\n### Frontend Stack\n\nThe React/TypeScript frontend demonstrates:\n- **Tanstack Query**: Data fetching with caching and optimistic updates\n- **Tanstack Router**: Type-safe routing\n- **Form Handling**: Input validation and error display\n- **Responsive UI**: Built with Tailwind CSS 4 and shadcn/ui components\n\n### Key Technologies\n\n- [React 19](https://react.dev): The long awaited upgrade brings form actions, optimistic UI updates while mutating, etc etc.\n- [Vite 6](https://vite.dev/): The most significant major release since Vite 2, featuring a new Environment API for enhanced flexibility, extended framework support, and streamlined performance for modern web development.\n- [Tailwind 4](https://tailwindcss.com/docs/v4-beta): The new version of Tailwind CSS is a ground-up rewrite of the framework, providing faster builds, great new CSS classes and better performance.\n- [Tanstack Query 5](https://tanstack.com/query/latest): The template uses Tanstack Query for data fetching, caching and loading state management.\n- [Tanstack Router](https://tanstack.com/router/latest): Modern and scalable routing for React and Solid applications\n- [SWC](https://swc.rs/): The Rust based compiler and bundler that provides up to 70x faster build times than Babel.\n- [Eslint 9](https://eslint.org/): The latest release of Eslint introduces the flat configuration API along with new rules and bug fixes.\n- [shadcn/ui](https://ui.shadcn.com/): Yes, shadcn support for Tailwind 4 is finally here!\n\n## Why Use This Template?\n\nThis template is ideal if you want to:\n- Build a data-driven application on the Internet Computer\n- Learn how to properly integrate SQLite with IC canisters\n- Understand best practices for validation and error handling\n- See a real-world example of manager/controller patterns in Rust\n- Get started quickly with AI-assisted development using the included `agents.md` file\n\n## Setup \u0026 Development\n\nPre-requisites:\n\n- [Rust](https://rust-lang.org/tools/install), including the wasm32-wasip1 target\n- [Node.js](https://nodejs.org/en/download)\n- [pnpm](https://pnpm.io/installation)\n- [Internet Computer SDK](https://internetcomputer.org/docs/building-apps/getting-started/install)\n- [wasi2ic](https://github.com/wasm-forge/wasi2ic) \n\n## Running the project\n\n### 1. Start the Internet Computer\n\n```bash\ndfx start --background\n```\n\n### 2. Install dependencies\n\n```\npnpm install\n```\n\n### 3. Deploy the canisters\n\n```\ndfx deploy\n```\n\n## Develop\n\nDuring development, you can run the frontend with hot reloading using Vite.\n\n```bash\npnpm run dev\n```\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for more\ndetails.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request if you\nhave any suggestions or improvements.\n\n[forks-shield]: https://img.shields.io/github/forks/kristoferlund/ic-sqlite-react-demo.svg?style=for-the-badge\n[forks-url]: https://github.com/kristoferlund/ic-sqlite-react-demo/network/members\n[stars-shield]: https://img.shields.io/github/stars/kristoferlund/ic-sqlite-react-demo?style=for-the-badge\n[stars-url]: https://github.com/kristoferlund/ic-sqlite-react-demo/stargazers\n[issues-shield]: https://img.shields.io/github/issues/kristoferlund/ic-sqlite-react-demo.svg?style=for-the-badge\n[issues-url]: https://github.com/kristoferlund/ic-sqlite-react-demo/issues\n[license-shield]: https://img.shields.io/github/license/kristoferlund/ic-sqlite-react-demo.svg?style=for-the-badge\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristoferlund%2Fic-sqlite-react-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristoferlund%2Fic-sqlite-react-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristoferlund%2Fic-sqlite-react-demo/lists"}