Skip to main content

Getting Started

This guide will help you set up the Cracker development environment on your local machine.

Prerequisites

Ensure you have the following installed before proceeding:

  • Node.js (v18+ recommended)
  • Yarn (or npm)
  • Docker & Docker Compose (Required for backend services)

Installation & Setup

Follow these steps to get the application running:

1. Install Dependencies

Navigate to the project root and install the required packages:

yarn install

2. Start Backend Infrastructure

Spin up the required backend services (PostgreSQL, MongoDB, Redis) using Docker Compose. This command also starts the admin tools (pgAdmin and Mongo Express).

yarn start:server

Note: Ensure Docker Desktop (or the Docker daemon) is running before executing this command.

3. Start Development Server

Launch the Next.js development server:

yarn dev

You can now access the application at http://localhost:3000.

4. Generate GraphQL Types

Cracker uses graphql-codegen to generate TypeScript types from the GraphQL schema. Since the codegen process introspects the running GraphQL endpoint, the development server must be running (Step 3) for this to work.

In a separate terminal window, run:

yarn codegen

Key Commands

Here are the most common commands you'll use during development:

CommandDescription
yarn devStarts the Next.js development server.
yarn buildBuilds the application for production.
yarn start:serverStarts backend services (DBs, Cache) via Docker Compose.
yarn codegenGenerates GraphQL types based on schema and operations.
yarn lintRuns ESLint.
yarn it:dbAccess the running PostgreSQL container shell.
yarn it:cacheAccess the running Redis CLI.