This starter kit provides a streamlined setup for developing a Tauri App + Next.js applications with an integrated SurrealDB database. It bridges the frontend with the backend using an ICP command layer following the JSON-RPC 2.0 format.
-
Tauri Backend: Set up a backend using Tauri, a framework to build desktop applications with any frontend framework and a Rust core.
-
Next.js Frontend: Create dynamic and responsive user interfaces with Next.js, a popular React framework.
-
JSON-RPC 2.0 Communication: Seamless communication between frontend and backend using JSON-RPC 2.0 protocol.
-
SurrealDB Integration: Easily connect your backend with SurrealDB, a multi-model database that makes building and scaling realtime apps dramatically quicker and easier.
-
Be sure to have Rust and Cargo installed.
-
Please refer to the prerequisites for using Tauri.
-
To use the Tauri CLI from source (bleeding edge version) you need to install it via:
cargo install --git https://github.com/tauri-apps/tauri --branch 1.x tauri-cli
- Node.js > v18
- Clone the Repository:
git clone git@github.com:reymom/surrealdb-starter-taurikit.git
- Backend Setup
- Navigate to the backend directory
src-tauri
. - Follow the README to (1) build the rust application and (2) generate the frontend bindings.
- To an overview on where to create and customize your types and method implementations, refer to the backend README.
- Frontend Setup
- In the main directory, install the dependencies:
npm install
- Run the Tauri - Next.js development server:
cargo tauri dev
Note: SurrealDB is run as an in-memory database. To enable persitent storage, edit the
src-tauri/Cargo.toml
to enable allsurrealdb
features.
Refer to src-tauri/Readme.md for further information.
If you find any issues or have suggestions for improvements, please feel free to open an issue or create a pull request.
Happy coding!