To get started, create your own .env file based on .env.example.
There are two ways to run the project:
- Using the Docker Compose setup
- Setting up a database and running the server manually
- Discord app: Authentication to access the dashboard is handled by Discord OAuth2. For this, you will need an application on the Discord Developer Portal.
Insert the client ID and secret in the
.envfile. - Spotify app (optional): To enable fetching of artists and tracks, create a Spotify app on the Spotify Developer Portal.
Insert the client ID and secret in the
.envfile.
This project uses a modular Docker Compose setup based on file inheritance. This allows us to keep a clean base configuration while easily switching between development, IDE-only, and production environments.
The active configuration is controlled by the COMPOSE_FILE variable in your .env file. Docker Compose reads this variable and merges the specified files in order.
- Runs only the MySQL database in Docker and exposes port
3306. This allows you to run Nuxt locally on your host machine while connecting to the Dockerized database. - Use the script
npm run dev-idein this environment to ensure Prisma functions properly. - Includes Prisma studio at
http://localhost:5555. - Note: You will need to change
DATABASE_URLin.envto point tolocalhost:3306instead ofdb:3306.COMPOSE_FILE=docker-compose.yml:docker-compose.dev-ide.yml
- Runs both the database and the Nuxt application within Docker.
- Includes optional Hot Module Replacement (HMR) and automatic Prisma migrations.
- Includes Prisma studio at
http://localhost:5555. - To turn on HMR, edit
docker-compose.dev.yml.
COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml- Used for deployment. It uses the
Dockerfileto create a minimized production build and applies migrations viaprisma migrate deploy.
COMPOSE_FILE=docker-compose.yml:docker-compose.prod.ymlOnce you have set the desired COMPOSE_FILE in your .env file, you can use standard Docker commands without any additional flags:
docker compose up -ddocker compose down- Populate .env file with valid values
- Install dependencies
npm install- Generate prisma files
npm run generate-prisma- Generate nuxt files
npm run generate-
Setup MySQL server and edit server string in .env
-
Deploy Prisma migrations
npm run migrate-prisma- Run server
npm run dev- You first want to create your own account to use the dashboard. Go to
/adminand follow the instructions. - You may want to adjust the base date from which day ids are calculated at
/server/utils/schedule.ts.
- Populate the track/album database at
/admin/import/tracksand/admin/import/albums. - Add editors to help you out at
/admin/editors. - Create games instances! The first game in every category (with
id=1) are example games that can't be edited or deleted. - Schedule these created game instances at
/admin/schedule.
This doesn't represent the order in which files should be created as they are very interlinked but rather serves as an overview:
- Create a new container at
/types/gameModels.ts. It essentially holds all the dynamic information about the game that is stored in the database, thus it should be very close to the table schema that you may have made already. - Register the game in
/shared/games.ts, you will need a validator that should be placed in/shared/gameValidators.ts. - Create the client and server definitions in
/utils/game/impl/and/server/utils/game/impl/respectively and implement its methods (to do this, you need to have made the components below first).
- In
components/games/create a new folder for your game. - Implement all relevant components in this folder, see existing ones for reference.
- Create a new table according to your container needs.