Core data synchronization engine and high-performance backend monolith for the Marketplace Monitor Platform ecosystem. Engineered with Go 1.24, pgx/v5, scany, and PostgreSQL 16. Provides a concurrent, low-allocation, and low-latency REST API to aggregate and stream real-time orders, warehouse stock telemetry, and product catalog metadata from Ozon, Wildberries, and MoySklad.
- Runtime Environment — Go 1.24 or higher (Concurrent execution pools & lightweight routines)
- Database Driver — pgx/v5 (High-performance, low-allocation PostgreSQL driver & connection pool)
- Data Mapping — scany/v2 (Efficient database rows-to-struct scanning utility)
- Configuration — envconfig (Atomic environment variable parsing layout)
- Container Architecture — Docker / Docker Compose orchestration layers
- Ozon API Integration — Automated extraction of FBO/FBS orders and concurrent real-time FBO inventory availability datasets.
- Wildberries API Integration — Full pipeline synchronization mapping transactional order metrics, warehouse remnants, and product cards metadata.
- MoySklad Client Integration — Point-in-time enterprise warehouse inventory snapshots capturing raw product aggregate metrics.
- Transport API Layer — Optimized endpoints delivering complex multi-tenant filters, analytical summary aggregations, and highload daily charts datasets.
- Granular Execution Logging — Explicit metadata persistence tracking every single sync task lifecycle, including exact items count delta, state tracking, and duration parameters.
Clone the tracking branch context and navigate into the project workspace boundary:
git clone https://github.com/kazantsev-developer/marketplace-data-loader-backend.git
cd marketplace-data-loader-backendCompile both the headless REST API network server and the synchronization Command Line Interface (CLI) executable binaries:
go build -o bin/server ./cmd/server
go build -o bin/sync ./cmd/syncEnsure a local PostgreSQL instance is active, create the application ledger boundaries, and execute initial schema migrations:
createdb marketplace
psql -d marketplace -f migrations/001_init.up.sqlClone the baseline configuration variables schema layout file and insert functional merchant secret key parameters:
cp .env.example .env./bin/serverExecute an atomic data extraction job targeting specific merchant integration channels:
./bin/sync --entity=ozon_ordersSupported arguments for the deterministic --entity flag:
ozon_orders— Sync Ozon FBO/FBS sales recordsozon_stocks— Sync Ozon FBO inventory availabilitywb_orders— Sync Wildberries sales volume metricswb_remains— Sync Wildberries warehouse remnants trackingwb_cards— Sync Wildberries product card catalog contentms_stocks— Sync MoySklad inventory ledger parameters
To initialize stateless backend microservice nodes and database pooling topologies concurrently via Docker Compose:
docker compose up -d- GET
/api/ozon/orders— Fetches FBO/FBS orders incorporating filtering parameters and server pagination. - GET
/api/ozon/orders/stats— Aggregates real-time order statistics broken down by fulfillment scheme. - GET
/api/ozon/remains— Returns the current FBO stock inventory array list. - GET
/api/ozon/remains/stats— Provides top brand distribution stock volume analytics.
- GET
/api/wb/orders— Fetches sales logs with explicit date queries and page boundaries. - GET
/api/wb/orders/stats— Evaluates aggregated marketplace financial sales and volume analytics. - GET
/api/wb/remains— Returns inventory stock balances segmented across distributed physical warehouses. - GET
/api/wb/cards— Full-text searchable product catalog card index tracking pagination. - GET
/api/wb/cards/stats— Visual item distribution analytics mapping across catalog branches.
- GET
/api/moysklad/stocks— Provides inventory parameters cross-referenced by specific store and product keys. - GET
/api/moysklad/aggregates— Calculates deep enterprise structural product aggregates. - GET
/api/moysklad/stores— Lists all registered active system warehouses.
- GET
/api/health— Probes core microservice Liveness/Readiness lifecycle state. - GET
/api/sync/logs— Comprehensive historical analytics audit database for cron data jobs. - GET
/api/dashboard/stats— Compiles global consolidated summary index values for the root UI view. - GET
/api/charts/orders-daily— Daily analytical time-series logs tracking Wildberries sales volume. - GET
/api/charts/ozon-orders-daily— Daily analytical time-series logs tracking Ozon sales volume.
Variables must be strictly populated inside the local .env configuration context file following this schema definition:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=marketplace
DB_USER=postgres
DB_PASSWORD=postgres
DB_SSLMODE=disable
DB_POOL_MAX=20
OZON_CLIENT_ID=your_client_id
OZON_API_KEY=your_api_key
WB_API_TOKEN=your_wb_token
MS_TOKEN=your_moysklad_token
PORT=3000
APP_ENV=developmentFor scalable environment provisioning layout operations, inspect the standalone architectural guidelines file deploy.md. This contains native instructions for mounting Linux systemd service abstractions and automation via systemd.timer job triggers.