How abhaytopno/contribution-hub works
1. High-level shape
- Contribution Hub is a two-tier application: a Next.js frontend and a Django backend.
- The frontend is responsible for discovery, browsing, and detail pages.
- The backend owns persistence, domain logic, and enrichment from external APIs.
2. Frontend responsibilities
- The frontend lives under frontend/src/app and uses the Next.js App Router.
- Main routes are:
- /organizations for browsing organizations
- /organization/[name] for organization detail
- /organization/[name]/contribute for repositories tied to an organization
- /organization/[name]/repository/[...params] for repository detail
- Page-level components are split into reusable UI blocks in src/components, with separate folders for list, organization detail, contribute view, and repository view.
3. Frontend data access
- The frontend uses Apollo Client (src/lib/apolloClient.ts) and GraphQL query modules in src/queries.
- That means the browser-facing app does not talk directly to GitHub or other external services; it fetches structured data from the backend API.
- The query layer is the main boundary between presentation and server-side data.
4. Backend structure
- The backend is a Django project under backend/setting.
- It is split into three domain apps:
- gsoc_api for organization data and GSoC-specific metadata
- github for GitHub-related integration and schema
- repos for repository-level data and contributor/issue information
- Each app has its own models.py, views.py, schema.py, and tests, which suggests a modular domain-driven layout.
5. Likely API style
- The presence of schema.py in multiple apps and Apollo Client on the frontend strongly indicates a GraphQL API surface.
- The backend is therefore likely exposing a unified query layer over organizations, repositories, and related enrichment data rather than multiple ad hoc REST endpoints.
6. Core data model
- The domain appears centered on organizations and repositories:
- organizations store ratings, total projects, and GitHub URLs
- repositories store repository-specific metadata for contribution discovery
- The backend migrations show the organization model evolved over time to add rating, project count, and GitHub URL fields, which are important for ranking and linking data.
7. External data ingestion
- The gsoc_api/management/commands folder contains batch commands:
- fetch_gsoc_orgs
- fetch_github_url
- These commands populate or enrich the database with organization data and GitHub URLs.
- The README explicitly mentions required external credentials for GitHub and Google Custom Search Engine, so the backend uses third-party services to discover and enrich repository/org metadata.
8. GitHub integration boundary
- The backend/api/github and backend/api/repos/github.py modules indicate GitHub-specific querying or normalization logic is isolated from the core organization models.
- This keeps GitHub API usage and response parsing out of the frontend and away from generic business logic.
- The architecture likely uses this layer both for ingestion jobs and for user-facing repository data.
9. Caching and common utilities
- backend/api/common/cache.py suggests some shared caching layer or helper used across backend apps.
- Shared helpers in utils.py files indicate common transformation, filtering, or data shaping logic is centralized per domain instead of duplicated in views.
10. Deployment and runtime
- The repo is container-first: docker-compose.yml, dockerfile.backend, and dockerfile.frontend define local deployment.
- The README references separate healthy services for backend, frontend, and database, so the architecture includes:
- a Django API container
- a Next.js UI container
- a database container
- Operationally, the app is initialized by running migrations and then executing ingestion commands to seed the organization and repository catalog.
11. User-facing flow
- A user lands on the frontend, browses or filters organizations, opens an organization detail page, then navigates to contribution opportunities and repository-specific pages.
- Each page pulls its data through Apollo-backed queries from the backend, which serves already-curated, GitHub-enriched content from the database.
12. Diagram boundaries to emphasize
- Put a clear boundary between frontend presentation/querying and backend domain/data ingestion.
- Put another boundary between the backend and external services:
- GitHub API / GitHub search
- Google Custom Search
- The database sits behind the backend only; the frontend never accesses it directly.
Main entry points: gsoc_api GSoC orgs · repos Repositories · apolloClient.ts Apollo client · github GitHub integration
Components 19
Frontend
Next.js UI and client-side data access
- App Router · Route shells and page entrypoints for organizations and repositories
frontend/src/app - Org views · List, detail, and contribution screens for organizations
frontend/src/components/organization - Repo views · Repository detail sections and state handling
frontend/src/components/repository - GraphQL queries · Frontend query modules that fetch structured data from the backend
frontend/src/queries - Apollo client · Browser-side GraphQL client configuration
frontend/src/lib/apolloClient.ts
Backend
Django API, domain apps, and ingestion
- Django project · ASGI/WSGI entrypoints and URL wiring for the API
backend/setting - GSoC orgs · Organization catalog and GSoC metadata
backend/api/gsoc_api - Repositories · Repository discovery, contributors, and issue data
backend/api/repos - GitHub integration · GitHub-facing schema, views, and normalization helpers
backend/api/github - Shared cache · Common caching and cross-app helpers
backend/api/common/cache.py - Org ingestion · Batch jobs that fetch and enrich organization records
backend/api/gsoc_api/management/commands - Org schema · GraphQL surface for organizations and ranking fields
backend/api/gsoc_api/schema.py - Repo schema · GraphQL surface for repository and contribution data
backend/api/repos/schema.py - GitHub schema · GraphQL surface for GitHub-backed data and normalization
backend/api/github/schema.py - Org models · Organizations with rating, project count, and GitHub URL fields
backend/api/gsoc_api/models.py - Repo models · Repositories and contributor/issue related persistence
backend/api/repos/models.py
External services
Third-party systems and runtime dependencies
- Database · Primary persistence layer behind the Django backend
- GitHub API · Source of repository and organization enrichment data
- Search API · Google Custom Search used for discovery and enrichment
Connections 29
- App Router → Org views: renders · Route pages compose organization browsing and detail screens
- App Router → Repo views: renders · Route pages compose repository detail screens
- Org views → GraphQL queries: loads data · Organization pages fetch curated backend data through GraphQL queries
- Repo views → GraphQL queries: loads data · Repository pages fetch curated backend data through GraphQL queries
- GraphQL queries → Apollo client: uses client · Query modules execute through the Apollo client
- Apollo client → Org schema: queries · Frontend GraphQL requests reach the backend organization schema
- Apollo client → Repo schema: queries · Frontend GraphQL requests reach the backend repository schema
- Apollo client → GitHub schema: queries · Frontend GraphQL requests reach the GitHub-facing schema
- Django project → GSoC orgs: routes · Project wiring exposes the organization domain app
- Django project → Repositories: routes · Project wiring exposes the repository domain app
- Django project → GitHub integration: routes · Project wiring exposes the GitHub integration app
- GSoC orgs → Org models: persists · Organization app owns the org data model
- Repositories → Repo models: persists · Repository app owns repository persistence
- GSoC orgs → Org schema: exposes · Organization app publishes GraphQL schema
- Repositories → Repo schema: exposes · Repository app publishes GraphQL schema
- GitHub integration → GitHub schema: exposes · GitHub integration app publishes GraphQL schema
- GSoC orgs → Org ingestion: seeds · Management commands populate and enrich organization data
- GSoC orgs → Shared cache: shares · Organization workflows reuse shared caching helpers
- Repositories → Shared cache: shares · Repository workflows reuse shared caching helpers
- GSoC orgs → Database: reads/writes · Organization records are stored in the database
- Repositories → Database: reads/writes · Repository records are stored in the database
- Org models → Database: stores · Organization model maps to persistent storage
- Repo models → Database: stores · Repository model maps to persistent storage
- GitHub integration → GitHub API: fetches · GitHub integration calls out to GitHub for enrichment
- Org ingestion → Search API: searches · Ingestion jobs use Google Custom Search for discovery
- Org ingestion → GitHub API: enriches · Ingestion jobs fetch GitHub URLs and repository data
- Org schema → Org models: resolves · GraphQL resolvers read organization models
- Repo schema → Repo models: resolves · GraphQL resolvers read repository models
- GitHub schema → GitHub integration: delegates · GitHub GraphQL schema delegates to integration logic