Compare commits

2 Commits

Author SHA1 Message Date
c851a26beb Add analytics endpoint, price history API, and fix daysAvailable calculation
- Fix daysAvailable to detect gaps >25 days (indicates unit was re-listed)
- Add /unit/:unitCode/price-history endpoint for full price history
- Add /analytics endpoint with monthly trends, seasonality analysis,
  plan performance, historical comparisons, and price per sqft stats
- Add /last-scrape endpoint to return timestamp of most recent data
- Increase priceHistory limit from 5 to 30 for better chart data
2026-01-21 10:10:39 -07:00
e9b4528dc5 Fix network and /api endpoint 2025-07-16 10:42:14 -06:00
3 changed files with 1160 additions and 14 deletions

View File

@ -3,6 +3,9 @@ FROM node:18-alpine
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
# Install Curl
RUN apk add --no-cache curl
# Copy package files # Copy package files
COPY package*.json ./ COPY package*.json ./

View File

@ -9,8 +9,10 @@ services:
- MONGO_URI=mongodb://admin:password123@mongodb:27017 - MONGO_URI=mongodb://admin:password123@mongodb:27017
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.apartment-api.rule=Host(`apartments.maverickapplications.com`) && PathPrefix(`/api`)" - "traefik.http.routers.apartment-api.rule=Host(`apartments.maverickapplications.com`) && PathPrefix(`/api`)"
- "traefik.http.routers.apartment-api.entrypoints=websecure" - "traefik.http.routers.apartment-api.entrypoints=websecure"
- "traefik.http.routers.apartment-api.tls=true"
- "traefik.http.routers.apartment-api.tls.certresolver=letsencrypt" - "traefik.http.routers.apartment-api.tls.certresolver=letsencrypt"
- "traefik.http.routers.apartment-api.priority=100" - "traefik.http.routers.apartment-api.priority=100"
- "traefik.http.services.apartment-api.loadbalancer.server.port=8080" # Updated to match - "traefik.http.services.apartment-api.loadbalancer.server.port=8080" # Updated to match

1169
server.js

File diff suppressed because it is too large Load Diff