6 releases

0.1.7 Jul 13, 2024
0.1.6 Jul 12, 2024
0.1.3 Jun 24, 2024

#963 in Database interfaces

Download history 13/week @ 2024-07-16 6/week @ 2024-07-23 10/week @ 2024-09-10 4/week @ 2024-09-17 29/week @ 2024-09-24 5/week @ 2024-10-01

346 downloads per month

MIT license

67KB
1.5K SLoC

Rust 1K SLoC // 0.1% comments JavaScript 732 SLoC // 0.1% comments Just 7 SLoC

🦧 Pongo

Pongo is a simple and intelligent Dorsal-based admin interface for database management.

Examples

Example usage (serving just the admin panel) can be found in the examples/ directory here.

For a more complete example, you can view a simple Markdown pastebin project which includes Pongo here.

Usage

You can add Pongo as a dependency using the command below:

cargo add pongo --no-default-features

The Pongo database should be created and passed into pongo::dashboard::routes to serve the dashboard and API together.

// https://github.com/hkauso/pongo/blob/master/examples/basic.rs#L19-L27
// create database
let database = Database::new(Database::env_options(), ServerOptions::truthy()).await;
database.init().await;

// create app
let app = Router::new()
  .nest("/@pongo", pongo::dashboard::routes(database.clone()))
  .nest_service("/static", get_service(ServeDir::new("./static")))
  .fallback(pongo::api::not_found);

The location that Pongo is nested under should also be reflected in the PO_NESTED variable so pages can be linked correctly on the dashboard.

You can configure the location where Pongo will send its static file requests to through the PO_STATIC_DIR environment variable. This DOES NOT set the location that the local directory is served from, that is up to you!

Pongo expects an available Redis server to be running so that the dashboard can allow Redis key management. Pongo best integrates into other Dorsal-based servers since it'll pull the same database configuration.

Dependencies

~60MB
~1M SLoC