FinchConfigs class

Configuration management system for the Finch framework. FinchConfigs provides comprehensive configuration management for all aspects of the web application including server settings, database connections, file paths, security settings, and development tools. The configuration system supports environment variables, default values, and runtime customization. Key features:

  • Environment variable integration with .env file support
  • Database configuration for MongoDB and MySQL
  • Server and domain configuration
  • Path management for assets, templates, and uploads
  • Mail server configuration
  • Template engine configuration (Jinja-like syntax)
  • Development and debugging tools
  • Multi-language support
  • Security settings (cookies, CORS, etc.) Environment variables are automatically loaded from:
  • System environment variables
  • .env file in the project root
  • Platform-specific environment settings Example usage:
final config = FinchConfigs(
  port: 8080,
  domain: 'example.com',
  dbConfig: FinchDBConfig(
    host: 'localhost',
    dbName: 'myapp',
    enable: true,
  ),
  enableLocalDebugger: true, // Only in development
);
final server = FinchApp(configs: config);
await server.start();

Constructors

FinchConfigs({String version = '1.0.0', String? appPath, String? dbPath, String? backupPath, String? widgetsPath, String? languagePath, String pathMigrationMySQL = './migrations', String pathMigrationSQLite = './migrations_sqlite', int port = 8080, int portSocket = 8083, int portNginx = 80, String ip = '0.0.0.0', String dbName = "database_name", bool noStop = true, String serverName = "webserver", String pathFilemanager = '/upload/filemanager', String? publicDir, String? domain, String? domainScheme, int? domainPort, FinchDBConfig? dbConfig, String widgetsType = 'html', int fakeDelay = 0, List<String>? languages, String mailDefault = "example@uproid.com", String mailHost = "smtp.zoho.eu", String blockStart = '{%', String blockEnd = "%}", String variableStart = "{{", String variableEnd = "}}", String commentStart = '{#', String commentEnd = '#}', String cookiePassword = "password", FinchMysqlConfig? mysqlConfig, FinchSqliteConfig? sqliteConfig, String poweredBy = "Dart Finch", bool enableLocalDebugger = false})
Creates an instance of FinchConfigs. Initializes configuration properties with values from environment variables or defaults provided in the parameters.

Properties

appPath String
latefinal
backupPath String
latefinal
blockEnd String
latefinal
blockStart String
latefinal
commentEnd String
latefinal
commentStart String
latefinal
cookiePassword String
latefinal
dbConfig FinchDBConfig
latefinal
dbName String
final
dbPath String
latefinal
domain String
DOMAIN CONFIG
latefinal
domainPort int
latefinal
domainScheme String
latefinal
enableLocalDebugger bool
Enable local debugger This is useful for debugging the application in a local environment. It allows you to inspect and modify the application state in real-time. You can enable it by setting the enableLocalDebugger property to true. the enableLocalDebugger property wills activate a debugger bar on frontend side. This is useful for debugging the application in a local environment. It allows you to inspect and modify the application state in real-time. You can enable it by setting the enableLocalDebugger property to true. Take attention that this will only work in a local environment. dont activate it in production.
getter/setter pair
fakeDelay int
latefinal
hashCode int
The hash code for this object.
no setterinherited
ip String
final
isLocalDebug bool
no setter
languagePath String
latefinal
languages List<String>
latefinal
mailDefault String
latefinal
mailHost String
latefinal
mysqlConfig FinchMysqlConfig
latefinal
noStop bool
final
pathFilemanager String
final
pathMigrationMySQL String
final
pathMigrationSQLite String
final
port int
final
portNginx int
final
portSocket int
final
poweredBy String
final
publicDir String
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverName String
final
sqliteConfig FinchSqliteConfig
latefinal
uri Uri
latefinal
variableEnd String
latefinal
variableStart String
latefinal
version String
final
widgetsPath String
latefinal
widgetsType String
latefinal

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
url({String? path}) String

Operators

operator ==(Object other) bool
The equality operator.
inherited