Skip to content

genu/team-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Team Generator

Generate teams randomly based on rank. This is useful if you want to create lineups of balanced teams. See it in action here

CleanShot 2023-01-10 at 09 46 22

Make sure to install the dependencies:

pnpm install

Setup

PostgreSQL is used for data storage. You can use Docker or a local PostgreSQL instance.

  1. Copy .env.example to .env:

    cp .env.example .env
  2. Update .env with your PostgreSQL connection string:

    DATABASE_URL="postgresql://user:password@localhost:5432/team_generator"
    
  3. Install dependencies (this will also run Nuxt prepare and generate ZenStack schemas):

    pnpm install

    The postinstall script automatically runs nuxt:prepare and db:generate.

  4. Run database migrations:

    pnpm db:migrate

    This uses zen migrate dev under the hood.

Development Server

Start the development server on http://localhost:3000

pnpm dev

Testing

The project uses Playwright for end-to-end testing with a separate test database.

Automated Test Suite

To run the full test suite (handles Docker container setup automatically):

pnpm test

Manual Test Setup (for debugging or VS Code Playwright extension)

For running tests manually, follow these steps in order:

  1. Start the test database:

    pnpm test:db
  2. Reset database and start the dev server on port 3001:

    pnpm test:dev

    This command automatically resets the test database before starting the server.

  3. Run tests (in VS Code Playwright extension or command line):

    pnpm playwright test
    # OR use the interactive UI
    pnpm playwright:ui

Other Test Commands

  • pnpm test:db:reset - Reset the test database
  • pnpm test:server - Preview production build with test database

About

Generate teams randomly based on rank. This is useful if you want to create lineups of balanced teams.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •