This repository contains the completed technical assessment for VectorShift. It includes full-stack integration of HubSpot OAuth, along with item retrieval and rendering functionality using FastAPI (Python) and React (JavaScript).
- Frontend: React (JavaScript)
- Backend: FastAPI (Python)
- OAuth Provider: HubSpot
- Cache/Token Store: Redis
-
authorize_hubspot()
Initiates the OAuth flow and returns the HubSpot authorization URL. -
oauth2callback_hubspot()
Handles the OAuth2 callback from HubSpot and exchanges the code for tokens. -
get_hubspot_credentials()
Retrieves valid HubSpot credentials using refresh tokens or stored tokens.
-
Implements logic for:
- Triggering the HubSpot OAuth flow.
- Handling successful authorization state.
- Updating UI to reflect connection status.
-
HubSpot integration added to global integrations UI for discoverability.
-
Fetches HubSpot Contacts as the primary resource.
-
Calls:
GET https://api.hubapi.com/crm/v3/objects/contacts -
Maps results into standard
IntegrationItemformat with fields like:idnameemailcreated_at
-
Prints the final list to the console.
- cd frontend
- npm install
- npm run start
- cd backend
- pip install -r requirements.txt
- uvicorn main:app --reload
Make sure Redis is installed and running
- redis-server
-
Connect your HubSpot account using the frontend.
-
Confirm successful OAuth flow.
-
Run backend and view logged items from HubSpot in the console.
