I didn't specified a special name for this repository. You can use this system for your systems.
Hmm. In server directory, the backend written in Elysia.js greets you. In there you can will edit the .env.template then rename it to .env. Also I tried to reduce the cognitive load by breaking the project down into files as much as possible. So you can develop this backend more as you can.
Anyway, In the loadbalancer directory, the other backend written in Encore is in there. This load balancer takes the request's geo location and directs the request to the nearest server.
You can see the cdn3.png file for detailed sequence mermaid diagram.
Install Bun runtime first if it is not installed
curl -fsSL https://bun.sh/install | bashThen just go to server directory and write this for install dependencies:
cd serverbun installInstall encore runtime first if it is not installed
curl -L https://encore.dev/install.sh | bashThen just go to loadbalancer directory and write this for install dependencies:
cd loadbalancerbun install(Optional) GeoIP Database Update
If you wanna update your GeoIP database from MaxMind with your license key, please write this after installing dependencies:
node ./node_modules/geoip-lite/scripts/updatedb.js license_key=YOUR_LICENSE_KEYbun --bun run devFirstly build your backend with:
bun --bun run buildThen just write this to run anywhere you want (Requires Bun, just Node.js it won't work)
bun --bun dist # dist/index.js | or whatever your file namebun --bun run devFirstly build your backend with:
encore dev- A time after, the redis client server connection closes sometimes.
Feel free to open a PR, issue.
Made with contrib.rocks.
GNU GENERAL PUBLIC LICENSE@3