Skip to content

Server app for CropDate, an agriculture app that provides updates on crop prices from wholesale markets in Trinidad and Tobago.

License

Notifications You must be signed in to change notification settings

GrandeMan/CropDate-server

Repository files navigation

CropDate-server

Server app for CropDate, an agriculture app that provides updates on crop prices from wholesale markets in Trinidad and Tobago.

cropdate-server-landing-page

Live Demo: server-demo-link


How it works

  • Cron job is run every morning, Monday to Friday.
  • App checks if the source data is updated or not
  • If updated, it fetches the data, parses it, and then updates the database. It also clears the cache
  • When the API is called the app caches the data and returns the value

Cron Job

cron-job-log

The source data is only updated on weekdays but sometimes skips days so there's a buffer between the job and the function to fetch the data. It checks if the date from the source data (which only changes when the data updates) and the current date align.

Database

I used PostgreSQL and Azure to create the database. I'm not familiar with the syntax so to avoid issues I used an ORM (Prisma). There was no particular reason for using these tools over anything else, I just used the most convenient and reliable tech.

Created Using

Express.js TypeScript Azure Prisma Postgres

About

Server app for CropDate, an agriculture app that provides updates on crop prices from wholesale markets in Trinidad and Tobago.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published