27 releases

0.0.53 Mar 28, 2024
0.0.50 Feb 26, 2024
0.0.48 Nov 19, 2023
0.0.44 Jul 31, 2023
0.0.32 Nov 12, 2022

#3 in #ssr

Download history 21/week @ 2023-12-18 17/week @ 2023-12-25 19/week @ 2024-01-08 8/week @ 2024-01-15 8/week @ 2024-01-22 39/week @ 2024-02-05 48/week @ 2024-02-12 182/week @ 2024-02-19 209/week @ 2024-02-26 231/week @ 2024-03-04 68/week @ 2024-03-11 219/week @ 2024-03-18 221/week @ 2024-03-25 97/week @ 2024-04-01

628 downloads per month
Used in 12 crates

MIT/Apache

1MB
10K SLoC

PageTop

An opinionated web framework to build modular Server-Side Rendering web solutions.

License API Docs Crates.io Downloads

Overview

The PageTop core API provides a comprehensive toolkit for extending its functionalities to specific requirements and application scenarios through actions, components, packages, and themes:

  • 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

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: 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: A collection of procedural macros that enhance the development experience within PageTop.

  • pagetop-build: Simplifies the process of embedding resources directly into binary files for PageTop applications.

Packages

  • pagetop-user: Facilitates user management, including roles, permissions, and session handling, for applications built on PageTop.

  • pagetop-admin: Provides a unified interface for administrators to configure and manage package settings.

  • pagetop-node: Enables the creation and customization of content types, enhancing website content management.

Themes

🚧 Warning

PageTop framework is currently in active development. The API is unstable and subject to 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:

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.

Dependencies

~25–46MB
~810K SLoC