```plantuml
@startuml
scale 1

skinparam class {
    BackgroundColor<<BrighterTrades>> lightblue
    BackgroundColor<<Config>> lightgreen
    BackgroundColor<<DataCache>> lightyellow
    BackgroundColor<<Database>> lightcoral
    BackgroundColor<<ExchangeInterface>> lightgrey
}

class "BrighterTrades" <<BrighterTrades>> {
  + config
  + data_cache
  + strategies
  + backtester
  + exchange_interface
  + ws_sockets
  --
  + __init__(config_file)
  + load_config(config_file)
  + save_config()
  + initialize_data_cache()
  + initialize_indicators()
  + initialize_strategies()
  + initialize_backtester()
  + initialize_candles()
  + initialize_signals()
  + initialize_trades()
  + initialize_exchange_interface()
  + initialize_users()
  + get_config()
  + get_data_cache()
  + get_indicators()
  + get_strategies()
  + get_backtester()
  + get_candles()
  + get_signals()
  + get_trades()
  + get_exchange_interface()
  + get_users()
  + get_ws_sockets()
  + run()
}

class "app" {
    + index() 
    + ws(socket_conn) 
    + settings() 
    + history() 
    + signup() 
    + signout() 
    + login() 
    + signup_submit() 
    + indicator_init()
}

class "Flask" {
    + render_template()
}

class "Users" <<DataCache>> {
    + data_cache
}

class "Configuration" <<Config>> {
  + exchanges
  + indicators
  + users
  + __init__(exchanges, indicators, users)
  + get_exchanges()
  + get_indicators()
  + get_users()
  + add_exchange(exchange)
  + remove_exchange(exchange)
  + add_indicator(indicator)
  + remove_indicator(indicator)
  + add_user(user)
  + remove_user(user)
}

class "Candles" <<DataCache>> {
  + __init__(exchanges, config_obj, database)
  + get_last_n_candles(num_candles, asset, timeframe, exchange, user_name)
  + set_new_candle(cdata)
  + set_cache(symbol=None, interval=None, exchange_name=None, user_name=None)
  + get_latestvalues(value_name, symbol, timeframe, exchange, user_name, num_record=1)
  + convert_candles(candles)
  + get_candle_history(num_records, symbol=None, interval=None, exchange_name=None, user_name=None)
}

class "DataCache" <<DataCache>> {
  + db
  + get_records_since(key, start_datetime, record_length, ex_details)
  + cache_exists(key)
  + update_candle_cache(more_records, key)
  + get_cached_candles(key)
  + set_cached_candles(candles, key)
  + clear_cache()
  + get_cache_info()
  + remove_expired_records()
  + remove_cache(key)
  + remove_all_caches()
}

class "Database" <<Database>> {
  + exchanges
  + __init__(exchanges)
  + execute_sql(sql)
  + get_item_where(item_name, table_name, filter_vals)
  + get_rows_where(table, filter_vals)
  + insert_dataframe(df, table)
  + insert_row(table, columns, values)
  + _table_exists(table_name)
  + _populate_table(table_name, start_time, ex_details, end_time=None)
  + _fetch_exchange_id(exchange_name)
  + _fetch_market_id(symbol, exchange_name)
  + _insert_candles_into_db(candlesticks, table_name, symbol, exchange_name)
  + get_records_since(table_name, st, et, rl, ex_details)
  + _get_records(table_name, st, et=None)
  + _fetch_candles_from_exchange(symbol, interval, exchange_name, user_name, start_datetime=None, end_datetime=None)
  + get_from_static_table(item, table, indexes, create_id=False)
}

class "ExchangeInterface" <<ExchangeInterface>> {
  + exchange_data
  + available_exchanges
  --
  + __init__()
  + connect_exchange(exchange_name, user_name, api_keys=None)
  + add_exchange(user_name, _class, arg)
  + get_exchange(ename, uname)
  + get_connected_exchanges(user_name)
  + get_available_exchanges()
  + get_exchange_balances(name)
  + get_all_balances(name)
  + get_order(symbol, order_id, target, user_name)
  + get_trade_status(trade, user_name)
  + get_trade_executed_qty(trade, user_name)
  + get_trade_executed_price(trade, user_name)
  + get_price(symbol, price_source=None)
}

class "Indicators" <<DataCache>> {
  + get_indicators(user_name)
  + get_indicator_data(user_name, source, start_ts, num_results)
}

class "Strategies" <<DataCache>> {
  + get_strategies(user_name)
  + run_strategy(strategy_name, user_name)
}

class "Backtester" <<DataCache>> {
  + run_backtest(strategy_name, user_name)
}

class "Signals" <<Config>> {
  + generate_signals(strategy_name, user_name)
}

class "Trades" <<DataCache>> {
  + execute_trade(trade_details, user_name)
}

class "HDict" <<Database>> {
}

class "SQLite" <<Database>> {
}

class "shared_utilities" <<Candles>> {
}

class "ArrayList" <<ExchangeInterface>> {
}

app --> "index()" : "index()"
app --> "ws(socket_conn)" : "ws(socket_conn)"
app --> "settings()" : "settings()"
app --> "history()" : "history()"
app --> "signup()" : "signup()"
app --> "signout()" : "signout()"
app --> "login()" : "login()"
app --> "signup_submit()" : "signup_submit()"
app --> "indicator_init()" : "indicator_init()"

"signup_submit()" --> "BrighterTrades" : "create_new_user()"
"history()" --> "BrighterTrades" : get_user_info()
"history()" --> "BrighterTrades" : get_market_info()
"signout()" --> "BrighterTrades" : log_user_in_out()
"login()" --> "BrighterTrades" : log_user_in_out()
"indicator_init()" --> "BrighterTrades": "get_user_info()"
"indicator_init()" --> "BrighterTrades": "get_indicator_data()"
"settings()" --> "BrighterTrades" : "adjust_setting()"
"settings()" --> "BrighterTrades" : "get_user_info()"
"signup()" --> "Flask" : render_template()
"index()" --> "Flask" : render_template()
"index()" --> "BrighterTrades" : connect_user_to_exchange()
"index()" --> "BrighterTrades" : get_rendered_data()
"index()" --> "BrighterTrades" : get_js_init_data()
"ws(socket_conn)" --> "BrighterTrades" : process_incoming_message()

"BrighterTrades" -- "DataCache"
"BrighterTrades" -- "Strategies"
"BrighterTrades" -- "Backtester"
"BrighterTrades" -- "Candles"
"BrighterTrades" -- "Configuration"
"BrighterTrades" -- "ExchangeInterface"
"BrighterTrades" -- "Indicators"
"BrighterTrades" -- "Signals"
"BrighterTrades" -- "Trades"
"BrighterTrades" -- "Users"
"BrighterTrades" -- "Database"
"BrighterTrades" -- "SQLite"
"BrighterTrades" -- "HDict"

"Configuration" -- "Signals"
"Configuration" -- "Indicators"
"Configuration" -- "Users"

"Candles" -- "DataCache"
"Candles" -- "shared_utilities"

"DataCache" -- "Database"

"Database" -- "SQLite"
"Database" -- "HDict"

"ExchangeInterface" -- "ArrayList"
"ExchangeInterface" -- "DataCache"

@enduml



```