Code Update 2

Some more information todo with the project and the different parts happening within it at the current time.

Section 0: Overview of changes from last time

The Discord Bot:


The progress on the discord bot has been at the moment kinda of stagnated due to the fact that I wish to get the Web Panel (which is covered later) in progress and working with the API so that we can more easily configure the discord bot and the other aspects of the project.

This is as I plan to expand once the parts are complete to doing custom messages for the different embeds (ticket embed, reaction role embed possibly) so that the servers can much more customize their experience with the project, and make it more of their own.

Some of the current progress has been the ticket system for the bot, it now sends messages for the claiming of a ticket (have currently an issue with the requests) so proper claiming isn't working but the sending of the embeds for it is, additionally the opening of tickets for the different categories is successful at the current time.

The photos below are for the unban request ticket type, these may change later but currently we only have three ticket types (unban, refund, and staff report):

This is what is displayed when you press the button to create an unban request ticket
This is the message received once the ticket has been created and you can use it
This is what is displayed in the ticket for an unban request ticket

The Web Panel:


The web panel for the project has been taking some quite nice progress so far as I have already got some of the key areas created such as the login menu, and the 403 status screen; which can be seen below.

This is the menu given when the user isn't logged into the panel and tries to access it
This is the 403 page which is shown for the panel and allows individuals to requests access to the resource.

Additionally we have been working on the dashboard page for the panel which can also be seen below.

This is the dashboard screen currently using dummy data to allow simulated information to be shown for this image and development purposes

Section 1: Technical Details

Some Changes To The API:


This week we have been doing some edits to the API to allow it to be much more robust to the project such as when creating new objects into the database or removing them or updating them. This included adding the console to log the error into it without crashing the project, as well as sending better errors when it occurs additionally sending a 400 status.

It follows the format below which is the same error format that is given for unauthorized requests on secure routes but different messages and also the error message along with it all.

Additionally we have changed the routing for the claim ticket and close ticket routes, so that they are not using parms when sending and are just sending the data through the body of the post request. As well as this, we have imporoved the ticket system by adding a flag in the defaultValues to account for servers where they want to allow tickets to be created without the user being linked and as such we have been changing the database sechamtic and the routes accoringly to account for this change to the ticket system.

Creating the Web Panel:


During the time of which I havent been posting, I have been working on the Web Panel. This is because as the further we develop the system, the more I need to configure the plugin, bot, and more. This causes issues as there currently isnt any way to do so without going into the database and changing the data in their manually. Therefore I have decided to move the development of the web panel forward as to facilitate more being able to be created with less issues in the long run.

Now to some of the technical details of the web panel, as you had probably guessed we are using the API for the backend which is contained within the project, this means that we would only have to set the mysql details in one location which is the hosting information for the API, this means that we end up with a much more secure and robust framework for development as the API will log all route interactions and manage access to the different routes.

The engine for development of the web panel is to use express.js which is what we use for the routing and requests in the API to do the same here. This allows us to much more easily create new routes and pass information. On top of this we are using a viewing engine called ejs (Embedded Javascript Templates) . This means that most of the project is generated on the servers side then passed over to the client.

Ok so some of you who know about web development know of a typescript framework called React. I had considered using this, however while I was developing my skills using this it would have taken much longer to do as I had already had experience with ejs. This is one of the reasons as to why I ended up choosing to use ejs over react, additionally react renders the entire page on the clients side which means it would end up being slower for the user of the web panel if they were running lower end hardware, compared when using ejs where it is server-side rendered.

Last updated