Skip to content

Chidroopakanaparthy/CivicSense

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CivicSense 🏛️

CivicSense is an enterprise-grade, impartial AI assistant built for the Google x hack2skill Prompt Wars Hackathon. It provides verified voting information and civic guidance powered by Google Vertex AI Search Grounding.

Strategic Fulfillment of 6 Evaluation Criteria

1. Code Quality

  • Full Type Safety: TypeScript 5.0+ on the frontend and strict Python 3.11 type hints on the backend.
  • Google-Style Documentation: Every service and endpoint is documented with strict docstrings and JSDoc.
  • Modular Architecture: Clean separation between AI services, third-party APIs, and core business logic.

2. Security

  • Prompt Injection Protection: Native system_instruction integration at the model level to prevent persona overriding.
  • Hardened Safety Guardrails: Strict HarmBlockThreshold configuration across all Vertex AI safety categories.
  • Input Validation: Pydantic length constraints to prevent token-exhaustion and DoS attacks.

3. Efficiency

  • Search Grounding: Integrated GoogleSearchRetrieval to ensure real-time accuracy without redundant LLM retraining.
  • Intelligent Caching: Asynchronous in-memory response caching to reduce latency and API costs.
  • Optimized Compute: Multi-stage Docker builds and lightweight Python base images for fast Cloud Run scaling.

4. Testing

  • 100% CI Coverage: Automated GitHub Actions pipeline running Pytest and Jest on every commit.
  • Mocked Integration: Robust mocking of Vertex AI services ensures reliable and fast CI runs without network dependencies.

5. Accessibility (a11y)

  • WCAG 2.1 Compliance: Implemented aria-live regions for dynamic content and strict ARIA labeling.
  • Semantic HTML: Used standard landmarks (<main>, <section>, <footer>) to ensure compatibility with all assistive technologies.

6. Google Services

  • Vertex AI Search Grounding: Real-time fact verification for election data.
  • Google Civic Information API: Official polling and election metadata source.
  • Cloud Run & Firebase: Fully automated deployment configurations for the Google Cloud ecosystem.

Tech Stack

  • Frontend: Next.js 14, TypeScript, Tailwind CSS, Firebase.
  • Backend: FastAPI, Python 3.11, Vertex AI SDK, Google Cloud Run.
  • AI: Gemini 2.5 Flash with Native Grounding.

Documentation

Releases

No releases published

Packages

 
 
 

Contributors