ssr_core 0.1.0
ssr_core: ^0.1.0 copied to clipboard
Core interfaces and types for SSR Framework - A modern Dart framework inspired by Next.js
ssr_core #
Core interfaces and types for SSR Framework.
Overview #
ssr_core provides the fundamental interfaces and types that define the SSR Framework architecture. All other packages depend on this package.
Installation #
dependencies:
ssr_core: ^0.1.0
Usage #
import 'package:ssr_core/ssr_core.dart';
// Define a page
class HomePage extends SsrPageBase {
HomePage() : super(
path: '/',
title: 'Home',
description: 'Welcome to my app',
);
@override
Future<String> render(Map<String, dynamic> data) async {
return '<html><body>${data['message']}</body></html>';
}
@override
Future<Map<String, dynamic>> getInitialData() async {
return {'message': 'Hello, World!'};
}
}
// Configure the app
final config = SsrConfig(
name: 'My App',
port: 3000,
enablePwa: true,
enableSeo: true,
);
API #
Classes #
SsrApp- Application interfaceSsrPage- Page interfaceSsrPageBase- Base page implementationSsrDynamicPage- Dynamic page with route parametersSsrConfig- Configuration classSsrRouter- Router interfaceSsrRoute- Route definitionSsrState- State management interface
Documentation #
Full API documentation: docs/api/ssr_core.md
License #
MIT