Skip to content

Backend, infrastructure, security, and deployment for NIV AI - Heet #9

Description

@advikdivekar

Own everything that makes the system stable, secure, and accessible via a live production URL. This includes authentication, APIs, data persistence, cost logic, report generation, and deployment. The goal is to ensure the frontend and AI layers run smoothly on top of a reliable backend that judges can access without failure.

  1. regenerate firebase service account key and remove any previously exposed keys
  2. add credentials to .gitignore and ensure they are never committed
  3. audit repository for any leaked secrets or sensitive configs
  4. enforce SKIP_AUTH=false for production environment
  5. implement safe development bypass inside auth middleware without affecting production flow
  6. remove /ws-test or any unsecured testing routes from backend
  7. verify firebase authentication works end-to-end with real tokens
  8. build docker image for backend service
  9. push image to container registry
  10. deploy backend to cloud run (region: asia-south1)
  11. configure environment variables for production (SKIP_AUTH, USE_OLLAMA, ENVIRONMENT)
  12. move sensitive values (gemini api key, firebase credentials) to secret manager
  13. connect cloud run service with secrets securely
  14. test all endpoints on deployed live url
  15. configure CORS properly
  16. allow all origins in development
  17. restrict to frontend domain in production using environment variable
  18. verify requests from frontend work without CORS issues
  19. create /india/defaults endpoint
  20. return repo rate, gst rules, stamp duty rates, and last updated timestamp
  21. connect endpoint to constants defined in backend
  22. ensure frontend and backend calculations stay consistent
  23. implement PMAY subsidy calculation logic based on income brackets
  24. compute subsidy impact (NPV or effective reduction)
  25. include eligibility flag and subsidy value in response
  26. integrate subsidy into affordability and cost calculations
  27. extend user input schema to include annual_income
  28. auto-derive from monthly income when not provided
  29. update all dependent calculations and validations
  30. persist analysis outputs (presentation, verdict) to firestore after processing
  31. ensure session data survives server restarts
  32. create helper function to save structured results
  33. update report generation flow to read from firestore instead of in-memory state
  34. ensure reports can be generated even after deployment restarts
  35. add direct PDF download endpoint returning raw file bytes
  36. set correct headers for file download in browser
  37. ensure frontend can trigger download instantly
  38. test PDF generation flow thoroughly across multiple sessions
  39. ensure no dependency on temporary or in-memory state
  40. write complete backend README
  41. include setup steps, environment variables, API documentation, and deployment instructions
  42. add architecture overview and link to live deployment
  43. test full backend integration with frontend
  44. validate /analyze, websocket roundtable, /report, and auth flows
  45. fix any response mismatches or errors
  46. ensure backend handles errors gracefully (invalid input, failed calls, missing data)
  47. return clean structured error responses
  48. verify system stability under repeated usage
  49. ensure no crashes, memory issues, or broken sessions during demo
  50. finalize backend readiness for demo video and judging (stable, secure, deployed, fully functional)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions