new changes #1
Open
DevJay067 wants to merge 3 commits into
Open
Conversation
- Update backend config.py with production settings - Update requirements.txt dependencies - Fix frontend tsconfig.json - Add .gitignore to exclude __pycache__ and build artifacts - Remove tracked __pycache__ and .tsbuildinfo files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Backend Fixes
[MODIFY]
config.py
Add import logging and create a module logger instead of bare print() statements
Add a LOCAL_DEV flag to detect dev mode
Add REPORTS_DIR for local PDF storage (uses project-local ./reports_out/ instead of /tmp/)
[MODIFY]
main.py
Replace print() with logging.info()
Fix CORS: add wildcard * pattern support for development (only wildcards don't work in allow_origins with allow_credentials=True)
Add a list_audits endpoint so the dashboard can fetch real data
Add structured logging config at startup
[MODIFY]
routers/audit.py
Critical: Fix _execute_audit — wrap in asyncio.run() or make the background task synchronous, or use asyncio.ensure_future() at the endpoint level
Add proper logging instead of print-based tracebacks
Add a GET /api/audit/list endpoint for the dashboard
[MODIFY]
routers/report.py
Fix the Windows path check (C: detection → use os.path.isabs)
Add logging
[MODIFY]
services/report_generator.py
Fix upload_pdf_to_gcs: use tempfile.gettempdir() or a project-local dir instead of hard-coded /tmp/
Make the local path cross-platform (Windows compatible)
[MODIFY]
services/probe_runner.py
Add logging for probe execution
Add error handling for individual probe failures (so one bad probe doesn't crash the entire audit)
Add timeout handling for target LLM calls
[MODIFY]
services/firebase_client.py
Add logging
Add error handling around Firestore operations
[MODIFY]
services/stats.py
Add logging
Handle edge cases (zero-length arrays, NaN values)
[NEW]
backend/.env
Create a .env file with placeholder values for local development (keys left blank for user to fill)
Frontend Fixes
[MODIFY]
app/audit/[id]/page.tsx
Critical: Fix stale closure in polling — use a useRef for status or refactor to proper polling with cleanup
Fix unsafe access status?.progress.total → status?.progress?.total
[MODIFY]
app/dashboard/page.tsx
Wire up to real API — add listAudits() call and replace placeholder data
[MODIFY]
lib/api.ts
Add a listAudits() function
Add error retry logic for transient failures
Add request abort controller for cleanup
[MODIFY]
next.config.ts
Fix: use ESM export default instead of module.exports
[MODIFY]
tailwind.config.ts
Fix: use ESM export default instead of module.exports
[NEW]
postcss.config.mjs
Create PostCSS config required by Tailwind CSS
[NEW]
frontend/.env.local
Create .env.local pointing to http://localhost:8000 for backend URL
Verification Plan
Automated Tests
Start backend: cd backend && python -m uvicorn main:app --reload --port 8000
Start frontend: cd frontend && npm install && npm run dev
Hit http://localhost:8000/health — expect {"status": "healthy"}
Hit http://localhost:3000 — expect landing page renders
Check browser console for errors on all pages
Manual Verification
Navigate to /dashboard, /audit/new, and confirm no runtime crashes
Check backend logs for structured output (no bare print calls)