This 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.
- Complete CRUD Example: A working person management system with Create, Read, Update, and Delete operations
- SQLite Integration: Shows how to properly integrate SQLite into a Rust-based Internet Computer canister
- Best Practices: Demonstrates manager/controller patterns, input validation at multiple layers, and type-safe development
- AI-Ready Development: Includes an
agents.mdfile to help LLMs understand and work with your project effectively
Tip
Getting Started with This Template
- Fork this repository as a starting point for your ICP + SQLite project
- Review the
agents.mdfile to understand the project structure - Share the
agents.mdfile with your LLM for AI-assisted development - Replace the Person entity with your own data models
Live demo: https://ml463-eyaaa-aaaai-q33mq-cai.icp0.io
Forks Stargazers Issues MIT License
This template includes a fully functional person management system that demonstrates:
- Create: Add new persons with name and optional age
- Read: List all persons with pagination support
- Update: Modify existing person records
- Delete: Remove persons from the database
- Count: Get total number of records for pagination
The Rust-based backend showcases:
- SQLite Integration: Persistent data storage within the canister using
ic-rusqlite - Database Migrations: Automatic schema setup on canister initialization
- Manager Pattern: Static methods for all database operations
- Controller Pattern: Clean separation between IC endpoints and business logic
- Three-Layer Validation:
- SQL constraints at the database level
- Rust new types for type-safe validation
- Frontend form validation for immediate user feedback
- Automatic Candid Generation: Interface definitions extracted from Rust code
The React/TypeScript frontend demonstrates:
- Tanstack Query: Data fetching with caching and optimistic updates
- Tanstack Router: Type-safe routing
- Form Handling: Input validation and error display
- Responsive UI: Built with Tailwind CSS 4 and shadcn/ui components
- React 19: The long awaited upgrade brings form actions, optimistic UI updates while mutating, etc etc.
- Vite 6: 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.
- Tailwind 4: The new version of Tailwind CSS is a ground-up rewrite of the framework, providing faster builds, great new CSS classes and better performance.
- Tanstack Query 5: The template uses Tanstack Query for data fetching, caching and loading state management.
- Tanstack Router: Modern and scalable routing for React and Solid applications
- SWC: The Rust based compiler and bundler that provides up to 70x faster build times than Babel.
- Eslint 9: The latest release of Eslint introduces the flat configuration API along with new rules and bug fixes.
- shadcn/ui: Yes, shadcn support for Tailwind 4 is finally here!
This template is ideal if you want to:
- Build a data-driven application on the Internet Computer
- Learn how to properly integrate SQLite with IC canisters
- Understand best practices for validation and error handling
- See a real-world example of manager/controller patterns in Rust
- Get started quickly with AI-assisted development using the included
agents.mdfile
Pre-requisites:
- Rust, including the wasm32-wasip1 target
- Node.js
- pnpm
- Internet Computer SDK
- wasi2ic
dfx start --background
pnpm install
dfx deploy
During development, you can run the frontend with hot reloading using Vite.
pnpm run dev
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.