ptlthg / EliteWebsite

A website for finding a player's farming weight in Hypixel Skyblock.

Home Page:https://elitebot.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elite Website

The best way to check a player's farming skill/weight in Hypixel skyblock.

https://elitebot.dev/

Still under development

Developing

  1. Download the code, open the project, and run npm i to install dependencies

  2. Create a copy of .env.example, rename it to .env and fill out all the fields with the relevant values.

    a. For developing using the included database postgres container and cache redis container, use the following values that are already provided:

    POSTGRES_URI="postgres://user:postgres123@localhost:5434/elite"
    REDIS_URI="redis://localhost:6379"
    REDIS_PASSWORD="redisCachePassword123"

    If you have a postgres or redis running elsewhere, you may use those.

    b. DISCORD_CLIENT_SECRET and PUBLIC_DISCORD_CLIENT_ID are values found in https://discord.com/developers/applications. You'll have to create a new application, then go to the pictured location to copy these values. DO NOT SHARE YOUR CLIENT SECRET ANYWHERE.

    c. Other values in the .env file can be kept as-is for local development.

  3. Back on https://discord.com/developers/applications, you'll have to add redirect URIs in the dashboard in order to have authentication work. For local developement, add the following:

    http://localhost:5173/login/callback
    http://localhost:3000/login/callback
    

    image

  4. Make a copy of your new .env file and rename it to .env.production. You should have both. You can ignore the production enviroment file for running in dev mode, it just needs to exist.

  5. Start up the database and redis containers (or other postgres database if you went that route). You'll need to have docker-compose (comes with Docker Desktop) installed on your system.

    docker-compose up database cache --build -d
    

    This command will only start up the database, and not the production container. For ease of use, the docker compose up and down functions are aliased to npm run up and npm run down.

  6. Run the website in dev mode with the following:

    npm run dev
    

    Navigate to the link sent in the terminal, and it (should) load!

Building

To create a production version of your app, follow these steps.

  1. Follow steps 1-4 of the above development steps, you should then have a .env.production file to edit.

  2. To use the included database and cache, edit the host names in .env.production as shown. Replace secure-password-here with secure passwords of choice.

    POSTGRES_URI="postgres://postgres:secure-password-here@localhost/postgres"
    REDIS_URI="redis://localhost:6379"
    REDIS_PASSWORD="secure-password-here"
    

    You should then edit docker-compose-prod.yaml to use both of these new passwords in their repective areas. This production docker-compose file removes the port directives to the database and cache, restricting connections to only within the docker network for a layer of protection. This might not be the behavior that you want.

  3. Edit your new .env.production to use the port 3000 (or one of your choice, but be sure to change the port directive in the docker-compose-prod file as well).

    ORIGIN="http://localhost:3000"
    PUBLIC_HOST_URL="http://localhost:3000"
    

    Ensure that you have the port 3000 redirect uri in the Discord application settings on the developer panel mentioned above.

  4. Start up the production build with the following command:

    docker-compose -f docker-compose-prod.yaml up --build -d
    

    You can now navigate to http://localhost:3000/ to view the site.

In order to deploy this site to an actual domain name, you'd have to change the ORIGIN and PUBLIC_HOST_URL to your domain name, and follow a tutorial elsewhere and point to this address with something like nginx forwarding.

If you have questions, feel free to join the support Discord server

About

A website for finding a player's farming weight in Hypixel Skyblock.

https://elitebot.dev/

License:GNU General Public License v3.0


Languages

Language:TypeScript 61.9%Language:Svelte 36.4%Language:JavaScript 1.0%Language:SCSS 0.4%Language:HTML 0.3%Language:Dockerfile 0.1%