A simple Discord bot to help you find what game to play with your friends. Allows rating of games and selects the best game based on the list of players present.
-
Install pnpm standalone (or system package manager)
NOTE: Do not install via NPM package manager. This project uses pnpm to manage Node versions.
-
Install PostgreSQL
-
Install dependencies
pnpm install
-
Create a database
psql -U postgres -c "CREATE DATABASE wswp" -
Create a
.envfile in.packages/databasewith the following content:DATABASE_URL="postgresql://postgres@localhost:5432/wswp?schema=public" -
Create a
.envfile in./apps/discordwith the following content:DATABASE_URL="postgresql://postgres@localhost:5432/wswp?schema=public" DISCORD_CLIENT_ID=your-discord-client-id DISCORD_TOKEN=your-discord-client-token STEAM_API_KEY=your-steam-api-key -
Sync database to Prisma schema and generate Prisma types
pnpm dev:setup
-
Start the bot
cd ./apps/discord pnpm start:dev
pnpm dev:setup- Sync the database to the Prisma schema and generate Prisma types.pnpm lint- Lint the project using ESLint.pnpm validate- Validate TypeScript code without emitting output.
pnpm build- Build the project and output to the./apps/discord/builddirectory.pnpm start- Run the project currently built in the./apps/discord/builddirectory.pnpm start:dev- Start the project in development mode with hot-reloading usingtsx.
pnpm build- Build the project and output to the./packages/database/builddirectory.pnpm db:deploy- Deploy database migrations to the database.pnpm db:generate- Generate TypeScript types from the Prisma schema. Useful anytime you change./packages/database/prisma/schema.prismaor add TypeSQL files to./packages/database/prisma/sql.pnpm db:migrate- Create a new migration based on the current Prisma schema.pnpm db:seed- Seed the database with initial data as defined in./packages/database/prisma/seed.ts.pnpm db:studio- Open Prisma Studio to interact with the database through a web interface.pnpm db:sync- Sync the database schema to match the Prisma schema without running migrations.