You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TimeMates backend server is actively developing a new feature that will provide a future way to configure and set up your server using a Kotlin script with the .tmc file extension. This feature aims to offer a more flexible and customizable approach to server configuration.
Please note that at the time of writing this documentation, the feature is not yet available. However, we are excited to provide you with an overview of how this future configuration method will work.
Once the TimeMates backend server configuration feature is released, you can follow these steps to set up your server using the Kotlin script with the .tmc file extension:
Create a new Kotlin script file with the .tmc extension (e.g., config.tmc).
Start configuring your backend server by directly accessing the TimeMatesConfigurationScope functions from the root of the script:
// config.tmc// Configure the mailer (Example)
mailer {
// Specify the implementation and customize the mailer settings
mailerSend {
apiKey ="YOUR_API_KEY"
sender ="[email protected]"
confirmationTemplateId ="CONFIRMATION_TEMPLATE_ID"
supportEmail ="[email protected]"
}
// or (only one implementation can be used)
smtp {
host ="smtp.example.com"
port =587
user ="smtp-user"
password ="smtp-password"
confirmationSender ="[email protected]"
}
}
// Configure the database (Example)
database {
// Specify the implementation and customize the database settings
postgresql {
url ="jdbc:postgresql://localhost:5432/mydatabase"
user ="myuser"
password ="mypassword"
}
// or (only one implementation can be used)
inMemory() // it will use h2 implementation that stores everything in memory
}
// Configure the files (Example)
files {
// Specify the file system settings
localFiles {
imagesPath("path/to/images")
}
}
// Configure the settings (Example)
settings {
// Specify the server settings
users {
canRegister =true
}
overwriteEnvironment =true// telling server not to use env variables if available
}
Configuration Interceptors (Future Proposal)
In the future configuration system, you will have the ability to define interceptors that can be applied to various parts of the server configuration. Interceptors provide a way to add custom logic, such as authorization or verification, before executing certain configuration blocks.
For example, you might want to create an interceptor that verifies the identity of individuals who want to host TimeMates and restricts access to certain configuration options. This can help ensure that only authorized individuals can make changes to the server configuration.
interceptors {
authorization { data ->// AuthorizationRequestScopeif(someApi.hasUser(data.email))
abort(message ="This user cannot be registered")
else/* ... */
}
}
Limitation Settings
Another proposal for the future configuration system is the inclusion of limitation settings. These settings allow you to restrict or customize certain aspects of the server behavior.
For example, you might want to limit the maximum number of concurrent connections, the rate of API requests, or the maximum file size that can be uploaded. These limitation settings help you fine-tune and manage the server resources based on your specific requirements.
In the example above, the settings section includes a limitations block where you can set various limitations for the server.
Database Connection Pool Configuration (Future Proposal)
The future configuration system of the TimeMates backend server aims to include a feature for customizing the database connection pool settings. This allows you to optimize the handling of database connections and enhance the server's performance.
Database Connection Pool Settings
The following configuration options will be available for the database connection pool:
maxConnections: Specifies the maximum number of connections allowed in the pool.
minConnections: Defines the minimum number of connections to keep in the pool, even when idle.
connectionTimeout: Sets the maximum time in milliseconds for a connection to be allocated from the pool.
idleTimeout: Specifies the maximum time in milliseconds that a connection can remain idle in the pool before being evicted.
Example Configuration
To configure the database connection pool, use the database block within the Kotlin script:
TimeMates Backend Server Setup (Future Feature)
The TimeMates backend server is actively developing a new feature that will provide a future way to configure and set up your server using a Kotlin script with the
.tmc
file extension. This feature aims to offer a more flexible and customizable approach to server configuration.Please note that at the time of writing this documentation, the feature is not yet available. However, we are excited to provide you with an overview of how this future configuration method will work.
Structure
Getting Started (Future Implementation)
Once the TimeMates backend server configuration feature is released, you can follow these steps to set up your server using the Kotlin script with the
.tmc
file extension:.tmc
extension (e.g.,config.tmc
).TimeMatesConfigurationScope
functions from the root of the script:Configuration Interceptors (Future Proposal)
In the future configuration system, you will have the ability to define interceptors that can be applied to various parts of the server configuration. Interceptors provide a way to add custom logic, such as authorization or verification, before executing certain configuration blocks.
For example, you might want to create an interceptor that verifies the identity of individuals who want to host TimeMates and restricts access to certain configuration options. This can help ensure that only authorized individuals can make changes to the server configuration.
Limitation Settings
Another proposal for the future configuration system is the inclusion of limitation settings. These settings allow you to restrict or customize certain aspects of the server behavior.
For example, you might want to limit the maximum number of concurrent connections, the rate of API requests, or the maximum file size that can be uploaded. These limitation settings help you fine-tune and manage the server resources based on your specific requirements.
In the example above, the settings section includes a
limitations
block where you can set various limitations for the server.Database Connection Pool Configuration (Future Proposal)
The future configuration system of the TimeMates backend server aims to include a feature for customizing the database connection pool settings. This allows you to optimize the handling of database connections and enhance the server's performance.
Database Connection Pool Settings
The following configuration options will be available for the database connection pool:
maxConnections
: Specifies the maximum number of connections allowed in the pool.minConnections
: Defines the minimum number of connections to keep in the pool, even when idle.connectionTimeout
: Sets the maximum time in milliseconds for a connection to be allocated from the pool.idleTimeout
: Specifies the maximum time in milliseconds that a connection can remain idle in the pool before being evicted.Example Configuration
To configure the database connection pool, use the
database
block within the Kotlin script:The text was updated successfully, but these errors were encountered: