Skip to content

Configuration

SmartTable is configured through environment variables (or a .env file). For Docker deployment use the .env.example / .env.full.example templates in the project root; for local development use smarttable-backend/.env.example (copy it to smarttable-backend/.env or smarttable-backend/config/.env).

Basic Configuration

Application

Environment VariableDescriptionDefault Value
FLASK_ENVRunning environment (development / testing / production)development
FLASK_HOSTListen address0.0.0.0
FLASK_PORTListen port5000
LOG_LEVELLog level (DEBUG / INFO / WARNING / ERROR)INFO

Security

Environment VariableDescriptionDefault Value
SECRET_KEYFlask session secretRequired in production
JWT_SECRET_KEYJWT signing secretRequired in production
JWT_ACCESS_TOKEN_EXPIRESAccess token lifetime (seconds)86400

Generate a strong secret: python -c "import secrets; print(secrets.token_hex(32))"

Database

Environment VariableDescriptionDefault Value
DATA_DIRData directorydata
DATABASE_URLDatabase connection stringsqlite:///data/smarttable.db

Example (PostgreSQL, note the psycopg driver):

env
DATABASE_URL=postgresql+psycopg://user:password@localhost:5432/smarttable

After changing the database, run the migration again: python run.py migrate.

File Storage

Environment VariableDescriptionDefault Value
UPLOAD_FOLDERUpload directoryuploads

Attachments are stored on the local file system; MinIO object storage is a planned extension and is not implemented yet.

Cache & Real-time Collaboration

Environment VariableDescriptionDefault Value
REDIS_URLRedis connection addressredis://localhost:6379/0
ENABLE_REALTIMEEnable real-time collaboration (WebSocket)false
SOCKETIO_MESSAGE_QUEUESocketIO message queue Redis addressredis://localhost:6379/2
SOCKETIO_PING_TIMEOUTSocketIO ping timeout (seconds)60
SOCKETIO_PING_INTERVALSocketIO ping interval (seconds)25

Other Settings

Environment VariableDescriptionDefault Value
CORS_ORIGINSAllowed cross-origin origins (comma separated), recommended in productionLocal origins
TIANDITU_KEYTianditu JS API key; enables the map location picker when setEmpty
TIANDITU_API_BASETianditu API base URLhttps://api.tianditu.gov.cn
ERROR_SHOW_DETAILSShow detailed stack traces in error responses (debug only)false

Note: SMTP email settings are not environment variables — log in to the admin console and maintain the SMTP server, port and credentials under System Settings.

For the full list, see .env.example and smarttable-backend/.env.example.

Released under the MIT License.