An intelligent marketplace platform designed for Thailand, connecting locals and foreigners to buy, sell, rent, and offer services. Supporting English and Thai as primary languages across web and Telegram platforms.
Farang Marketplace serves as a premium marketplace solution specifically designed for the Thai market, offering:
- Universal Marketplace: Buy, sell, rent anything - properties, vehicles, equipment, services, and more
- Dual Primary Languages: English and Thai (ไทย) as main languages, with additional support for Russian (Русский), Chinese (中文), and Arabic (العربية)
- Integrated CRM: Multi-channel communication (Email, Telegram, WhatsApp), automated follow-ups, and customer relationship management
- Multi-Platform: Responsive web application and Telegram bot/mini app
- Thailand-Focused: Localized for Thai market with local payment methods, regulations, and cultural preferences
- Premium Positioning: International branding that appeals to quality-conscious Thai and foreign users
- Smart Search: Search with filters by category, location, price in English and Thai
- Multi-language Support: Full functionality in English, Thai, and other supported languages
- Listing Management: Create, edit, and manage listings with image uploads
- Multi-Channel Messaging: Integrated Email, Telegram, and WhatsApp communication
- Automated Follow-ups: Smart reminders and nurturing sequences for leads
- Customer Relationship Management: Track interactions, preferences, and transaction history
- Lead Warming: Automated engagement campaigns to convert prospects
- Communication Hub: Centralized inbox for all customer communications across channels
- Real Estate: Houses, apartments, condos, land, commercial spaces
- Vehicles: Cars, motorcycles, boats, trucks, bicycles
- Services: Professional services, home services, tutoring, consulting
- Equipment: Electronics, tools, furniture, appliances
- Jobs: Job postings and freelance opportunities
- Events: Event planning, venue rentals, entertainment services
- Thai Baht (฿): Primary currency with automatic conversion
- Thai Address System: Proper Thai address formatting and validation
- Local Payment Methods: PromptPay, Thai bank transfers, cash on delivery
- Thai Regulations: Compliance with Thai e-commerce and rental laws
- Cultural Adaptation: Interface and features adapted for both Thai and international users
- Premium Appeal: International design standards that convey quality and trust
- Thai Locals: Looking for premium marketplace experience with international quality standards
- Expats & Foreigners: Living in Thailand and needing reliable marketplace services
- Thai Businesses: Wanting to reach both local and international customers
- Tourists: Short-term visitors needing rentals and services
- Premium Quality: International branding that signals higher quality and reliability
- Bilingual Focus: Equal emphasis on English and Thai to serve diverse user base
- Trust & Safety: Enhanced verification and quality controls
- Professional Services: Emphasis on business and professional service providers
This is a monorepo containing:
- Web Application (
apps/web) - Main web interface - Admin Panel (
apps/admin) - Administrative interface - TON App (
apps/ton-app) - TON wallet integration - Telegram Bot - Telegram bot for notifications and basic operations
- API Gateway (
services/api-gateway) - Main API entry point - User Service (
services/user-service) - User management and authentication - Listing Service (
services/listing-service) - Marketplace listings management - Booking Service (
services/booking-service) - Booking and reservations - Payment Service (
services/payment-service) - Payment processing (TON, Stripe, PromptPay) - CRM Service (
services/crm-service) - Customer relationship management and multi-channel communication - Shared Packages (
packages/) - Logger, shared types, i18n, database schema
- Build Tool: Vite + Bun
- Frontend: React 18 + TypeScript
- Backend: Node.js + Fastify microservices
- Database: PostgreSQL (Drizzle ORM) + Redis
- File Storage: MinIO (S3-compatible)
- Payments: TON blockchain, Stripe, PromptPay
- Communication: Telegram Bot API, WhatsApp Business API, Nodemailer
- Telegram: Telegram Bot + Mini App integration
- Logging: Pino
- Internationalization: i18next for multi-language support
- Monorepo: Turborepo for task orchestration
- Node.js 20+
- Bun (recommended) or npm
- Docker & Docker Compose (optional, for local database)
-
Clone the repository:
git clone [email protected]:chatman-media/farang-marketplace.git cd farang-marketplace
-
Install dependencies:
bun install
-
Copy environment variables for each service:
# Copy and configure .env files in each service directory # See services/*/.env for configuration
-
Start all services with Turbo UI:
bun run dev:ui
This will start:
- Web app: http://localhost:5173
- Admin panel: http://localhost:5174
- API Gateway: http://localhost:3000
- User Service: http://localhost:3001
- Listing Service: http://localhost:3003
- Booking Service: http://localhost:3004
- Payment Service: http://localhost:3009
- CRM Service: http://localhost:3007
bun run dev- Start all services in development modebun run dev:ui- Start all services with Turbo UI panelbun run build- Build all applications for productionbun run test- Run tests across all packagesbun run lint- Lint all code with Biomebun run lint:fix- Fix linting issues automatically
PostgreSQL with Drizzle ORM. Each service manages its own database connection.
Option 1: Local Development with Docker ⭐ Recommended
Important: Stop any local PostgreSQL instance first to avoid port conflicts:
brew services stop postgresql@14 # macOS
# or
sudo systemctl stop postgresql # LinuxStart PostgreSQL and Redis with Docker Compose:
docker-compose up -d postgres redisConfigure DATABASE_URL in each service's .env file:
DATABASE_URL=postgresql://marketplace_user:marketplace_pass@localhost:5432/marketplace
All .env.test files are already configured for Docker PostgreSQL.
Option 2: Cloud Database (for testing/production)
Configure cloud PostgreSQL (e.g., Neon, Supabase, AWS RDS):
DATABASE_URL=postgresql://user:password@host:5432/dbname?sslmode=require
Note: Integration tests use Neon PostgreSQL cloud database for CI/CD compatibility.
Payment Service uses Redis for job queues (BullMQ) to process background tasks like:
- Transaction monitoring
- Exchange rate updates
- Payment lifecycle management
Option 1: Local Development with Docker
docker-compose up -d redisOption 2: Local Redis (without Docker)
# macOS
brew install redis
brew services start redis
# Ubuntu/Debian
sudo apt-get install redis-server
sudo systemctl start redisConfigure in services/payment-service/.env:
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
MinIO (S3-compatible) for image and file uploads.
Configure in service .env:
MINIO_ENDPOINT=http://localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin123
├── apps/
│ ├── web/ # Main web application
│ ├── admin/ # Admin panel
│ └── ton-app/ # TON wallet integration
├── services/
│ ├── api-gateway/ # Main API gateway
│ ├── user-service/ # User management and authentication
│ ├── listing-service/ # Marketplace listings
│ ├── booking-service/ # Booking and reservations
│ ├── payment-service/ # Payment processing
│ └── crm-service/ # CRM and multi-channel communication
├── packages/
│ ├── shared-types/ # Shared TypeScript types
│ ├── database-schema/ # Drizzle schema
│ ├── logger/ # Pino logger
│ └── i18n/ # Internationalization
└── telegram/ # Telegram bot and mini app (planned)
- Listing notifications and alerts
- Booking confirmations
- Payment status updates
- Direct communication with sellers
- Browse marketplace within Telegram
- Create and manage listings
- Process payments via TON
- Chat with buyers/sellers
- English - Primary international language
- Thai (ไทย) - Primary local language
- Russian (Русский) - Russian expat community
- Chinese (中文) - Chinese tourist and business community
- Arabic (العربية) - Middle Eastern community
- Complete UI translation for all languages
- Right-to-left (RTL) support for Arabic
- Currency and number formatting per locale
- Date and time formatting per locale
- Voice recognition in all supported languages
- Bilingual content management system
- International Appeal: "Farang" (foreigner) suggests international quality standards
- Local Recognition: Term familiar to Thai users, implying premium foreign service
- Quality Perception: International branding often perceived as higher quality in Thai market
- Inclusive Branding: Appeals to both locals seeking premium experience and foreigners needing familiar interface
- Premium Positioning: Higher quality standards and verification processes
- Bilingual Excellence: Equal focus on English and Thai user experience
- Trust Building: Enhanced security, verification, and customer service
- Professional Focus: Emphasis on business services and professional providers
- Shared types defined in
packages/shared-types - Database schema in
packages/database-schema(Drizzle ORM) - Centralized logging with
packages/logger(Pino) - Internationalization in
packages/i18n - Each service independently deployable
- Turborepo orchestrates monorepo tasks
- Telegram bot integrates with all services for notifications
This setup provides the foundation for:
- Bilingual marketplace functionality (English/Thai primary)
- Thailand-specific localization with international appeal
- Scalable microservices architecture
- Web application and Telegram bot integration
- Integrated payment systems (TON, Stripe, PromptPay)
- Multi-channel CRM with automated customer engagement
- Telegram Mini App for in-app marketplace experience
- Premium user experience and trust features