Un entorno para el desarrollo de soluciones web modulares, extensibles y configurables.
Find a file
2024-12-02 12:11:28 +01:00
config ♻️ Refactor core for minimal PageTop setup 2024-11-30 22:15:06 +01:00
examples 🐛 Fix package registration 2024-04-03 15:17:20 +02:00
helpers 🔖 [macros] release development version 0.0.14 2024-12-01 12:37:10 +01:00
src 🔖 [pagetop] release development version 0.0.57 2024-12-01 12:38:51 +01:00
static ♻️ Refactor core for minimal PageTop setup 2024-11-30 22:15:06 +01:00
tests 🔥 Remove unwrap usage to improve new apps setup 2024-02-26 07:39:08 +01:00
tools 🔥 Remove external packages for unity 2024-04-12 21:41:53 +02:00
.gitignore 🎨 Is render, not prepare 2024-12-01 12:06:15 +01:00
build.rs ♻️ Refactor core for minimal PageTop setup 2024-11-30 22:15:06 +01:00
Cargo.lock 🔖 [pagetop] release development version 0.0.57 2024-12-01 12:38:51 +01:00
Cargo.toml 🔖 [pagetop] release development version 0.0.57 2024-12-01 12:38:51 +01:00
CREDITS.md 🚧 Working on 0.1.0 version 2024-11-30 11:35:48 +01:00
LICENSE-APACHE Añade las licencias del proyecto 2022-06-07 06:44:51 +02:00
LICENSE-MIT Añade las licencias del proyecto 2022-06-07 06:44:51 +02:00
README.md 📝 Doc tweak 2024-12-02 12:11:28 +01:00

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

The simplest PageTop application looks like this:

use pagetop::prelude::*;

#[pagetop::main]
async fn main() -> std::io::Result<()> {
    Application::new().run()?.await
}

This provides a default homepage at http://localhost:8088 using the default configuration. To customize the service, you can define a PageTop package like this:

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 defines a custom HelloWorld package to serve a page at the root path (/) displaying a "Hello World!" message inside an HTML <h1> element.

📂 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.

🚧 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.