rewo 1.0.1 copy "rewo: ^1.0.1" to clipboard
rewo: ^1.0.1 copied to clipboard

Rewo — a modular Dart backend framework. REST APIs, DI, JWT auth, OpenAPI, hot-reload dev, and CLI project scaffolding. Spring-inspired, Express-simple.

Rewo (rewo) #

pub package publisher

Spring power. Flutter simplicity. Express ease.

Rewo is a modular Dart backend framework for building REST APIs. Scaffold a new project in one command, add modules, compile to a native binary — one server, all APIs included.

Published by Avanti Inc. · pub.dev


Install #

Add to your pubspec.yaml:

dependencies:
  rewo: ^1.0.1

Or scaffold a full project with the CLI:

dart pub global activate rewo
rewo create my_api

Or scaffold without global install (from any project that has rewo):

dart pub global activate rewo
rewo create my_api

Quick start (new project) #

rewo create my_api
cd my_api
dart pub get
cp .env.example .env
dart run bin/dev.dart        # hot reload
# or
dart run bin/server.dart     # production run

Your project layout:

my_api/
  bin/server.dart       # entry point
  bin/dev.dart          # hot-reload dev server
  lib/app.dart          # register modules here
  lib/modules/          # your API modules
  test/
  .env

Add an API module #

// lib/modules/hello_module.dart
import 'package:rewo/rewo.dart';

class HelloModule implements RewoModule {
  @override
  String get name => 'hello';

  @override
  void register(Rewo app) {
    app.get('/api/hello', (_) async => {'message': 'Hello World'});
  }
}

Register in lib/app.dart:

static List<RewoModule> get modules => [
  HelloModule(),
];

Features #

Category Feature
CLI rewo create project scaffolding
Dev Hot-reload via bin/dev.dart or rewo dev
HTTP REST routing, native server, HTTP/2, OpenAPI
Auth JWT, sessions, Bearer tokens, role-based access
Core Dependency injection, events, scheduler, modules
Data Validation, in-memory repo, transactions, pagination
Ops Health/readiness, metrics, graceful shutdown
Config .env loading and validation
Deploy dart compile exe bin/server.dart -o server

Minimal app (no scaffold) #

import 'package:rewo/rewo.dart';

void main() async {
  await Rewo.run((app) {
    app.get('/hello', (_) async => {'message': 'Hello World'});
  }, config: AppConfig(port: 8080));
}

Configuration (.env) #

PORT=8080
HOST=0.0.0.0
ENV=development
JWT_SECRET=change-me-in-production
SERVER_ENGINE=native
STORAGE_PATH=./storage

Commands #

rewo create my_api          # scaffold project
dart run bin/dev.dart             # hot-reload dev
dart run bin/server.dart          # run server
dart test                         # tests
dart compile exe bin/server.dart -o server

Documentation #


License #

MIT © Avanti Inc.

1
likes
0
points
580
downloads

Documentation

Documentation

Publisher

verified publisheravantiinc.xyz

Weekly Downloads

Rewo — a modular Dart backend framework. REST APIs, DI, JWT auth, OpenAPI, hot-reload dev, and CLI project scaffolding. Spring-inspired, Express-simple.

Homepage
Repository (GitHub)
View/report issues

Topics

#server #backend #rest #api #framework

License

unknown (license)

Dependencies

analyzer, build, crypto, http, http2, json_annotation, meta, mime, path, postgres, shelf, shelf_router, source_gen, watcher

More

Packages that depend on rewo