This project provides a collection of APIs for various functionalities, including jokes, Bible verses, quotes, math questions, science questions, Minecraft server status, and an economy system. Below is an overview of the APIs and their use cases.
- Jokes API
- Bible Verse API
- Quotes API
- Math Questions API
- Science Questions API
- Minecraft Server Status API
- Economy API
Use Case: Provides random jokes and allows retrieval of specific jokes by ID.
-
GET /api/jokes/random
- Fetches a random joke.
-
GET /api/jokes/:id
- Retrieves a joke by its ID.
Use Case: Provides random Bible verses and allows retrieval of specific verses based on book, chapter, and verse.
-
GET /api/bible/random
- Fetches a random Bible verse.
-
GET /api/bible/:book/:chapter/:verse
- Retrieves a specific Bible verse based on book, chapter, and verse.
Use Case: Provides random quotes.
- GET /api/quotes/random
- Fetches a random quote.
Use Case: Provides random math questions for practice.
- GET /api/math/random
- Fetches a random math question.
Use Case: Provides random science questions for practice.
- GET /api/science/random
- Fetches a random science question.
Use Case: Checks the status of Minecraft servers for both Java and Bedrock editions.
- POST /api/minecraft/status
- Checks the status of a Minecraft server.
- Example Request: /api/minecraft/status?server=ip&port=port
Use Case: Manages simple economy, including balance checks, earning, spending, and transferring money.
-
GET /api/economy/balance/:username
- Retrieves the balance of a specific user.
-
POST /api/economy/earn
- Adds money to a user's balance. (Creates an account if user does not exist)
- Example Request: {"username": "username", "amount": "number"}
-
POST /api/economy/spend
- Deducts money from a user's balance.
- Example Request: {"username": "username", "amount": "number"}
-
POST /api/economy/transfer
- Transfers money between two users.
- Example Request: {"from": "username", "to": "username", "amount": "number"}
-
Clone the repository:
git clone https://github.com/romalescarl18/Amethyst.git
-
Navigate to the project directory:
cd Amethyst
-
Install dependencies:
npm install
-
Create a
.env
file and configure your MongoDB URI and other environment variables. -
Start the server:
npm start
- Node.js: Server-side runtime environment.
- Express.js: Framework for building APIs.
- MongoDB: Database for storing data.
- Swagger: API documentation.
- Gamedig: Library for querying Minecraft server status.
After starting the server, use an API client like Postman or cURL to interact with the APIs. You can also view the API documentation at /docs
(if Swagger UI is enabled).
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature-name"
- Push to your branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.