Skip to Content
Get Started

Get Started

This guide walks you through setting up CardNexus for local development.

Start Infrastructure

Start the required services with Docker Compose:

docker compose up -d

This starts:

  • MongoDB (port 27017) - Database
  • LocalStack (port 4566) - AWS services (SQS, SNS, S3)
  • OpenSearch (port 9200) - Search engine

Make sure Docker is running before executing this command.

Set Up Environment Variables

Copy the example environment files:

# Backend cp apps/backend/.env.example apps/backend/.env.local # Frontend cp apps/frontend/.env.example apps/frontend/.env.local

Fill in the required values. Most defaults work for local development, but you’ll need:

  • Clerk keys for authentication
  • ImageKit keys for image handling (optional for basic dev)

Build the CLI

The CLI is used for importing game data:

pnpm build --filter=@repo/cli

Import Game Data

Import game data (cards, sets, expansions) for the games you want to work with:

# Import a specific game pnpm cdnx import game mtg pnpm cdnx import game pokemon pnpm cdnx import game lorcana

Processing time varies by game size:

  • Smaller games (Lorcana, Sorcery): A few minutes
  • Larger games (Magic: The Gathering): Up to half an hour

We recommend developing locally with smaller games like Lorcana or Sorcery for faster iteration.

Import Price Data (Optional)

For marketplace functionality, import price data:

pnpm cdnx import prices mtg

Start Development Servers

Use the start-dev.sh script to run the apps:

# Start both backend and frontend ./start-dev.sh --apps backend,frontend # Start backend only ./start-dev.sh --apps backend # Start with package watching (for working on shared packages) ./start-dev.sh --apps backend,frontend --packages api,db

The script automatically builds dependencies before starting.

AppURL
Frontendhttp://localhost:4200 
Backendhttp://localhost:3000 

Create Your Account

  1. Go to http://localhost:4200 
  2. Sign up with Clerk
  3. Complete the onboarding flow (select games you’re interested in)

Add Test Inventory (Optional)

Add cards to your inventory through the web interface:

  1. Go to your inventory page at /users/{username}/inventory
  2. Click “Add to inventory”
  3. Choose an import method:
    • Search: Find cards by name
    • Bulk import: Paste a list or upload CSV
    • Browse catalog: Browse and select cards

Quick Reference

CommandPurpose
docker compose up -dStart infrastructure
docker compose downStop infrastructure
./start-dev.sh --apps backend,frontendStart dev servers
pnpm cdnx import game <game>Import game data
pnpm cdnx import prices <game>Import price data
pnpm lintRun linter
pnpm typecheckRun type checking
pnpm testRun tests

See the CLI Documentation for all available commands.

Last updated on