Skip to content

docs: add frontend API validation guide#134

Merged
Vishnu2707 merged 1 commit into
openshield-org:devfrom
SHAURYAKSHARMA24:docs/issue-132-frontend-api-validation-dev
Jun 13, 2026
Merged

docs: add frontend API validation guide#134
Vishnu2707 merged 1 commit into
openshield-org:devfrom
SHAURYAKSHARMA24:docs/issue-132-frontend-api-validation-dev

Conversation

@SHAURYAKSHARMA24

Copy link
Copy Markdown
Collaborator

Summary

Closes #132.

Adds frontend/API validation documentation for OpenShield covering the React/Vite frontend, Flask API endpoints, JWT behaviour, CORS/error handling, live mode setup, and frontend-to-backend data flow.

Changes

  • Added docs/validation/FRONTEND_API_TESTING.md
  • Added docs/validation/TEST_RESULTS.md
  • Documented frontend page inventory
  • Documented page-to-API endpoint mapping
  • Documented live mode setup using VITE_API_URL and JWT token handling
  • Documented expected API response shapes
  • Added auth/JWT validation checklist
  • Added CORS, loading, error, and empty-state validation checklist
  • Added known frontend/API gaps and recommended follow-up issues
  • Added structured frontend/API test results table

Validation Results

  • npm install: Pass
  • npm run lint: Failed — 65 lint errors, mostly unused React imports
  • npm run build: Pass
  • npm run dev: Pass — Vite starts on localhost:5173
  • pytest: Failed — DATABASE_URL not configured for PostgreSQL-backed tests

Key Findings

  • All eight API blueprints are registered in api/app.py
  • GET route authentication behaviour appears inconsistent with older frontend/API documentation
  • Several frontend pages lack proper error handling and may remain stuck in loading state if API calls fail
  • frontend/API_ENDPOINTS.txt appears outdated in areas including port references, AI endpoint paths, demo/live mode description, and endpoint status
  • API/database validation requires a configured PostgreSQL DATABASE_URL

Security

No secrets, JWT values, Azure credentials, database credentials, .env files, or local environment files were committed.

@SHAURYAKSHARMA24 SHAURYAKSHARMA24 self-assigned this Jun 7, 2026
@Vishnu2707 Vishnu2707 requested review from parthrohit22 and safidnadaf and removed request for Vishnu2707 June 10, 2026 23:00

@parthrohit22 parthrohit22 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. I re-reviewed the latest branch and the requested response-shape fixes look good now.

The validation guide now correctly documents the raw backend response shapes and clearly separates them from the frontend-normalized shapes for:

  • GET /api/score
  • GET /api/scans
  • GET /api/drift
  • GET /api/findings/:id/playbook

This makes the doc much more useful for future contributors because it explains both what the backend actually returns and what the frontend normalizers expose to components.

Also confirming the base-branch point: this PR targets dev. The larger 36-file diff only appears when comparing the branch against main, because dev already contains additional changes. Against the actual PR base, the diff is clean and limited to the validation docs.

For the scope of issue #132, this is a solid introductory validation framework. It documents the current state, known gaps, setup requirements, and follow-up validation work without trying to solve everything in one PR.

CI is green on the updated commit. Looks good to me.

@SHAURYAKSHARMA24 SHAURYAKSHARMA24 force-pushed the docs/issue-132-frontend-api-validation-dev branch from d3cf9f6 to c96ada0 Compare June 11, 2026 19:41
@Vishnu2707 Vishnu2707 merged commit 852768d into openshield-org:dev Jun 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validation: frontend, API, and database integration testing framework

3 participants