How shriyanshcode/cityassist works
Main Components
• Frontend (User Interface): Two main Streamlit-driven UIs are implemented:
• updated_househelp_ui.py: For data entry and verification.
• cityassist.py: For executing household help search.
• Backend Microservices:
• aadhaarchecker.py: A Flask server dedicated to Aadhaar card verification (using PaddleOCR).
• nursechecker.py: A Flask server that implements nursing verification (using Selenium for browser automation).
• Data Processing and Loading:
• load.py: Loads the dataset (found under the data folder, e.g., data/data.json) into a MongoDB cluster.
• params.py: Likely contains configuration and parameter settings for various components.
• Database and External Integrations:
• MongoDB: Utilized for advanced vector-based search with Atlas Search (leveraging MongoDB’s knnVector and dynamic mappings).
• Google Embeddings / Gemini API: Used for generating embeddings to power the advanced search.
• Selenium and PaddleOCR: Integrated into the verification processes for identity validation.
Relationships and Data Flow
• User Interactions:
• Users interact with the Streamlit UIs to either search for household help or to enter and verify new data.
• Data Operations:
• When a user conducts a search via cityassist.py, the UI sends queries that are processed using MongoDB’s vector search (backed by Google Embeddings).
• For data entry or verification, the updated_househelp_ui.py interacts with backend services to check user credentials or verify identities.
• Microservices Communication:
• The Aadhaar and nurse verification endpoints (exposed by aadhaarchecker.py and nursechecker.py respectively) operate as separate services, likely interfacing with the frontend or other parts of the system via HTTP (or REST API) calls.
• The load.py script is used during setup to import data into the database from data/data.json.
• External Service Integrations:
• MongoDB and its Atlas Search index are crucial for handling queries.
• The system relies on external credentials like MONGO_URI, GOOGLE_API_KEY, and configurations for Chromium driver for Selenium automation.
Important Architectural Patterns and Design Choices
• Microservices Architecture: Separation of verification tasks via distinct Flask servers enables independent scaling and maintenance.
• Modular Design: Each functionality (search, data entry/verification, and identity confirmation) is handled by separate scripts.
• Third-Party Integrations: The use of tools like PaddleOCR and Selenium indicates a design that leverages specialized libraries for specific tasks.
• Cloud Integration: The reliance on MongoDB Atlas and Google Embeddings implies that cloud services and API integrations are a foundational part of the architecture.