Skip to main content

Welcome to Horse Trust

Horse Trust is a modern web application designed to revolutionize the horse marketplace by providing a secure, transparent platform for buying and selling horses. Built with cutting-edge technologies, the platform ensures trust and authenticity in every transaction.

What is Horse Trust?

Horse Trust is a full-stack web application that connects horse sellers with potential buyers while maintaining high security standards and user verification. The platform features:

Secure Authentication

JWT-based authentication with bcrypt password hashing and role-based access control

Real-time Chat

Socket.io powered messaging system for direct communication between buyers and sellers

Verified Sellers

Identity verification system with document validation and selfie confirmation

Rich Media Listings

Support for multiple photos, videos with automatic YouTube/Vimeo embedding, and detailed horse information

Key Features

For Sellers

  • Horse Registration: Create detailed listings with breed, age, discipline, pedigree, and location
  • Media Management: Upload minimum 3 photos (with cover image selection) and training/competition videos
  • Veterinary Records: Attach and manage veterinary documents and health records
  • Seller Verification: Complete identity verification to earn verified seller badges
  • Real-time Messaging: Communicate directly with interested buyers

For Buyers

  • Advanced Search: Filter horses by breed, discipline, location, and price range
  • Full-text Search: Find horses using natural language queries in Spanish
  • Secure Messaging: Chat with sellers in real-time with typing indicators
  • Detailed Listings: View comprehensive information including photos, videos, and location data

For Administrators

  • Seller Verification: Review and approve seller identity documents
  • Content Moderation: Manage listings and ensure platform quality
  • User Management: Control user accounts and access levels

Technology Stack

Horse Trust is built as a modern monorepo with separate client and server applications.

Frontend

  • Next.js 16 with React 19 for server-side rendering
  • TypeScript for type safety
  • Tailwind CSS 4 for modern styling
  • Lucide React for icons

Backend

  • Express.js 5 for RESTful API
  • Socket.io 4.8 for real-time WebSocket communication
  • MongoDB with Mongoose ODM
  • JWT for authentication
  • bcrypt for password hashing
  • Helmet and rate limiting for security

Infrastructure

  • Node.js 24.13.0 runtime
  • TypeScript across the stack
  • Git for version control

Platform Architecture

The platform follows a clean separation of concerns:
// Server-side API structure
app.use("/api/auth", authLimiter, authRoutes);    // Authentication endpoints
app.use("/api/horses", horseRoutes);              // Horse CRUD operations
app.use("/api/admin", adminRoutes);               // Admin panel
app.use("/api/chat", chatRoutes);                 // Chat/messaging
app.use("/health/db", databaseRoutes);            // Database health checks
// Client-side Next.js App Router structure
/app
  /page.tsx                    // Landing page
  /login/page.tsx              // Login page
  /registro/page.tsx           // Registration
  /dashboard/page.tsx          // User dashboard
  /marketplace/page.tsx        // Horse listings
  /marketplace/[id]/page.tsx   // Individual horse details
  /registro-caballo/page.tsx   // Horse registration form

Security Features

Rate Limiting

Global rate limiting (100 req/15min) and strict auth rate limiting (10 req/15min)

CORS Protection

Configurable CORS with credential support and origin validation

Helmet Security

HTTP security headers to prevent common vulnerabilities

JWT Tokens

Secure token-based authentication with 10-day expiration

Database Models

The platform uses MongoDB with three primary models:

User Model

  • Email/password authentication with bcrypt hashing
  • Role-based access (admin/seller)
  • Profile information and verification status
  • Seller profile with identity documents

Horse Model

  • Comprehensive horse information (name, age, breed, discipline, pedigree)
  • Location data with coordinates
  • Photo array (minimum 3 required) with cover image support
  • Video array with automatic embed URL generation
  • Status management (active, sold, paused, draft)
  • Full-text search indexing

Veterinary Records

  • Conversation management for vet consultations
  • Message threading with read status
  • Document attachments

Getting Started

Ready to dive in? Head over to the Quickstart Guide to set up your development environment and run the Horse Trust platform locally. For a deeper understanding of the system architecture, check out the Architecture Documentation.

Quickstart Guide

Get up and running with Horse Trust in minutes

Build docs developers (and LLMs) love