Skip to content

Setting Up The Development Environment

EnderDoom77 edited this page Mar 5, 2022 · 6 revisions

Dependencies

Make sure you have the following dependencies available:

  • Windows

  • Visual Studio 2022 Community Preview

    • .NET Desktop Development checked in the Workloads tab.

    • ASP.Net and Web Development checked in the Workloads tab.

    • .NET 6.0 Runtime.

Cloning the repository

To clone the Dexter repository, please click Clone a Repository inside Visual Studio in the Welcome screen, setting the repository to be a GitHub repository with the URL of https://github.com/FeroxFoxxo/DexterMASZ. Click "Open" and it should clone the repository.

Updating Discord.Net

By default, Dexter runs the NIGHTLY version of Discord.NET rather than one on NUGET to support new API changes to Discord. To set Discord.NET to pull from nightly, follow the instructions bellow.

  1. Go to Tools -> NuGet Package Manager -> Package Manager Settings.

  2. Click on Package Sources and add a new package source called Discord.Net with the repository of https://www.myget.org/F/discord-net/api/v3/index.json by clicking the green plus sign at the top. Click OK.

  3. Go to Tools -> NuGet Package Manager -> Manage NuGet packages for solution.

  4. Go to the Updates tab and select Include prerelease.

  5. Click on the checkbox next to Discord.NET (if available) and click the Install button next to the prerelease version you wish to update to if you already are not on the current version of Discord.NET.

Setting Up Dexter

Setup for Dexter is simple. All the information for him is stored inside of a database. Your database connection information is set as an environmental variable. If you run the bot, and these environmental variables are not set up, Dexter will automatically prompt you to set them up.

If you don't have a database connection already, you should download MySQL and create a test database and login information. Note, you do not have to create the tables, Dexter will create these for you.

If you're using the local testing, you should specify local while setting up Dexter. This will deploy him on localhost, and enable CORS.

You should also set up Angular to run locally. Simply open up frontend/dexter/src/app/config/config.ts and set:

export const APP_BASE_URL = 'http://127.0.0.1:5565'; export const ENABLE_CORS = true;

making sure to comment out the other configuration variables.

Starting Dexter

To build the Angular app, please make sure you have Node.JS installed. Then run npm install --legacy-peer-deps in the frontend/dexter directory. After that, run npm start. The application should now be hosted on http://localhost:4200.

To initialize Dexter, please click the Start button at the top of the Visual Studio toolbar. This will build the program and launch it. It will ask you to fill out information about Dexter. Please set these accordingly. Once your application starts, the SWAGGER ui will pop up showing the endpoints for your API.

To login, please visit http://localhost:5565/api/v1/login. Please note, because of how cors works, you cannot login through the angular frontend. You can, however, once you login through this URL, navigate to https://localhost:4200 to test your frontend, which should now work with your backend API properly.