Skip to content

Configuration

This guide covers the configuration setup for the 2KRIKA backend service.

Database Configuration

SQL Database (PostgreSQL/SQLite)

The application uses Sequelize ORM for SQL database operations.

Using SQLite (Development)

For local development, SQLite is the quickest option:

export SQL_DATABASE_URL="sqlite:///path/to/your/project/db.sqlite"

Using PostgreSQL (Production)

For production or staging environments:

export SQL_DATABASE_URL="postgres://username:password@localhost:5432/2krika"

MongoDB

MongoDB is used for storing chat messages if you choose mongo as message backend:

export MESSAGE_BACKEND='mongo'
export MONGODB_URI="mongodb://localhost:27017/2krika"

Redis

Redis is used for caching:

export REDIS_URL="redis://localhost:6379"

Configuration Files

Environment Variables File

Create a .env file in the project root or use the ENV file approach:

# Create ENV file
touch ENV

# Add your environment variables (see Environment Variables section)
nano ENV

Load the environment variables:

source ENV

Sequelize Configuration

The Sequelize configuration is located at:

adapters/shared/sql/config/config.json

This file is specific to your environment and should not be committed to version control (already in .gitignore).

Storage Configuration

Configure the storage directory for file uploads:

export APP_STORAGE_DIR="./storage/uploads"

Make sure this directory exists and has proper write permissions.

CORS Configuration

Configure allowed origins for CORS:

export ALLOWED_ORIGINS="http://localhost:3000,http://localhost:5173"

Next Steps