This guide covers running CubeCobra directly with Node.js, which requires manual installation of NodeJS and LocalStack, plus completing the initial setup steps.
- All general prerequisites
- Node.js 20+
- LocalStack
- AWS Local CLI
Node.js 20: https://nodejs.org/en/download/
LocalStack provides local emulation of AWS Services required by CubeCobra including S3, DynamoDB, Simple Email Service, and CloudWatch.
- Windows: Download and install the binary from LocalStack
- Mac:
brew install localstack/tap/localstack-cli - Linux: Use the
curlcommand from LocalStack
Follow the installation guidelines from the LocalStack site. The recommended setup involves running LocalStack in a Docker container, which requires Docker Desktop.
Start the server in the background: localstack start --detached
Check status: localstack status
Note: LocalStack community edition (without a pro account) does not persist data when the container is stopped.
The awslocal CLI is required for initial setup of LocalStack resources.
- Python 3.3+
- pip3
- Install Virtual Environment:
sudo apt-get install python3-venv - Navigate to CubeCobra directory:
cd /path/to/cubecobra - Create virtual environment:
python3 -m venv ./venv - Activate virtual environment:
source ./venv/bin/activate - Install awslocal:
pip3 install "awscli-local[ver1]" - Validate installation:
awslocal --version- Should print an "aws-cli" version (likely 1.X)
- Deactivate virtual environment:
deactivate
Add $(pwd)/venv/bin to your PATH so you can execute awslocal easily. Otherwise, run commands as ./venv/bin/awslocal ...
Run the complete setup process:
npm install && npm run build
npm run setup:localNote: This can take tens of minutes to complete.
- Install dependencies
- Create a
.envfile with values for running locally - Setup LocalStack with S3 bucket
- Setup local files for application persistence
- Setup LocalStack DynamoDB tables (Users, Cubes, Cards, etc.)
npm run download-data-files- Card definitions (~100MB): Complete Magic card database from Scryfall
- ML model files (~500MB): AI models for draft bots and recommendations
- Combo data: Card interaction and synergy information
- ✅ Safe to run - Downloads from a public S3 bucket (
cubecobra-public) - ✅ No AWS credentials required - Public bucket access only
- ✅ No LocalStack needed - Connects directly to AWS public infrastructure
- This step is only required once during initial setup
/packages/server/private/- Card definitions and metadata/packages/server/model/- ML model files for AI features
If you're on Windows, set bash as your script shell:
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"(Adjust the path to match your bash installation)
Start the development server:
npm run dev- Ensure Nearley parsers for card filters have compiled
- Compile & watch SCSS (Bootstrap) styles
- Compile & watch server JavaScript with nodemon
- Compile & recommeder service JavaScript with nodemon
- Run & watch webpack dev server
Connect to the app at: http://localhost:8080
(Despite logs showing port 5000, use port 8080 for the webpack dev server)
Nodemon will restart the application when source files change.
Follow the same registration process as the Docker setup.
If you're not using Docker and have LOCALSTACK_SES="true" in your .env file:
-
Verify email for SES:
./venv/bin/awslocal ses verify-email-identity --email 'support@cubecobra.com' -
Fetch emails from LocalStack:
curl --silent 'localhost.localstack.cloud:4566/_aws/ses?email=support@cubecobra.com' | jq .
- AWS Configuration - Connect to real AWS instead of LocalStack
- Updating Cards - Keep card data current