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 -dThis 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.localFill 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/cliImport 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 lorcanaProcessing 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 mtgStart 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,dbThe script automatically builds dependencies before starting.
| App | URL |
|---|---|
| Frontend | http://localhost:4200Â |
| Backend | http://localhost:3000Â |
Create Your Account
- Go to http://localhost:4200Â
- Sign up with Clerk
- Complete the onboarding flow (select games you’re interested in)
Add Test Inventory (Optional)
Add cards to your inventory through the web interface:
- Go to your inventory page at
/users/{username}/inventory - Click “Add to inventory”
- 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
| Command | Purpose |
|---|---|
docker compose up -d | Start infrastructure |
docker compose down | Stop infrastructure |
./start-dev.sh --apps backend,frontend | Start dev servers |
pnpm cdnx import game <game> | Import game data |
pnpm cdnx import prices <game> | Import price data |
pnpm lint | Run linter |
pnpm typecheck | Run type checking |
pnpm test | Run tests |
See the CLI Documentation for all available commands.