Skip to main content

Maintenance Guide

This document lists items to check regularly and when to update configurations, certificates, and third-party services.


Quick Checklist (Monthly)

AreaCheckWhen
RenderService status, plan limitsMonthly
VercelBuilds, env vars, domainsMonthly
DatabaseBackups, disk usageMonthly
Certificate pinningLet's Encrypt intermediatesEvery 12–18 months
Dependenciesgo mod, npm, flutter pubQuarterly
API keysRazorpay, Resend, AWS, Google MapsWhen rotating
SecurityAudit checklist, logsQuarterly

Certificate Pinning (Mobile Apps)

Type of Pinning

Intermediate CA pinning — The customer and shopkeeper apps pin Let's Encrypt intermediate certificates (E7, R12, YE1, YE2, YR1, YR2), not the server's leaf cert.

Do You Need to Update?

EventUpdate needed?
Server cert renewed (every 90 days)No — chain still validates
Let's Encrypt rotates intermediatesYes — around 2027–2028
Intermediate certs expireYes — E7/R12 to 2027, YE1/YE2/YR1/YR2 to 2028

How to Update

  1. Run the update script in the customer app:

    cd customer_app
    .\scripts\update_letsencrypt_certs.ps1
  2. Copy the updated lib/config/letsencrypt_certs.dart to the shopkeeper app.

  3. Rebuild both apps and release new versions.

Note: Set a reminder for mid-2027 to check Let's Encrypt status and update if needed.


Render (Backend & Database)

Subscription & Plans

  • Free tier: Backend and PostgreSQL on free plans
  • Limits: Service sleeps after ~15 min idle; first request can take 30–60 seconds (cold start)
  • Paid plan ($7/month+): No cold starts, persistent disk, SMTP ports

Regular Checks

ItemAction
Service statusDashboard → Services; verify backend and DB are running
LogsCheck for errors, rate limits, 5xx responses
Environment variablesVerify JWT_SECRET, ALLOWED_ORIGINS, DATABASE_URL, ENVIRONMENT
Disk usageFree tier: ephemeral storage; files lost on redeploy. Use S3 for persistence

Database (Render PostgreSQL)

  • Free tier: Limited storage, may have row limits
  • Backups: Configure in Render dashboard if using paid DB plan
  • Connection: Ensure ?sslmode=require in DATABASE_URL for production

When to Upgrade

  • Cold starts affecting users → paid plan
  • Need persistent file storage → S3 or paid disk
  • Need SMTP (vs Resend API) → paid plan (SMTP ports blocked on free)

Vercel (Frontend & Admin)

What to Check

ItemAction
BuildsDeployments → verify builds succeed
Environment variablesNEXT_PUBLIC_API_URL, NEXT_PUBLIC_RAZORPAY_KEY_ID — set and applied
DomainsCustom domain DNS, SSL status
UsageBandwidth, build minutes (free tier limits)

Env Var Changes

After changing env vars in Vercel, redeploy — Next.js bakes NEXT_PUBLIC_* at build time.

Admin Frontend

If deployed separately: same checks; Root Directory = admin_frontend.


Third-Party Services

Razorpay (Payments)

CheckNotes
API keysTest vs live — ensure correct env
Webhook URLMust be HTTPS, publicly reachable; set in Razorpay dashboard
Webhook secretRAZORPAY_WEBHOOK_SECRET must match dashboard
SubscriptionVerify account active; check for API changes

Resend (Email)

CheckNotes
API keyRESEND_API_KEY in backend
Domain verificationFROM_EMAIL must be verified in Resend
Rate limitsFree tier limits; monitor for bounces

AWS S3 (File Storage)

CheckNotes
BucketAWS_S3_BUCKET, region, credentials
IAMKeys not expired; least privilege
CostsMonitor storage and transfer

Google Maps (Customer App)

CheckNotes
API keyIn local.properties (Android), MapsConfig.xcconfig (iOS)
BillingEnable billing if required; set quotas
RestrictionsRestrict key by package/bundle ID

Code & Dependencies

Quarterly Updates

ProjectCommandNotes
Backendcd backend && go get -u ./... && go mod tidyTest after Go updates
Frontendnpm updateCheck Next.js, React compatibility
Admin frontendSame as frontend
Customer appflutter pub upgradeTest on Android/iOS
Shopkeeper appflutter pub upgradeTest on Windows

Security

  • Run flutter pub audit (Flutter), npm audit (Node)
  • Check Dependabot / GitHub alerts if enabled
  • Review Security Audit checklist

Configuration Files to Review

FilePurpose
backend/.envDB, JWT, Razorpay, Resend, S3 — never commit
frontend/.env.localAPI URL, Razorpay key — never commit
render.yamlRender service config — plan, env vars
frontend/vercel.jsonVercel config, headers, CSP
customer_app/lib/config/letsencrypt_certs.dartPinned certs — update when Let's Encrypt rotates
shopkeeper_app/lib/config/letsencrypt_certs.dartSame as above — keep in sync

Backup & Recovery

  • Database: Configure backups in Render (paid DB) or external (e.g. pg_dump cron)
  • Uploads: On free tier, files are ephemeral; use S3 for durable storage
  • Secrets: Store JWT_SECRET, API keys in password manager; document rotation

Logs & Monitoring

  • Render: Logs tab for backend; check for panics, 5xx
  • Vercel: Function logs, build logs
  • Razorpay: Webhook logs in dashboard
  • Consider: Sentry, LogRocket, or similar for error tracking

Last Updated: February 2026