Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/aakash811/Student-Progress-Tracker/llms.txt

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

SkillSync exposes a set of system-level endpoints for scheduled background jobs and health monitoring. The sync endpoints drive the nightly Codeforces data pipeline; the ping and health endpoints keep the Render free-tier instance warm and allow uptime monitors to detect downtime.

POST /cron/sync

Triggers the full Codeforces sync pipeline. This endpoint is designed to be called by an external scheduler such as cron-job.org on a daily basis.
x-cron-secret
string
required
Must match the CRON_SECRET environment variable set on your backend. Requests that omit or supply an incorrect value receive a 401 Unauthorized response.
What it does When called with a valid secret, the endpoint immediately returns a 202-style 200 response and then asynchronously runs runCodeforcesSync(), which:
  1. Iterates every student document in MongoDB.
  2. Invalidates each student’s Upstash Redis cache entry so fresh data is fetched.
  3. Pulls the latest info, contest history, and submissions from the Codeforces API in parallel.
  4. Writes updated ratings, rank, and submission history back to MongoDB.
  5. Sends a one-time inactivity reminder email to any student who has been inactive for 7 or more days and has not yet received a reminder in the current inactive streak.
  6. Resets the emailRemindersSent counter for students who have become active again.
Response
{
  "message": "Sync started",
  "time": "2026-05-07T02:00:00.000Z"
}
The response is sent before the sync completes so the scheduler does not time out on long-running syncs. Unauthorized response
{
  "error": "Unauthorized"
}
Example
curl -X POST https://your-app.onrender.com/cron/sync \
  -H "x-cron-secret: your_cron_secret_value"
This endpoint is designed to be called by cron-job.org or a similar external scheduler. Configure a daily job pointed at POST /cron/sync with the x-cron-secret header set, scheduled at 02:00 UTC. Add CRON_SECRET as an environment variable in your Render dashboard.

POST /cron/sync-all

Manually triggers the same Codeforces sync pipeline as /cron/sync but without secret validation. Intended for use from the internal admin dashboard. What it does Identical to /cron/sync: invalidates Redis caches, fetches fresh Codeforces data for all students, updates MongoDB, and dispatches inactivity emails as needed. Response
{
  "success": true,
  "message": "Sync started"
}
Example
curl -X POST https://your-app.onrender.com/cron/sync-all
This endpoint has no authentication. Any caller who knows your backend URL can trigger a full bulk sync. Avoid advertising the backend base URL publicly, or add network-level access controls if you need stricter protection.

GET /cron/ping

A lightweight keep-alive endpoint. Ping this every 14 minutes from a second cron-job.org job to prevent the Render free-tier instance from spinning down between nightly syncs. Response
{
  "status": "alive",
  "time": "2026-05-07T01:46:00.000Z"
}
Example
curl https://your-app.onrender.com/cron/ping

GET /health

A standard health-check endpoint for uptime monitoring services such as UptimeRobot or Better Uptime. Returns immediately with a static payload so monitors can detect when the backend is unreachable. Response
{
  "status": "ok",
  "time": "2026-05-07T01:46:00.000Z"
}
Example
curl https://your-app.onrender.com/health

Build docs developers (and LLMs) love