How prachi1210/gmail-contacts-import works
This PHP web app lets users sign in with Google, records their profile, and provides an account and contact-import experience. The visible login flow is handled by index.php: it exchanges an authorization code for a token, retrieves the Google profile, calls the user-check helper, and redirects to the account page. The README documents contact import through Contacts 3.0, but importcontacts.php and the database connection files it names are not present in the supplied tree, so that branch is shown as documented but its wiring is unverified. The sampled client-library code supports OAuth and API requests; other library internals are not traced here.
Main entry points: index.php Login flow · Google_IO.php HTTP transport · functions.inc.php User lookup · Google_Client.php API client
Components 14
Web application
- Login flow
index.php - App setup
config.php - User lookup
inc/functions.inc.php - Account page
account.php - Contact import
Google client library
- API client
src/Google_Client.php - OAuth handling
src/auth/Google_OAuth2.php - Service requests
src/service/Google_ServiceResource.php - HTTP transport
src/io/Google_IO.php
API services
- Profile API
src/contrib/Google_Oauth2Service.php
Other components
- User
- User database
- Contacts API
Connections 16
- User → Login flow: opens login
- Login flow → App setup: loads setup
- Login flow → API client: authenticates
- API client → OAuth handling: delegates OAuth
- OAuth handling → HTTP transport: sends token requests
- HTTP transport → Google: exchanges tokens
- Login flow → Profile API: requests profile
- Profile API → Service requests: dispatches API call
- Service requests → HTTP transport: sends request
- HTTP transport → Google: fetches profile
- Login flow → User lookup: checks user
- User lookup → User database: reads or writes
- Login flow → Account page: redirects
- User → Contact import: requests import
- Contact import → Contacts API: imports contacts
- Contacts API → Google: contacts service