Skip to content

Getting Started

This guide will help you set up your development environment and start working with Syneo/Barcoding.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js >= 10 (recommended: 18 or 20 LTS)
  • Yarn 1.22.22 or later
  • MySQL server (for API database)
  • Git for version control

Installation

1. Clone the Repository

bash
git clone <repository-url>
cd workspace

2. Install API Dependencies

bash
cd api/b3api
npm install

3. Install Web Dependencies

bash
cd web
yarn install

4. Install Desktop Dependencies (Optional)

bash
cd desktop
npm install

Database Setup

MySQL Configuration

The development environment uses MySQL with these credentials:

json
{
  "host": "mysqldb",
  "port": 3306,
  "user": "root",
  "password": "Ypp01o#3",
  "database": "lb4"
}

WARNING

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

Run Migrations

bash
cd api/b3api
npm run migrate

Starting the Development Servers

Start the API

bash
cd api/b3api
npm run build
npm run start

The API will be available at:

  • API: http://localhost:3001
  • REST Explorer: http://localhost:3001/explorer

Start Web Applications

Open three separate terminals:

Backend App (Port 4200):

bash
cd web
yarn start-back

Front App (Port 4201):

bash
cd web
yarn start-front

Dashboard App (Port 4202):

bash
cd web
yarn start-dashboard

Verify Installation

  1. Check API: Visit http://localhost:3001/explorer to see the REST API explorer
  2. Check Backend: Visit http://localhost:4200 to see the Backend app
  3. Check Front: Visit http://localhost:4201 to see the Front app
  4. Check Dashboard: Visit http://localhost:4202 to see the Dashboard app

Development Workflow

Making Changes to the API

  1. Edit files in api/b3api/src/
  2. Rebuild: npm run build or use watch mode: npm run build:watch
  3. Restart the API: npm run start

Making Changes to Web Apps

  1. Edit files in web/projects/
  2. Changes will hot-reload automatically
  3. If you modify core packages, rebuild them: ng build @barcoding/<package-name>

Regenerating the SDK

After API changes that affect endpoints:

bash
cd web
yarn build-sdk

This regenerates the @barcoding/sdk package from the API's OpenAPI spec.

Common Issues

Port Already in Use

If you see "port already in use" errors:

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

Build Errors

If you encounter build errors:

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

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

# Reinstall dependencies
rm -rf node_modules && yarn install

Database Connection Issues

Ensure MySQL is running and accessible:

bash
mysql -h mysqldb -P 3306 -u root -pYpp01o#3 lb4 -e "SELECT 1;"

Next Steps

Syneo/Barcoding Documentation