⬆️ Update for latest SeaORM compatibility

This commit is contained in:
Manuel Cillero 2024-11-25 15:11:04 +01:00
parent 3160a9e8dc
commit 567d0748c7
4 changed files with 41 additions and 186 deletions

View file

@ -1,102 +1,26 @@
<div align="center">
<img src="https://raw.githubusercontent.com/manuelcillero/pagetop/main/static/banner.png" />
<h1>PageTop SeaORM</h1>
<h1>PageTop</h1>
<p>An opinionated web framework to build modular <em>Server-Side Rendering</em> web solutions.</p>
<p>Integrate SeaORM as the database framework for PageTop applications.</p>
[![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg?style=for-the-badge)](#-license)
[![API Docs](https://img.shields.io/docsrs/pagetop?label=API%20Docs&style=for-the-badge&logo=Docs.rs)](https://docs.rs/pagetop)
[![Crates.io](https://img.shields.io/crates/v/pagetop.svg?style=for-the-badge&logo=ipfs)](https://crates.io/crates/pagetop)
[![Downloads](https://img.shields.io/crates/d/pagetop.svg?style=for-the-badge&logo=transmission)](https://crates.io/crates/pagetop)
[![API Docs](https://img.shields.io/docsrs/pagetop-seaorm?label=API%20Docs&style=for-the-badge&logo=Docs.rs)](https://docs.rs/pagetop-seaorm)
[![Crates.io](https://img.shields.io/crates/v/pagetop-seaorm.svg?style=for-the-badge&logo=ipfs)](https://crates.io/crates/pagetop-seaorm)
[![Downloads](https://img.shields.io/crates/d/pagetop-seaorm.svg?style=for-the-badge&logo=transmission)](https://crates.io/crates/pagetop-seaorm)
</div>
## Overview
PageTop SeaORM employs [SQLx](https://crates.io/crates/sqlx) and
[SeaQuery](https://crates.io/crates/sea-query), complemented by a custom version of
[SeaORM Migration](https://github.com/SeaQL/sea-orm/tree/1.1.1/sea-orm-migration/src) (v1.1.1). The
modified SeaORM Migration ensures migrations are scoped per package, providing greater control and
reducing coupling between database components.
The PageTop core API provides a comprehensive toolkit for extending its functionalities to specific
requirements and application scenarios through actions, components, packages, and themes:
# 📦 About PageTop
* **Actions** serve as a mechanism to customize PageTop's internal behavior by intercepting its
execution flow.
* **Components** encapsulate HTML, CSS, and JavaScript into functional, configurable, and
well-defined units.
* **Packages** extend or customize existing functionality by interacting with PageTop APIs or
third-party package APIs.
* **Themes** enable developers to alter the appearance of pages and components without affecting
their functionality.
# ⚡️ Quick start
```rust
use pagetop::prelude::*;
struct HelloWorld;
impl PackageTrait for HelloWorld {
fn configure_service(&self, scfg: &mut service::web::ServiceConfig) {
scfg.route("/", service::web::get().to(hello_world));
}
}
async fn hello_world(request: HttpRequest) -> ResultPage<Markup, ErrorPage> {
Page::new(request)
.with_component(Html::with(html! { h1 { "Hello World!" } }))
.render()
}
#[pagetop::main]
async fn main() -> std::io::Result<()> {
Application::prepare(&HelloWorld).run()?.await
}
```
This program features a `HelloWorld` package, providing a service that serves a greeting web page
accessible via `http://localhost:8088` under default settings.
# 📂 Repository Structure
This repository is organized into a workspace that includes several subprojects, each serving a
distinct role within the PageTop ecosystem:
## Application
* [drust](https://github.com/manuelcillero/pagetop/tree/latest/drust):
A simple Content Management System (CMS) built on PageTop, which enables the creation, editing,
and maintenance of dynamic, fast, and modular websites. It uses the following essential packages
to provide standard CMS functionalities.
## Helpers
* [pagetop-macros](https://github.com/manuelcillero/pagetop/tree/latest/helpers/pagetop-macros):
A collection of procedural macros that enhance the development experience within PageTop.
* [pagetop-build](https://github.com/manuelcillero/pagetop/tree/latest/helpers/pagetop-build):
Simplifies the process of embedding resources directly into binary files for PageTop applications.
## Packages
* [pagetop-user](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-user):
Facilitates user management, including roles, permissions, and session handling, for applications
built on PageTop.
* [pagetop-admin](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-admin):
Provides a unified interface for administrators to configure and manage package settings.
* [pagetop-node](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-node):
Enables the creation and customization of content types, enhancing website content management.
## Themes
* [pagetop-bootsier](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-bootsier):
Utilizes the *[Bootstrap](https://getbootstrap.com/)* framework to offer versatile page layouts
and component stylings.
* [pagetop-bulmix](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-bulmix):
Utilizes the *[Bulma](https://bulma.io/)* framework for sleek, responsive design elements.
[PageTop](https://docs.rs/pagetop) is an opinionated web framework to build modular *Server-Side
Rendering* web solutions.
# 🚧 Warning
@ -107,8 +31,7 @@ frequent changes. Production use is not recommended until version **0.1.0**.
# 📜 License
PageTop is free, open source and permissively licensed! Except where noted (below and/or in
individual files), all code in this project is dual-licensed under either:
All code in this crate is dual-licensed under either:
* MIT License
([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
@ -118,10 +41,3 @@ individual files), all code in this project is dual-licensed under either:
at your option. This means you can select the license you prefer! This dual-licensing approach is
the de-facto standard in the Rust ecosystem.
# ✨ Contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the
work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.