Elite Website
The best way to check a player's farming skill/weight in Hypixel skyblock.
Still under development
Developing
-
Download the code, open the project, and run
npm i
to install dependencies -
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 andcache
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
andPUBLIC_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. -
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
-
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. -
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
andnpm run down
. -
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.
-
Follow steps
1-4
of the above development steps, you should then have a.env.production
file to edit. -
To use the included database and cache, edit the host names in
.env.production
as shown. Replacesecure-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. -
Edit your new
.env.production
to use the port3000
(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. -
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