Skip to content

Commit

Permalink
Merge pull request #100 from Mirasaki/dev
Browse files Browse the repository at this point in the history
Minimize backend/API dependency
  • Loading branch information
Mirasaki authored Feb 21, 2023
2 parents da71b1c + e3e8c43 commit 0734317
Show file tree
Hide file tree
Showing 19 changed files with 124 additions and 1,564 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ REFRESH_SLASH_COMMAND_API_DATA=true
CLEAR_SLASH_COMMAND_API_DATA=false

# ------------------------- API / Server ------------------------- #
CLIENT_URL=djs.mirasaki.dev
USE_API=false
PORT=3000

# ------------------------- File Paths ------------------------- #
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ src/commands/testing
# Documentation: JSDoc
/docs

# Our generated command table
/public/html/commands.html

# Personal TODO file
TODO.md

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Come try the template yourself in our official [support server](https://discord.
- The API is documented at [djs.mirasaki.dev/api-docs](https://djs.mirasaki.dev/api-docs "Backend/API Documentation")
- Source code is well documented with comments, explaining what's going on
- With the use of JSDoc for client documentation, enjoy code-completion (IntelliSense) in your favorite code editor
- This template generates a static HTML page with detailed command information ([example](https://djs.mirasaki.dev/html/commands.html "Example of generated HTML command table"))

<h2 id="features">Features</h2>

Expand Down Expand Up @@ -79,7 +78,7 @@ Every file in [the `listeners` folder](/src/listeners/) will be registered as an

<h3 id="restful-api">RESTful API</h3>

This template comes with a REST API (OpenAPI spec 3.0.0). By default, this only serves the client's command data, which can be used to easily fetch your command data and build a dynamic command table/overview on your personal website. As this project is meant to be newbie-friendly, I thought I would include a **very** basic API template, so new developers are free to play around with it without having to set-up anything themselves. But, of course, you can just remove the `/backend` folder, `npm remove` unused dependencies and just use `npm run client` as the bot/client is completely standalone from the API. It's optional.
This template comes with a REST API (OpenAPI spec 3.0.0). By default, this only serves the client's command data, which can be used to easily fetch your command data and build a dynamic command table/overview on your personal website. As this project is meant to be newbie-friendly, I thought I would include a **very** basic API template, so new developers are free to play around with it without having to set-up anything themselves. Change `USE_API` to `true` in the [env file](/.env.example) to enable this feature.

<h3 id="others">Others</h3>

Expand All @@ -95,7 +94,7 @@ This template comes with a REST API (OpenAPI spec 3.0.0). By default, this only
- Don't like the folder structure? Jump into the [environmental file](/.env.example) and configure where your commands and components are loaded from
- Every embed color code and emoji are grabbed from their respective [configuration file](/src/config/), meaning you can personalize the bot without having to go over a plethora of files
- Comes with a [constants file](/src/constants.js) to manage your unique ids and previously hard-coded values
- Comes with example scripts for `pm2`, `docker` and `concurrently`
- Comes with example scripts for `pm2` and `docker`
- And lastly...

You don't **have** to use the built-in component command (buttons, modals, etc) handler. Alternatively, you can use the following (vanilla `discord.js`) code to achieve the same, but within a ChatInput/UserContextMenu/MessageContextMenu command file:
Expand Down
304 changes: 0 additions & 304 deletions backend/docs/commands.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions backend/middleware/cors.js

This file was deleted.

21 changes: 0 additions & 21 deletions backend/middleware/errorMiddleware.js

This file was deleted.

Loading

0 comments on commit 0734317

Please sign in to comment.