package config import "os" type Config struct { ServerPort string JWTSecret string CORSOrigin string // PostgreSQL configuration PostgresHost string PostgresPort string PostgresUser string PostgresPassword string PostgresDB string PostgresSSLMode string // Neo4j configuration Neo4jURI string Neo4jUsername string Neo4jPassword string Neo4jDatabase string Neo4jEnabled bool // Redis configuration RedisURL string // Ollama configuration OllamaURL string OllamaModel string OllamaUsername string OllamaPassword string // Google Maps API configuration GoogleMapsAPIKey string GoogleCloudProjectID string } func Load() *Config { return &Config{ ServerPort: getEnv("SERVER_PORT", "8080"), JWTSecret: getEnv("JWT_SECRET", "your-secret-key-change-in-production"), CORSOrigin: getEnv("CORS_ORIGIN", "http://localhost:3000"), // PostgreSQL defaults PostgresHost: getEnv("POSTGRES_HOST", "localhost"), PostgresPort: getEnv("POSTGRES_PORT", "5432"), PostgresUser: getEnv("POSTGRES_USER", "bugulma"), PostgresPassword: getEnv("POSTGRES_PASSWORD", "bugulma"), PostgresDB: getEnv("POSTGRES_DB", "bugulma_city"), PostgresSSLMode: getEnv("POSTGRES_SSLMODE", "disable"), // Neo4j defaults (disabled by default) Neo4jURI: getEnv("NEO4J_URI", "neo4j://localhost:7687"), Neo4jUsername: getEnv("NEO4J_USERNAME", "neo4j"), Neo4jPassword: getEnv("NEO4J_PASSWORD", "password"), Neo4jDatabase: getEnv("NEO4J_DATABASE", "neo4j"), Neo4jEnabled: getEnv("NEO4J_ENABLED", "false") == "true", // Redis defaults RedisURL: getEnv("REDIS_URL", "redis://localhost:6379"), // Ollama defaults OllamaURL: getEnv("OLLAMA_URL", "http://localhost:11434"), OllamaModel: getEnv("OLLAMA_MODEL", "qwen2.5:7b"), OllamaUsername: getEnv("OLLAMA_USERNAME", ""), OllamaPassword: getEnv("OLLAMA_PASSWORD", ""), // Google Maps API defaults GoogleMapsAPIKey: getEnv("GOOGLE_KG_API_KEY", ""), // Reuse KG API key if it works for Geocoding GoogleCloudProjectID: getEnv("GOOGLE_CLOUD_PROJECT_ID", ""), } } func getEnv(key, fallback string) string { if value := os.Getenv(key); value != "" { return value } return fallback }