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 onlyServices
| Service | Port | Status | Description |
|---|---|---|---|
| cart | 3000 | Development | Shopping cart management |
| search | 3001 | Production | Elasticsearch parts search with autocomplete |
| media | 3002 | Development | Image and file handling |
| payment | 3004 | Development | Stripe payment processing |
| user | 3005 | Development | User accounts and equipment (garage) |
| catalog | 3010 | Development | Product catalog management |
| analytics | 3020 | Development | Usage analytics |
| health-analytics | 3021 | Operational | Health 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 codeCommon 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
Related Documentation
- Microservices Architecture — system architecture and service topology
- Service Standards — project structure conventions
- Deployment Overview — deployment process