Skip to content

Development Commands

This page lists all available commands for working with Syneo/Barcoding.

API Commands

Navigate to api/b3api first:

bash
cd api/b3api

Building

bash
# Compile TypeScript
npm run build

# Watch mode compilation
npm run build:watch

Running

bash
# Start API with debugger (port 3001)
npm run start

# Start with nodemon and watch mode
npm run run:dev

Testing

bash
# Run all tests (requires build first)
npm run test

# Run ESLint
npm run lint

# Fix ESLint issues
npm run lint:fix

Database

bash
# Run database migrations
npm run migrate

# Alternative migration command
node ./dist/migrate

# Create new migration
npx knex migrate:make <migration_name>

Web Commands

Navigate to web first:

bash
cd web

Development Servers

bash
# Backend app on port 4200
yarn start-back

# Frontend app on port 4201
yarn start-front

# Dashboard app on port 4202
yarn start-dashboard

Production Builds

bash
# Build all apps for production
yarn build

# Build individual apps
yarn build:back:prod      # Backend only
yarn build:front:prod     # Frontend only
yarn build:dash:prod      # Dashboard only

Serve Production Builds

bash
# Serve production builds locally
yarn start:back:prod      # http://localhost:4200
yarn start:front:prod     # http://localhost:4201
yarn start:dash:prod      # http://localhost:4202

SDK Generation

bash
# Generate @barcoding/sdk from API OpenAPI spec
yarn build-sdk

# Requires API to be running on port 3000

Testing

Unit Tests (Jest)

bash
# Run all unit tests
yarn test                 # All tests once
yarn test:watch           # Watch mode
yarn test:coverage        # With coverage report

# Test specific packages
yarn test:unit            # All core packages
yarn test:unit:core       # @barcoding/core only
yarn test:unit:gridster-core
yarn test:unit:backend-core
yarn test:unit:frontend-core
yarn test:unit:auth-core
yarn test:unit:dashboard-core

# Test applications
yarn test:unit:backend-app
yarn test:unit:front-app
yarn test:unit:dashboard-app

# Run specific test file
yarn test <filename>      # e.g., yarn test helper.service.spec.ts

E2E Tests (Playwright)

bash
# Run all e2e tests
yarn test:e2e             # Headless
yarn test:e2e:headed      # With browser UI
yarn test:e2e:debug       # Debug mode

# Test specific apps
yarn test:e2e:backend
yarn test:e2e:front
yarn test:e2e:dashboard

# Test specific browsers
yarn test:e2e:chromium
yarn test:e2e:firefox
yarn test:e2e:webkit

# View reports
yarn test:e2e:report

CI Testing

bash
# Runs Jest + Playwright optimized for CI
yarn test:ci

# Runs all tests (unit + e2e)
yarn test:all

Linting

bash
# Run ESLint on all projects
yarn lint

# Angular CLI lint
ng lint

Building Packages

bash
# Build specific package
ng build @barcoding/<package-name>

# Examples:
ng build @barcoding/core
ng build @barcoding/sdk
ng build @barcoding/auth-core
ng build @barcoding/gridster-core
ng build @barcoding/module-ticket
ng build @barcoding/widget-calendar

Build Order for Dependencies

When building from scratch, follow this order:

bash
# 1. Core packages first
ng build @barcoding/sdk
ng build @barcoding/core
ng build @barcoding/auth-core
ng build @barcoding/gridster-core

# 2. App-specific cores
ng build @barcoding/backend-core
ng build @barcoding/frontend-core
ng build @barcoding/dashboard-core

# 3. Modules and widgets (can be parallel)
ng build @barcoding/module-<name>
ng build @barcoding/widget-<name>

# 4. Applications
yarn build:back:prod
yarn build:front:prod
yarn build:dash:prod

Desktop Commands

Navigate to desktop first:

bash
cd desktop

Development

bash
# Run in development mode
npm run electron:serve

# Run local build
npm run electron:local

Building

bash
# Build desktop app (no publish)
npm run electron:build

Database Commands

MySQL Access

bash
# Connect to MySQL
mysql -h mysqldb -P 3306 -u root -pYpp01o#3 lb4

# Or if running locally/in container
mysql -h localhost -P 3306 -u root -pYpp01o#3 lb4

# Example queries
mysql -h mysqldb -u root -pYpp01o#3 lb4 -e "SHOW TABLES;"
mysql -h mysqldb -u root -pYpp01o#3 lb4 -e "SELECT * FROM users LIMIT 10;"

WARNING

These credentials are for development only. Never use in production.

Utility Commands

Clean Build Artifacts

bash
# Clear Angular cache
rm -rf web/.cache

# Clear Jest cache
cd web && yarn jest --clearCache

# Reinstall dependencies
rm -rf node_modules && yarn install

Port Management

bash
# Find and kill process using a port
lsof -ti:4200 | xargs kill -9  # For port 4200
lsof -ti:3001 | xargs kill -9  # For port 3001

Check Package Dependencies

bash
# List dependencies for a package
cd web/projects/packages/@barcoding/<package-name>
cat package.json | grep -A 20 '"dependencies"'

Git Commands

bash
# Check status
git status

# View recent commits
git log --oneline -10

# View current branch
git branch --show-current

Documentation Commands

Navigate to docs_v2 first:

bash
cd docs_v2

Development

bash
# Start dev server
npm run docs:dev

# Build documentation
npm run docs:build

# Preview production build
npm run docs:preview

Next Steps

Syneo/Barcoding Documentation