Skip to main content

Overview

Voxora provides npm scripts for development, building, testing, and deployment. All scripts can be run from the root directory.

Development Scripts

dev

Start all development servers (requires Docker to be started separately):
npm run dev
What it does:
  • Starts Next.js web app on port 3000
  • Starts Express API server on port 3002
  • Enables hot reload for both apps
  • Uses Turborepo for parallel execution

dev:full

Start Docker services and all development servers:
npm run dev:full
What it does:
  • Starts Docker services (MongoDB, Redis, etc.)
  • Starts all development servers
  • One command for complete setup

dev (workspace-specific)

Start individual workspace in development mode:
npm run dev -w apps/web

Docker Scripts

docker:start

Start all Docker services in detached mode:
npm run docker:start
Services started:
  • MongoDB on port 27017
  • Redis on port 6379
  • Mongo Express on port 8081
  • MailHog on ports 1025 (SMTP) and 8025 (UI)

docker:stop

Stop and remove all Docker containers:
npm run docker:stop
Containers are removed but volumes are preserved. Use docker:clean to remove volumes.

docker:clean

Stop containers and remove all volumes (data loss):
npm run docker:clean
# or
docker-compose -f docker/docker-compose.dev.yml down -v

docker:logs

View logs from Docker services:
docker-compose -f docker/docker-compose.dev.yml logs -f

Build Scripts

build

Build all applications for production:
npm run build
What it does:
  • Builds Next.js app (creates .next directory)
  • Transpiles API code (if using TypeScript)
  • Generates optimized production bundles

build (workspace-specific)

Build individual workspace:
npm run build -w apps/web

Testing Scripts

test

Run all tests across workspaces:
npm run test

test:watch

Run tests in watch mode:
npm run test:watch

test:coverage

Generate test coverage report:
npm run test:coverage
Output:
  • Coverage report in coverage/ directory
  • HTML report at coverage/lcov-report/index.html

test (workspace-specific)

npm run test -w apps/web

Code Quality Scripts

lint

Run ESLint on all workspaces:
npm run lint
Checks:
  • JavaScript/TypeScript syntax errors
  • Code style violations
  • Best practice violations

lint:fix

Automatically fix linting issues:
npm run lint:fix

format

Format code with Prettier:
npm run format
Formats:
  • JavaScript/TypeScript files
  • JSON files
  • Markdown files
  • CSS files

format:check

Check if files are formatted correctly:
npm run format:check

Dependency Management

install

Install all dependencies:
npm install

update

Update dependencies to latest versions:
npm update

outdated

Check for outdated dependencies:
npm outdated

audit

Check for security vulnerabilities:
npm audit

# Auto-fix vulnerabilities
npm audit fix

Cleanup Scripts

clean

Remove build artifacts and dependencies:
npm run clean
Removes:
  • node_modules directories
  • .next directory
  • dist directories
  • Build caches

clean:full

Complete cleanup including Docker volumes:
npm run clean:full
This removes all data from Docker containers!

Database Scripts

db:seed

Seed database with sample data:
npm run db:seed -w apps/api

db:reset

Reset database to initial state:
npm run db:reset -w apps/api

db:migrate

Run database migrations:
npm run db:migrate -w apps/api

Production Scripts

start

Start production servers:
npm run start
Must run npm run build before npm run start

Utility Scripts

type-check

Run TypeScript type checking:
npm run type-check

validate

Run all validation checks:
npm run validate
Runs:
  • Type checking
  • Linting
  • Tests
  • Format check

Custom Makefile Commands

The Makefile provides additional convenience commands:

Setup

make setup
Equivalent to:
  • npm install
  • npm run docker:start
  • Copy environment files

Dev

make dev
Equivalent to npm run dev:full

Reset

make reset
Complete reset:
  • Stop Docker
  • Clean all files
  • Reinstall dependencies
  • Restart services

Turborepo Scripts

Voxora uses Turborepo for efficient monorepo management.

Run with filtering

npx turbo run build --filter=apps/web

Clear Turbo cache

npx turbo run build --force --no-cache

Git Hooks

Pre-commit hooks run automatically:

Pre-commit

Runs on git commit:
  • Lint staged files
  • Format staged files
  • Run type check

Pre-push

Runs on git push:
  • Run all tests
  • Check for build errors

CI/CD Scripts

Scripts used in GitHub Actions:

ci

Run CI validation:
npm run ci
Runs:
  • Install dependencies
  • Type check
  • Lint
  • Test
  • Build

deploy

Deploy to production:
npm run deploy

Environment-Specific Scripts

dev:https

Run development server with HTTPS:
npm run dev:https -w apps/web

debug

Start in debug mode:
npm run debug -w apps/api
Starts server with debugger attached on port 9229.

Script Chaining

Run multiple scripts in sequence:
# Clean, install, and start
npm run clean && npm install && npm run dev

# Build and start
npm run build && npm run start

# Lint, test, and build
npm run lint && npm run test && npm run build

Workspace-Specific Scripts

Each workspace may have additional scripts. Check package.json in:
  • apps/web/package.json
  • apps/api/package.json
  • packages/*/package.json

Quick Reference Table

ScriptDescriptionWhen to Use
npm run devStart dev serversDaily development
npm run dev:fullStart Docker + dev serversFirst time setup
npm run buildBuild for productionBefore deployment
npm run testRun testsBefore committing
npm run lintCheck code qualityBefore committing
npm run formatFormat codeAfter writing code
npm run docker:startStart servicesWhen services stopped
npm run docker:stopStop servicesEnd of day
npm run cleanClean buildsTroubleshooting

Next Steps

Development Setup

Complete development guide

Docker Services

Managing Docker services

Contributing

How to contribute

Deployment

Deploy to production