/*
    ! /configuration/mapping.js
    = Central Mapping Configuration
*/
import path from 'path';
import url from 'url';
import dotenv from 'dotenv';

// $ import .env
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
dotenv.config({ path: path.resolve(__dirname, '.env') });

// % declare directories
const rootDir = path.resolve(__dirname, '..');
const dirs = {
    rootDir: rootDir,
    serverDir: path.resolve(rootDir, 'servers'),

    // § data structure directories
    configDir: path.resolve(rootDir, 'configuration'),
    dataDir: path.resolve(rootDir, 'database'),

    // § other directories
    serviceDir: path.resolve(rootDir, 'services'),
    interfaceDir: path.resolve(rootDir, 'ui'),
    resourcesDir: path.resolve(rootDir, 'resources')
};

// % set database config
const dbConfig = {
    host: process.env.INTERNAL_DB_HOST,
    port: process.env.INTERNAL_DB_PORT,
    databases: {},
    users: {}
};

export { dirs, dbConfig };