Welcome to the Finch Configuration Guide! This guide will walk you through the steps to configure Finch, a powerful web framework for Dart. Whether you're a seasoned developer or just starting, Finch offers a robust set of tools to simplify server-side web app development.
Finch follows a specific project structure to ensure smooth development and deployment. Here's a typical project structure, you can change it to your needs:
├── lib
│ ├── app.dart
│ ├── languages
│ │ ├── en.json
│ │ └── fa.json
│ ├── models
│ │ ├── user.dart
│ │ └── post.dart
│ ├── configs
│ │ ├── setting.dart
│ ├── services
│ │ ├── notification_service.dart
│ │ └── email_service.dart
│ ├── db
│ │ ├── user_collection.dart
│ │ └── post_collection.dart
│ ├── route
│ │ ├── api_route.dart
│ │ ├── socket_route.dart
│ │ └── web_route.dart
│ ├── controllers
│ │ ├── api_controller.dart
│ │ ├── socket_controller.dart
│ │ └── web_controller.dart
│ └── widgets
│ ├── layout.j2.html
│ └── form.j2.html
├── public
│ ├── assets
│ │ ├── css
│ │ ├── js
│ │ └── images
│ └── index.html
├── test
│ ├── api_test.dart
│ ├── socket_test.dart
│ └── web_test.dart
├── migrations # For Mysql
│ ├── 001_create_user.sql
│ └── 002_create_post.sql
├── migrations_sqlite # For Sqlite
│ ├── 001_create_user.sql
│ └── 002_create_post.sql
├── pubspec.lock
└── .env
The FinchConfigs class is used to configure the Finch server. It contains all the necessary properties to configure the server. Here is an example of how to use it:
final config = FinchConfigs(
port: 8080,
domain: 'example.com',
dbConfig: FinchDBConfig(
host: 'localhost',
dbName: 'myapp',
enable: true,
),
enableLocalDebugger: true, // Only in development
);
All configurations are available in FinchConfigs class. You can access and modify them as needed.