Package selection guidance compiled from public package information, community data, and project usage.
Fennec is a multi-threaded, robust Dart server-side framework designed for building high-performance backend services. It enables developers to create scalable web servers and APIs using Dart, leveraging concurrency for efficient handling of multiple requests. Built with reliability and speed in mind, Fennec supports deployment across Android, iOS, macOS, Windows, and Linux, making it ideal for cross-platform backend solutions. Its architecture emphasizes simplicity and developer productivity while maintaining strong performance characteristics.
Use cases
Building RESTful APIs
Creating real-time backend services
Developing cross-platform server applications
Handling high-concurrency workloads
Integrating with Flutter frontend apps
Key features
Multi-threaded architecture
Cross-platform support
High performance and scalability
Built-in concurrency model
Simple API design
Robust error handling
Suitable for
Backend developers using Dart
Teams building full-stack Flutter apps
Projects requiring high throughput
Developers seeking lightweight server frameworks
Applications needing cross-platform deployment
Considerations
Requires understanding of Dart concurrency
Limited ecosystem compared to mature frameworks
Best suited for modern Dart projects
May need additional tooling for production deployment
Learning curve for beginners unfamiliar with server-side Dart
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Fennec is a multi-threaded, robust Dart Server-Side Framework.
Sharing Data between Isolates if using multiples Isolates.
Isolate is an isolated environment, inside which there is memory allocated to it and its EventLoop. but sometimes you want to share Data between Isolates or have the same Data content on all Isolates.
Fennec let you do that by using Actor Concept.
first you need to create your Actor customized class that is a subclass of Actor.
example how to implement it.
classCustomisedActorextendsActor{
finalList<String> _strings = [];
CustomisedActor(String name) : super(name);
@overrideFutureOr<void> execute(String action,
{Map<String, dynamic> data = const {}}) {
if (action == 'insert') {
_strings.add(" new item");
} else {
if (_strings.isNotEmpty) {
_strings.removeLast();
}
}
}
@overrideFutureOrget(String action, {Map<String, dynamic> data = const {}}) {
if (action == "get") {
return _strings;
}
returnnull;
}
}
after implementing of your needed subclasses of [Actor], you need just to add it/them to your [Application] by using addActor or addActors in [Application] instance.
with [ServerContext] instance you can have access to your Actor/Actors by their name and you can call get and execute methods to return some Data from Actor or execute some operations.
you can render also html templates with fennec Framework. you need to determine the path for your
html files. application.setViewPath(path.current + '/example');
WebSocket is already integrated in the core of Framework. firstly to use Websocket . you need to
make the useWebSocket object at [Application] instance true.
Fennec Framework supports also Multithreading over isolates. To increase the number of used isolates
just call the function setNumberOfIsolates. the default number of isolates is 1
example
application.setNumberOfIsolates(1
);
Start your Server and test your first Request
import'package:fennec/fennec.dart';
voidmain(List<String> arguments) async {
Application application = Application();
application.setNumberOfIsolates(1);
application.useWebSocket(true);
application.setPort(8000);
application.addRouters([testRouter()]);
ServerInfo serverInfo = await application.runServer();
print("Server is running at Port ${serverInfo.port}");
}}
deploy
heroku cloud:here is heroku-buildpack
for dart and inside it an example how to deploy Fennec Framework on heroku cloud for free. to test
an example you can try this two endpoints:
Running 1m test @ http://localhost:8000/example/test
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.50ms 1.27ms 104.08ms 96.71%
Req/Sec 1.55k 124.24 2.41k 87.15%
926903 requests in 1.00m, 180.33MB read
Requests/sec: 15435.91
Transfer/sec: 3.00MB
import information
Fennec Framework after with version >= 1.0.0 doesn't support more annotations because the big
discussions about the library mirrors. as alernatives you can use Route or Route as showed in this
example.