Skip to content

JeroenMX/MoonEnergy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MoonEnergy

Description

MoonEnergy is a fictitious company selling moon energy and this solution contains an example AI Chatbot.

Features

  • Chat interface for interacting with OpenAI's API.
  • Ability to get weather information. 'What's the weather in Amsterdam?'
  • Manage user information such as "Installment amount" or "Termijnbedrag". Examples: 'What is my installment amount?', 'Wat is mijn termijnbedrag', 'Change my installment amount' or 'Wijzig mijn termijnbdrag'
  • Backend REST API services for handling chat functionality.
  • Render json as part of the response.

Getting Started

  1. Obtain your Open AI API key (see Configuration)
  2. Start both projects and frontend app
  3. When prompted to login use alice:alice or bob:bob as credentials. (can be changed in MoonEnergy.Sso/Pages/TestUsers.cs)

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/your-repository.git
    cd your-repository/src/MoonEnergy/MoonEnergy
  2. Install frontend dependencies:

    cd clientapp
    npm install
  3. Restore backend dependencies:

    cd ..
    dotnet restore

Configuration

  1. OpenAI API Key:

    To integrate with OpenAI, you will need an API key. Follow these steps to obtain it:

    • Go to OpenAI's API.
    • Sign up for an account or log in if you already have one.
    • Navigate to the API keys section in your account settings.
    • Create a new API key.
    • Copy the API key and paste it into your project's configuration file or environment variables.
  2. Configure API Key:

    Add the OpenAI API key to your appsettings.json or better appsettings.local.json file:

    {
      "OpenAI": {
        "ApiKey": "your_openai_api_key_here"
      }
    }

Running the Application

  1. Run the backend:

    dotnet run

    The backend server will start running on https://localhost:5001 or another URL specified in your configuration.

  2. Run the frontend:

    cd clientapp
    npm run dev

    The frontend development server will start, typically on http://localhost:5173.

Building the Application

To build the application for production:

  1. Build the backend:

    dotnet build --configuration Release
  2. Build the frontend:

    cd clientapp
    npm run build

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published