Setup
Pre-requisites
- Docker Desktop: Ensure Docker Desktop is installed and running.
- 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
- Clone the repository:
git clone git@github.com:dream-sports-labs/checkmate.git
- Install dependencies
yarn install
- Create .env file,
- Copy the .env.example file and rename it to .env. Update it with your specific environment variables.
- 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..
- Start the application in development mode:
yarn dev
- App will be started on http://localhost:3000
Docker Setup
- Clone the repository:
git clone git@github.com:dream-sports-labs/checkmate.git
- Create an environment file:
- Ensure you have a .env file in place, based on .env.example.
- Install dependencies
yarn install
- Set up the application and database:
yarn docker:setup
- Create both the application and database containers using Docker.
- Seed the database with initial data.
- App will be started on http://localhost:3000
Developer Scripts
- 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.
- 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.
- 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
- Create the database and seed data from
- Monitor the database with Drizzle Studio:
- Use the Drizzle Studio tool to explore and manage the database.
yarn db:studio - 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.