Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UncivServer.xyz API #47

Open
touhidurrr opened this issue Sep 30, 2024 · 0 comments · May be fixed by #56
Open

UncivServer.xyz API #47

touhidurrr opened this issue Sep 30, 2024 · 0 comments · May be fixed by #56

Comments

@touhidurrr
Copy link
Owner

touhidurrr commented Sep 30, 2024

Why do we need this now?

The issue started with the deprecation of the MongoDB Atlas Data API:

https://www.mongodb.com/docs/atlas/app-services/data-api/data-api-deprecation/

I used this API to query data directly from our MongoDB server for UncivGames Democracy Bot. Even though the bot is really useful and popular with many users in Discord for the utility it provides, the codebase for it remains largely unmaintainable in terms of how it was written. The bot was written in pure JavaScript, implementing the Discord API from scratch from their docs, with no sort of type or doc generation software used at all, making the codebase understandable mostly only to me and largely unmaintainable. It's the reason why I never felt like making the repo public on GitHub either.

However, recently I had some time and decided to rewrite the codebase in TypeScript, which should make the situation much better and would make it possible for me to publish the repo on GitHub also. But of course, there are issues, one of them being the Atlas Data API, which many of the commands rely heavily on, is getting deprecated. This made me feel the necessity of using an UncivServer.xyz private API that I can then use in other services like the bot. Using the Atlas Data API was not a good choice to begin with because:

  1. It makes us rely on MongoDB.
  2. Changing the database would need a rewrite of major parts of the bot.
  3. Communication between the bot and server should not rely on a database product.
  4. Bot should not access the database directly.

So, with all of these things in mind, I decided to write an API, which will be private for now (not publicly accessible), with the primary focus of using it with the bot for the time being.

I will open a new branch and start working there. Thanks, readers, in case we have any.

@touhidurrr touhidurrr linked a pull request Dec 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant