Skip to content

Setup

Pre-requisites

  1. Docker Desktop: Ensure Docker Desktop is installed and running.
  2. Google OAuth Application: Set up a Google OAuth application to enable login.
    • Follow the steps on the Google documentation to create a new application and get a client ID and secret.

Local Dev Setup

  1. Clone the repository:
    git clone git@github.com:dream-sports-labs/checkmate.git
  2. Install dependencies
    yarn install
  3. Create .env file,
    • Copy the .env.example file and rename it to .env. Update it with your specific environment variables.
  4. Set up the database and seed data:
    yarn docker:db:setup
    • Create a database container using Docker.
    • Seed the database with initial data from the seedData.sql file..
  5. Start the application in development mode:
    yarn dev
  6. App will be started on http://localhost:3000

Docker Setup

  1. Clone the repository:
    git clone git@github.com:dream-sports-labs/checkmate.git
  2. Create an environment file:
    • Ensure you have a .env file in place, based on .env.example.
  3. Install dependencies
    yarn install
  4. Set up the application and database:
    yarn docker:setup
    • Create both the application and database containers using Docker.
    • Seed the database with initial data.
  5. App will be started on http://localhost:3000

Developer Scripts

  1. Set up the application in Docker with an existing database:
    yarn docker:app:setup
    • Use this script to replicate production-like behavior in Docker while reusing an existing database container.
    • If a database container does not already exist, this script will create one and seed data from seedData.sql file.
  2. Apply schema changes to the database:
    yarn dev:db:setup
    • Create a database container in Docker (if one doesn’t exist).
    • Generate the updated schema in the drizzle folder.
    • Apply the schema to the database.
    • Seed data from the app/db/seed folder.
  3. Manage the Checkmate database:
    • Create the database and seed data from seedData.sql file::
      yarn docker:db:setup
    • Insert seed data from seed folder:
      yarn db:init
  4. Monitor the database with Drizzle Studio:
    • Use the Drizzle Studio tool to explore and manage the database.
    yarn db:studio
  5. Generate SQL from the Drizzle schema:
    • To export the database schema as an SQL file:
    yarn db:generate
    • The generated SQL file will be saved in the drizzle folder at the project root.