Generate teams randomly based on rank. This is useful if you want to create lineups of balanced teams. See it in action here
Make sure to install the dependencies:
pnpm installPostgreSQL is used for data storage. You can use Docker or a local PostgreSQL instance.
-
Copy
.env.exampleto.env:cp .env.example .env
-
Update
.envwith your PostgreSQL connection string:DATABASE_URL="postgresql://user:password@localhost:5432/team_generator" -
Install dependencies (this will also run Nuxt prepare and generate ZenStack schemas):
pnpm install
The
postinstallscript automatically runsnuxt:prepareanddb:generate. -
Run database migrations:
pnpm db:migrate
This uses
zen migrate devunder the hood.
Start the development server on http://localhost:3000
pnpm devThe project uses Playwright for end-to-end testing with a separate test database.
To run the full test suite (handles Docker container setup automatically):
pnpm test # Run tests headlessly
pnpm test:ui # Run tests with Playwright UIBoth commands automatically start the test database and preview server, then run tests.
For running tests against the dev server (with hot reload):
pnpm test:devThis starts Docker and the dev server on port 3001 with the test database. Then in a separate terminal, run:
pnpm playwright test --uiWhen done, stop the dev server (Ctrl+C) and run pnpm docker:down to stop the database.
pnpm test:server:dev- Start dev server with test database (requires Docker already running)pnpm test:server- Start preview server with test database (used by Playwright automatically)pnpm docker:up- Start test database containerpnpm docker:down- Stop test database container
