Flint Dart ๐Ÿ”ฅ

๐Ÿš€ Flint Dart

Flint Dart is a high-performance, expressive, and extensible server-side framework built entirely with Dart. Designed for developers who demand speed and simplicity, it delivers everything you need to build RESTful APIs, authentication systems, and scalable backend services โ€” all with clean, modern syntax and hot-reload precision.

โšก Build fast. Scale effortlessly. Flint Dart gives you the freedom to create powerful applications without the limits of rigid frameworks.

Developed and maintained by Eulogia Technologies.


๐Ÿ“š Table of Contents

Topic Description
๐Ÿš€ Getting Started Set up Flint in your project
๐Ÿ›ฃ๏ธ Routing Define routes for your Flint Dart app
๐Ÿ›ก Middleware Protect and modify requests with middleware
๐Ÿ—„ ORM & Models Work with databases using Flint Dart ORM
๐Ÿ’พ Database & Migrations Manage your database schema and migrations
๐Ÿ”‘ Authentication Built-in authentication and Google Auth support
โœ… Validation Validate input like Laravel
โ™ป๏ธ Hot Reload Instant feedback while developing
๐Ÿ’พ Storage Storage Flint Dart to production
๐Ÿšข Deployment Deploy Flint Dart to production
๐Ÿ“– API Docs Best-in-class API documentation with Swagger UI

โœจ Features

  • ๐Ÿงฑ Simple and intuitive routing
  • ๐Ÿ›ก๏ธ Middleware support
  • ๐Ÿ” Built-in JWT authentication
  • ๐Ÿ”’ Secure password hashing
  • โ™ป๏ธ Hot reload support for rapid development
  • ๐Ÿงช Modular structure for scalable projects
  • ๐Ÿ’ก Clean API design inspired by Flutter's widget philosophy
  • ORM for MySQL/Postgres
  • CLI for migrations, models, etc.
  • Swagger docs

๐Ÿš€ Getting Started

1. Install as a Global Package

If you want to quickly create and run apps without adding Flint as a dependency, install it globally:

dart pub global activate flint_dart
flint create new_app   # Create a new Flint project
flint run              # Run the project

2. Add as a Project Dependency

If you prefer Flint to be part of your projectโ€™s dependencies:

dart pub add flint_dart
dart run 
import 'package:flint_dart/flint_dart.dart';

void main() {
  final app = Flint();

  app.get('/', (req, res) async {
    return res.send('Welcome to Flint Dart!');
  });

  app.listen(3000);
}

3. Run with hot reload



app.get('/hello', (req, res) async {
  return res.json({'message': 'Hello, world!'});
});

Middleware


import 'package:flint_dart/flint_dart.dart';

class AuthMiddleware extends Middleware {
  @override
  Handler handle(Handler next) {
    return (Request req, Response res) async {
      final token = req.bearerToken;
      if (token == null || token != "expected_token") {
      return  res.status(401).send("Unauthorized");
      }
   return await next(req, res);
    };
  }

  app.put('/:id', AuthMiddleware().handle(controller.update));

JWT Authentication

final token = JwtUtil.generateToken({'userId': 123});
final payload = JwtUtil.verifyToken(token);

Password Hashing

final hash = Hashing.hashPassword('mySecret');
final isValid = Hashing.verifyPassword('mySecret', hash);




## ๐Ÿงฉ WebSocket System (Major Upgrade)

### ๐Ÿ” Socket.IOโ€“like API
Flint now ships with an easy-to-use WebSocket engine with event-based communication:

```dart
app.ws('/chat', (socket, params) {
  socket.on('message', (data) {
    print('๐Ÿ’ฌ ${socket.id} says: $data');
    socket.broadcastToRoom('chat', {'event': 'message', 'data': data});
  });
});

Client-side:

final ws = FlintWebSocketClient("wss://api.example.com/chat");
ws.on('message', (data) => print("๐Ÿ“ฉ $data"));
ws.emit('message', {'text': 'Hello World'});

๐Ÿ’ฌ Core Features

  • .emit(event, data) โ†’ Send named events easily
  • .on(event, callback) โ†’ Listen for specific events
  • .onMessage() and .onJsonMessage() remain supported for backward compatibility
  • .join(room) and .leave(room) for group messaging
  • .broadcast() and .broadcastToRoom() for real-time updates
  • Auto Reconnect on the client when connection drops
  • JWT Support using the same middleware chain as HTTP routes
  • Auth Middleware can now
  ### ๐Ÿ“ Project Structure

```bash
lib/
โ”œโ”€โ”€ main.dart
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app.dart
โ”‚   โ”œโ”€โ”€ router.dart
โ”‚   โ”œโ”€โ”€ request.dart
โ”‚   โ”œโ”€โ”€ response.dart
โ”‚   โ”œโ”€โ”€ middleware.dart
โ”‚   โ””โ”€โ”€ security/
โ”‚       โ”œโ”€โ”€ jwt_util.dart
โ”‚       โ””โ”€โ”€ hashing.dart

๐Ÿ“ฎ Contact & Support ๐ŸŒ Website: flintdart.eulogia.net

๐Ÿ“ง Email: eulogiatechnologies@gmail.com

๐Ÿ™ GitHub: github.com/eulogiatechnologies/flint_dart

๐Ÿ›  Contributing We welcome contributions! To get started:

git clone https://github.com/eulogiatechnologies/flint_dart.git
cd flint_dart
dart pub get

Then feel free to submit issues or pull requests.

Libraries

auth
db
flint_dart
Support for doing something awesome.
mail
model
schema
security
storage