Flint Dart is a high-performance, expressive server-side framework for Dart. Build RESTful APIs, authentication systems, and scalable backend services with clean, modern syntax.
import 'package:flint_dart/flint_dart.dart';
void main() {
final app = Flint();
app.get('/', (Context ctx) async {
return ctx.res.send('Welcome to Flint Dart!');
});
app.listen(port: 3000);
}
Flint Dart provides a complete toolkit for building scalable backend services.
Intuitive routing APIs for clean, expressive endpoints
Protect and transform requests with composable middleware
Built-in JWT auth utilities and guard support
Secure hashing helpers for user credentials
Instant feedback while developing
Organize large apps with a scalable layout
Active Record ORM with migrations and models
Scaffold migrations, models, and more
Generate API docs with Swagger/OpenAPI
A few things that feel distinctly Flint and speed up real projects.
Edit templates and handlers without restarting the server.
A lightweight template engine with sections, includes, loops, and conditionals.
Scaffold models, routes, middleware, mail, and seeders in seconds.
Generate API docs and serve Swagger UI with one flag.
QueryBuilder + Models + Schema sync keep DB work consistent.
Auth helpers, sessions, cache, storage, mail, and WebSockets in core.
Installation and basic setup is quick and easy.
dart pub global activate flint_dart
flint create new_app
flint run
Visit your app URL (local or deployed) in your browser
Clean, expressive APIs that feel natural to Dart developers.
import 'dart:io';
import 'package:flint_dart/flint_dart.dart';
void main() {
final app = Flint();
app.get('/', (Context ctx) async {
return ctx.res?.send('Welcome to Flint Dart!');
});
final port = int.tryParse(Platform.environment['PORT'] ?? '') ?? 3000;
app.listen(port: port, hotReload: false);
}
class AuthMiddleware extends Middleware {
@override
Handler handle(Handler next) {
return (Context ctx) async {
final token = ctx.req.bearerToken;
if (token == null || token != "expected_token") {
return ctx.res?.status(401).send("Unauthorized");
}
return await next(ctx);
};
}
}
app.put('/:id', AuthMiddleware().handle(controller.update));
final token = JwtUtil.generateToken({'userId': 123});
final payload = JwtUtil.verifyToken(token);
class User extends Model {
User() : super(() => User());
@override
Table get table => Table(
name: 'users',
columns: [
Column(name: 'name', type: ColumnType.string, length: 255),
Column(name: 'email', type: ColumnType.string, length: 255),
],
);
}
final users = await User().where('name', 'Ada').get();
final user = await User().create({
'name': 'Ada',
'email': 'ada@example.com',
});
class UserController {
Future index(Request req, Response res) async {
final users = await User().get();
return res.json({'users': users.map((u) => u.toMap()).toList()});
}
}
final controller = UserController();
app.get('/users', controller.index);
app.websocket('/chat', (Context ctx) {
ctx.socket?.on('ping', (_) {
ctx.socket?.emit('pong', {'ok': true});
});
});
app.post('/settings', (Context ctx) async {
final data = await ctx.req.validate({'name': 'required|string'});
// ... persist settings
return ctx.res
?.withSuccess('Settings updated successfully.')
.back(fallback: '/settings');
});