CROP

Parts Services

Microservices monorepo with 8 services for search, catalog, payment, media, delivery, and more.

Parts Services

Repository: CT-CROP/CROP-parts-services Last updated: 2026-02-26 Last synced to docs: 2026-03-10

Modern microservices architecture for the CROP platform, built with TypeScript, Hono, and deployed on Google Cloud Run.

Runtime: Bun 1.3.9 | Platform: GCP Cloud Run | API URL (stage): https://api.crop-dev.app

Quick Start

git clone <repository-url>
cd CROP-parts-services
bun install
bun run docker:up        # Start MongoDB + Elasticsearch
bun run dev              # Start all services
bun run dev search catalog  # Start specific services only

Services

ServicePortStatusDescription
cart3000DevelopmentShopping cart management
search3001ProductionElasticsearch parts search with autocomplete
media3002DevelopmentImage and file handling
payment3004DevelopmentStripe payment processing
user3005DevelopmentUser accounts and equipment (garage)
catalog3010DevelopmentProduct catalog management
analytics3020DevelopmentUsage analytics
health-analytics3021OperationalHealth monitoring, media coverage API

Project Structure

CROP-parts-services/
├── services/              # 8 microservices
│   ├── search/           # Elasticsearch-powered parts search
│   ├── catalog/          # Product catalog management
│   ├── cart/             # Shopping cart
│   ├── user/             # User accounts and garage
│   ├── payment/          # Stripe payments
│   ├── media/            # Image handling
│   ├── analytics/        # Usage analytics
│   └── health-analytics/ # Health monitoring
├── packages/              # 12 shared packages
│   ├── shared-types/     # TypeScript types and Zod schemas
│   ├── shared-auth/      # Authentication utilities
│   ├── shared-catalog/   # Catalog domain logic
│   ├── shared-hono/      # Hono middleware
│   ├── shared-db/        # MongoDB connection management
│   └── ...
├── scripts/               # Operational utilities
└── terraform/             # GCP infrastructure as code

Common Commands

# Development
bun install                     # Install all workspace dependencies
bun run dev                     # Start all services in dev mode
bun run build                   # Build all packages and services

# Testing
bun test                        # Run tests across monorepo
bun run test:coverage           # With coverage report

# Code Quality
bun run lint                    # Run Biome linter
bun run typecheck               # TypeScript type checking
bun run check:all               # Full validation (lint + checks + dead-code)

# Docker (Local Infrastructure)
bun run docker:up               # Start MongoDB + Elasticsearch + Kibana
bun run docker:down             # Stop local databases

# Stage VMs
bun run vm:health               # Check VM status + API health
bun run vm:up                   # Start ES + RabbitMQ VMs
bun run vm:down                 # Stop VMs (cost savings)

Health Endpoints

All services expose: GET /health, GET /health/ready, GET /health/live, GET /openapi.json, GET /docs (Swagger UI).

Tech Stack

  • Runtime: Bun 1.3.9
  • Framework: Hono (with OpenAPI/Zod integration)
  • Language: TypeScript 5.9 (strict mode)
  • Validation: Zod 4.x
  • Linting: Biome 2.x
  • Databases: MongoDB Atlas, Elasticsearch
  • Authentication: Clerk

On this page