Tracktor app uses environment variables to configure its settings. Here are some common environment variables used in Tracktor:
-
NODE_ENV - Specifies the environment in which the application is running.
- Possible values are
dev,production, andtest. - Default :
development.
- Possible values are
-
SERVER_HOST - Defines the hostname or IP address where the server will listen for incoming requests. If You want the server to be accessible from all network interfaces, you can set this to
0.0.0.0- Possible values are any valid hostname or IP address.
- Default :
localhost.
-
SERVER_PORT - Sets the port number on which the server will listen for incoming requests.
- Possible values are any valid port number (e.g.,
3000,8080). That port must be free. - Default :
3000.
- Possible values are any valid port number (e.g.,
-
DATABASE_PATH - Specifies the file path to the database used by Tracktor. This is typically a SQLite database file.
- Possible values are any valid file path (e.g.,
/path/to/tracktor.db). - Default :
./tracktor.db. - For docker setup this environment variable is set to
/data/tracktor.db.
- Possible values are any valid file path (e.g.,
-
UPLOADS_DIR - Defines the directory path where uploaded files will be stored.
- Possible values are any valid directory path (e.g.,
/path/to/uploads). - Default :
./uploads. - For docker setup this environment variable is set to
/data/uploads.
- Possible values are any valid directory path (e.g.,
-
AUTH_PIN - Sets a PIN code for authentication purposes. This is used to log in to the Tracktor application.
- Possible values are any 6 digit string representing the PIN code (e.g.,
000000). - Default :
123456. NOTE: To change the pin update this environment variable before starting the application.
- Possible values are any 6 digit string representing the PIN code (e.g.,
-
CORS_ORIGINS - Specifies the allowed origins for Cross-Origin Resource Sharing (CORS). This is useful for controlling which domains can access the Tracktor API.
- Possible values are a comma-separated list of allowed origins (e.g.,
http://example.com,https://anotherdomain.com,http:<ip_address>:3000). - Default :
*(allows all origins). NOTE: When using Tracktor with a frontend application hosted on a different domain or port or behind reverse proxy, it's recommended to set this variable to the specific origin of the frontend application for security reasons.
- Possible values are a comma-separated list of allowed origins (e.g.,
-
PUBLIC_DEMO_MODE - A boolean flag that, when set to
true, enables demo mode features in the application by seeding some demo data to try out application features.- Possible values are
trueorfalse. - Default :
false.
- Possible values are
-
FORCE_DATA_SEED - A boolean flag that, when set to
true, forces the application to seed the database with demo data on startup ifPUBLIC_DEMO_MODEis set to true.- Possible values are
trueorfalse. - Default :
false.
- Possible values are
-
LOG_REQUESTS - A boolean flag that, when set to
true, enables logging of incoming HTTP requests in backend API.- Possible values are
trueorfalse. - Default :
true.
- Possible values are
-
LOG_LEVEL - Sets the logging level for the application. The logging level determines the severity of messages that will be logged.
- Possible values are
error,warn,info,http,verbose,debug, andsilly. - Default :
info.
- Possible values are
-
LOG_DIR - Specifies the directory path where log files will be stored.
- Possible values are any valid directory path (e.g.,
/path/to/logs). - Default :
./logs.
- Possible values are any valid directory path (e.g.,
-
PUBLIC_API_BASE_URL - Defines the base URL for the public API endpoints. This is useful when the application is behind a reverse proxy or load balancer.
- Possible values are any valid URL (e.g.,
http://example.com). - Default :
http://localhost:3000.
- Possible values are any valid URL (e.g.,
NOTE: These environment variables can be set in your system or in a .env file in the root directory of the Tracktor application. Make sure to restart the application after changing any environment variables for the changes to take effect.