How bobtrolledu/git_hackathon works
Project Overview and Purpose
• The project is a full-stack web application designed to support newcomers, immigrants, and refugees by providing critical information about relocation. It integrates expert insights, neighborhood recommendations, and geospatial data to help inform resettlement decisions.
• The frontend is built in React (using Next.js), whereas the backend is implemented in Django and exposes a REST API. It also leverages external services like Mapbox for geospatial visualization and an LLM (likely via the provided openAI_API.py) to process a large 400k+ datapoint geographical dataset.
Main Components
a. Frontend (React/Next.js):
– Located in the welcomehomefront directory.
– Consists of UI components (e.g., AnimatedList, MapComponent, various UI widgets) and hooks, along with static assets (e.g., geoJSON files used by Mapbox).
– Manages the interactive user experience including displaying maps, location cards, and toggling UI modes.
b. Backend (Django):
– Found under the GIT_Hackathon directory with the main project folder and the Welcome_Home Django app.
– Hosts the REST API endpoints that facilitate data exchange with the frontend.
– Contains business logic spread across views, models, and serializers.
– Handles data ingestion through scripts (uploadcsv.py, grabImage.py) and LLM integration (openAI_API.py).
– Maintains administrative tasks (migrations, settings, URLs etc.).
c. Database:
– An AWS RDS-hosted PostgreSQL instance is used to store essential data.
– Data might be imported from CSV and Excel files found in the Welcome_Home/dataCSVFiles directory.
d. External Services:
– LLM Service: The backend uses an LLM (as hinted by openAI_API.py) to process and query large amounts of data efficiently.
– AWS RDS: Database hosting service for PostgreSQL.
Relationships and Interactions
• The React frontend communicates with the Django backend through REST API calls.
• The Django backend serves data from the PostgreSQL database and processes resources through its business logic.
• Data processing and enrichment (using the LLM) occur server-side before returning customized insights to the frontend.
• The frontend’s use of Mapbox ensures that user actions on the map (like zoom, pan, or selecting a neighborhood) trigger API calls to fetch or update related data.
Architectural Patterns and Design Principles
– Separation of concerns: Clearly divided responsibilities between the presentation layer (React frontend) and business/data logic (Django backend).
– RESTful design: API endpoints in the backend that facilitate communication across components.
– Modular design: The separation of different functionalities into designated directories (e.g., the ‘Welcome_Home’ Django app, separate data ingestion scripts, and comprehensive UI components) supports scalability and maintainability.
– External integration: Use of third-party APIs (Mapbox) and cloud services (AWS RDS) enhances the system’s functionality by offloading specialized tasks.
Specific Elements
– Clear labels: Each major component (Frontend, Backend, Database, External Services/LLM, CSV/Excel Data Ingestion) should be clearly marked.
• From the frontend to the backend (API calls).
• From the backend to the database (queries, data storage).
• From the backend to external services (Mapbox API calls or LLM processing).
– Integration points: Show where the CSV/Excel data files feed into the backend (via data ingestion scripts) and how that data ends up in the PostgreSQL database.