Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JaiderT/CoffeePrice/llms.txt

Use this file to discover all available pages before exploring further.

CoffePrice is a full-stack SaaS platform built to bring price transparency and market intelligence to Colombia’s coffee supply chain. It gives productores (farmers) real-time FNC reference prices, machine-learning–powered price predictions, weather context, and instant alerts — while giving compradores (buyers) a public directory and profile pages that make them discoverable. An admin layer keeps data quality high and the community safe. Whether you grow coffee in Huila or source it from across the Eje Cafetero, CoffePrice puts the information you need at your fingertips.

Architecture Overview

CoffePrice is organized into three independent tiers that communicate through well-defined interfaces.
┌─────────────────────────────────────────────────────────────┐
│                        Netlify CDN                          │
│          React 19 + Vite + Tailwind CSS (frontend/)         │
│   SPA served globally · auto-deploy on push to main        │
└────────────────────────┬────────────────────────────────────┘
                         │  HTTPS / REST + JWT cookie
┌────────────────────────▼────────────────────────────────────┐
│                    Railway (backend/)                        │
│         Express 5 · Mongoose · Passport · node-cron         │
│   PORT 8081 · MongoDB Atlas · cookie-based JWT + OAuth      │
└────────────────────────┬────────────────────────────────────┘
                         │  git push (commits updated artefacts)
┌────────────────────────▼────────────────────────────────────┐
│              GitHub Actions (ML pipeline)                    │
│   Prophet + XGBoost hybrid · Python 3.11 · runs Mon–Fri     │
│   20:15 UTC (3:15 pm Colombia) · writes to backend/datos/   │
└─────────────────────────────────────────────────────────────┘
TierTechnologyHosting
FrontendReact 19, Vite 5, Tailwind CSS 4, react-router-dom 7Netlify
BackendExpress 5, Mongoose 9, Passport, node-cron 4Railway
DatabaseMongoDB AtlasMongoDB Cloud
ML PipelinePython 3.11, Prophet, XGBoostGitHub Actions
The frontend talks exclusively to the backend via a single VITE_API_URL environment variable. The ML pipeline is fully headless — it runs on a schedule, commits refreshed prediction artefacts to the repo, and the Railway/Netlify auto-deploy picks up the changes automatically.

User Roles

CoffePrice has three distinct roles, each with its own dashboard and set of capabilities.

Productor (Farmer)

A productor registers with their farm details and immediately gains access to:
  • Live FNC reference prices updated daily by the price cron job
  • 30-day price predictions generated by the Prophet + XGBoost hybrid model
  • Personal price alerts (push + email) triggered when the FNC price crosses a threshold they configure
  • News feed curated from multiple Colombian coffee industry sources
  • Weather data relevant to their growing region
  • Access to the buyer map so they can identify local compradores

Comprador (Buyer)

A comprador creates a public profile that productores can browse. They also have access to:
  • Their own profile management page (/api/comprador)
  • Visibility on the interactive buyer map (Mapbox + MapTiler)
  • Price history and prediction data
  • Platform reviews from other users

Admin

An admin has elevated privileges across all platform sections:
  • Full user management (promote, suspend, delete)
  • Manual control over news curation and refresh cycles
  • Access to activity logs (/api/actividad)
  • Platform-wide configuration (/api/configuracion)
  • Ability to trigger and review ML prediction runs

Key Features

Real-Time Prices

Daily FNC reference prices fetched automatically by a node-cron job. Full historical price chart with data from /api/precios and /api/historial-precios.

ML Price Predictions

A Prophet + XGBoost hybrid model re-trains every weekday and writes the next business-day prediction to /api/predicciones. Confidence intervals included.

Buyer Map

Interactive Mapbox + MapTiler map surfacing registered compradores by region. Productores can filter by department and view buyer profiles in a sidebar.

Price Alerts

Productores set upper/lower price thresholds. The backend evaluates them on every price update and fires email + in-app notifications via /api/alertas.

News Feed

A multi-source news pipeline (NewsAPI, GNews, TheNewsAPI) curates Colombian coffee industry articles. The cron job runs deduplication, freshness scoring, and inventory management automatically.

AI Chatbot

An OpenAI-powered assistant available at /api/chatbot answers questions about prices, predictions, and market trends in natural language — in Spanish.

Tech Stack

LayerPackage / ServiceVersion
Frontend frameworkReact19.2
Build toolVite5.4
CSS frameworkTailwind CSS4.2
Routingreact-router-dom7.13
ChartsRecharts3.8
MapsMapbox GL JS + react-map-gl3.21 / 7.1
HTTP clientAxios1.15
Backend frameworkExpress5.2
ODMMongoose9.2
AuthPassport + passport-google-oauth200.7 / 2.0
JWTjsonwebtoken9.0
Schedulernode-cron4.2
EmailNodemailer8.0
AIOpenAI Node SDK6.34
ML — time seriesProphet
ML — boostingXGBoost
ML runtimePython3.11
CI/CDGitHub Actions
Backend hostingRailway
Frontend hostingNetlify
DatabaseMongoDB Atlas

Build docs developers (and LLMs) love