Git Product home page Git Product logo

elsa-mina's Introduction

Elsa-Mina

CI

Important

This is a work in progress!


About

Elsa-Mina is a Showdown Chat Bot used in the French Room and in several private rooms.

Main Features

  • Custom commands
  • Badge system
  • User profiles
  • Games (Connect Four, Guessing Game)
  • Repeats
  • Room Dashboard
  • Teams Sharing

Technical Info

The bot is written in C# and utilizes .NET 8. Docker is employed for deployment.

Project Structure

The project structure is as follows:

  • ElsaMina.Core: Contains the primary bot logic, the WebSocket client, resource files, and multiple services utilized in commands.
    • Dependencies: Autofac for Dependency Injection (DI), Newtonsoft for JSON serialization, Serilog for logging, RazorLight for Razor HTML templates, and Websocket.Client for the WebSocket connection.
    • References: ElsaMina.DataAccess
  • ElsaMina.DataAccess: Contains the classes used to connect to a PostgreSQL database.
    • Dependencies: EF Core, PostgreSQL driver
  • ElsaMina.Commands: Contains commands.
    • Dependencies: CSharp.Scripting for scripting
    • References: ElsaMina.Core
  • ElsaMina.Console: Main entry point of the program, contains configuration files.
    • References: ElsaMina.Core, ElsaMina.Commands

HTML Templates

For htmlboxes and htmlpages, HTML is rendered via Razor Templates using Razor Light. Templates are stored in the Commands project. They are copied to the Templates directory at build time and pre-compiled on startup.

Persistence

The bot connects to a PostgreSQL database for data persistence. EF Core is used for the ORM. To modify the database, the following commands are utilized:

dotnet ef migrations add <Migration Name> # Creates a new migration
dotnet ef database update <Migration Name> # Applies a migration to an existing database

Configuration & Environments

Different environments can be configured using an environment variable named ELSA_MINA_ENV, which is set to either dev or prod. To run the bot, create a dev.config.json and a prod.config.json file in the Config directory of the Console project and fill in the details. Repeat the same process in the DataAccess project with a dev.dbconfig.json file and a prod.dbconfig.json file.

elsa-mina's People

Contributors

slimf1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.