| Crates.io | tinkr |
| lib.rs | tinkr |
| version | 0.0.43 |
| created_at | 2025-10-21 14:11:10.000638+00 |
| updated_at | 2025-11-17 11:20:39.919506+00 |
| description | Tinkr is a web framework for quickly building full-stack web applications with Leptos. |
| homepage | https://github.com/netrondev/tinkr |
| repository | https://github.com/netrondev/tinkr |
| max_upload_size | |
| id | 1893856 |
| size | 1,367,839 |
⚠️ EVERYTHING UNDER EXPERIMENTAL DEVELOPMENT ⚠️
A full-stack web framework for Rust that makes building modern web applications fast and enjoyable. Built on Leptos, Tinkr provides a comprehensive suite of UI components, authentication, database integration, and deployment tools to help you ship production-ready applications quickly.
cached crate for improved performanceAdd Tinkr to your Cargo.toml:
[dependencies]
tinkr = "0.0.32"
leptos = "0.8"
For SSR (Server-Side Rendering) support:
[dependencies]
tinkr = { version = "0.0.32", features = ["ssr"] }
For hydration (client-side):
[dependencies]
tinkr = { version = "0.0.32", features = ["hydrate"] }
use leptos::*;
use tinkr::components::*;
#[component]
pub fn App() -> impl IntoView {
view! {
<Page>
<Hero
title="Welcome to Tinkr"
subtitle="Build full-stack web apps with Rust"
>
<HeroButton href="/docs">"Get Started"</HeroButton>
</Hero>
<Section>
<FeatureGrid>
<FeatureCard
title="Fast"
description="Built with performance in mind"
/>
<FeatureCard
title="Type-Safe"
description="Catch errors at compile time"
/>
<FeatureCard
title="Full-Stack"
description="Frontend and backend in one language"
/>
</FeatureGrid>
</Section>
</Page>
}
}
use leptos::*;
use tinkr::components::*;
#[component]
pub fn LoginForm() -> impl IntoView {
let (email, set_email) = create_signal(String::new());
let (password, set_password) = create_signal(String::new());
view! {
<FormSection title="Sign In">
<FormGrid>
<Input
label="Email"
type_="email"
value=email
on_input=move |v| set_email(v)
/>
<Input
label="Password"
type_="password"
value=password
on_input=move |v| set_password(v)
/>
</FormGrid>
<FormActions>
<SubmitButton>"Sign In"</SubmitButton>
</FormActions>
</FormSection>
}
}
use leptos::*;
use tinkr::auth::*;
#[server]
async fn check_auth() -> Result<User, ServerFnError> {
let user = user()?; // Get current authenticated user
Ok(user)
}
#[component]
pub fn ProtectedPage() -> impl IntoView {
let user = create_resource(|| (), |_| check_auth());
view! {
<Suspense fallback=|| view! { <Loading /> }>
{move || user.get().map(|result| match result {
Ok(user) => view! {
<div>"Welcome, " {user.email}</div>
}.into_view(),
Err(_) => view! {
<div>"Please sign in"</div>
}.into_view(),
})}
</Suspense>
}
}
use tinkr::Datetime;
use tinkr::date_utils::FormatDatetime;
let created_at: Datetime;
created_at.format_custom("%a %d %b"); // Mon 01 Jan
created_at.ago(); // 9 days ago
#[cfg(feature = "ssr")]
use tinkr::db::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
struct Todo {
id: Option<RecordId>,
title: String,
completed: bool,
}
#[server]
async fn get_todos() -> Result<Vec<Todo>, ServerFnError> {
let db = db_init().await?;
let todos: Vec<Todo> = db.select("todos").await?;
Ok(todos)
}
#[server]
async fn create_todo(title: String) -> Result<Todo, ServerFnError> {
let db = db_init().await?;
let todo: Todo = db.create("todos")
.content(Todo {
id: None,
title,
completed: false,
})
.await?;
Ok(todo)
}
Tinkr uses environment variables for configuration. Create a .env file:
# Database
SURREALDB_HOST=ws://localhost:8000
SURREALDB_NS=your_namespace
SURREALDB_DB=your_database
SURREALDB_USER=root
SURREALDB_PASS=root
# Auth
JWT_SECRET=your-secret-key-here
# Email (optional)
RESEND_API_KEY=your-resend-api-key
# OAuth (optional)
OAUTH_CLIENT_ID=your-client-id
OAUTH_CLIENT_SECRET=your-client-secret
# Telemetry (optional)
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
Page - Main page wrapper with responsive layoutSection - Content section with optional headerHero - Hero section with title, subtitle, and CTA buttonsFooter - Application footerNavBar - Top navigation barSideBar - Collapsible sidebar navigationNavigationBackButton - Browser back buttonDropdown - Dropdown menu with trigger and itemsInput - Text input with label and validationCheckbox - Checkbox inputSelect - Select dropdownSubmitButton - Form submit button with loading stateFormSection - Form wrapper with titleFormGrid - Responsive form grid layoutButton - Customizable button componentModal - Modal dialog with backdropAlert - Alert messages with severity levelsTooltip - Hover tooltipLoading - Loading spinnerProgressBar - Progress indicatorTabs - Tab navigationImage - Optimized image componentUserAvatar - User avatar with fallbackLogo - Application logoTimer - Countdown/elapsed time displayTinkr supports the following feature flags:
default - Includes ssr featuressr - Server-side rendering with Axum, SurrealDB, and all backend featureshydrate - Client-side hydration supportTinkr follows a modular architecture:
tinkr/
├── auth/ # Authentication & authorization
├── components/ # UI component library
├── db/ # Database layer
├── email/ # Email integration
├── middleware/ # Server middleware
├── payments/ # Payment processing
├── telemetry/ # Observability
├── wallet/ # Web3 wallet integration
└── utils/ # Shared utilities
cargo test
# Development build
cargo build
# Production build
cargo build --release
The project includes a release script:
./release.sh
Contributions are welcome! Please feel free to submit issues and pull requests.
Licensed under either of:
at your option.
For questions and support, please open an issue on GitHub.