add initial crates and apps

This commit is contained in:
Evan Carroll 2026-01-12 15:34:40 -06:00
parent 5c87ba3519
commit 1ca300098f
113 changed files with 28169 additions and 0 deletions

View file

@ -0,0 +1,51 @@
#![recursion_limit = "256"]
//! Admin UI crate for Chattyness.
//!
//! This crate provides the Leptos-based admin interface that can be used by:
//! - The Owner App (:3001) with `chattyness_owner` DB role (no RLS)
//! - The Admin App (:3000/admin) with `chattyness_app` DB role (RLS enforced)
//!
//! The UI components are the same; only the database connection differs.
//!
//! ## Usage
//!
//! For standalone use (e.g., chattyness-owner):
//! ```ignore
//! use chattyness_admin_ui::AdminApp;
//! // AdminApp includes its own Router
//! ```
//!
//! For embedding in a combined app (e.g., chattyness-app):
//! ```ignore
//! use chattyness_admin_ui::AdminRoutes;
//! // AdminRoutes can be placed inside an existing Router
//! ```
pub mod api;
pub mod app;
pub mod auth;
pub mod components;
pub mod hooks;
pub mod models;
pub mod pages;
pub mod routes;
pub mod utils;
pub use app::{admin_shell, AdminApp};
pub use routes::AdminRoutes;
// Re-export commonly used items for convenience
pub use components::{
Alert, Card, DeleteConfirmation, DetailGrid, DetailItem, EmptyState, LoadingSpinner,
MessageAlert, MessageAlertRw, NsfwBadge, PageHeader, Pagination, PrivacyBadge, RoleBadge,
SearchForm, StatusBadge, SubmitButton, TempPasswordDisplay,
};
pub use hooks::{use_fetch, use_fetch_if, use_message, use_pagination, PaginationState};
pub use models::*;
pub use utils::{build_bounds_wkt, build_paginated_url, get_api_base, parse_bounds_wkt};
#[cfg(feature = "hydrate")]
pub use utils::{confirm, navigate_to, reload_page};
#[cfg(feature = "ssr")]
pub use app::AdminAppState;