Skip to content

feat: add location detection for GitHub users and initialize PostgreSQL schema#179

Open
O2sa wants to merge 8 commits into
mainfrom
leaderboard
Open

feat: add location detection for GitHub users and initialize PostgreSQL schema#179
O2sa wants to merge 8 commits into
mainfrom
leaderboard

Conversation

@O2sa

@O2sa O2sa commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

feat: Add location detection and country leaderboard infrastructure

Core Features

  • Implemented calculate-next-country.ts script to automate leaderboard calculations for countries
  • Enhanced GitHub user data model with login and location fields
  • Implemented location detector to normalize user-provided locations into country slugs
  • Updated GraphQL queries to fetch new login and location fields
  • Separated leaderboard logic into two endpoints: one for calculate, another for results

Database & Infrastructure

  • Added PostgreSQL schema initialization script
  • Introduced leaderboard_calculation table to track country calculation progress
  • Added DatabaseStore methods for seeding, starting, and finishing leaderboard calculations
  • Updated package dependencies (added pg for PostgreSQL support)

Code Quality & Refactoring

  • Renamed fetchGitHubUserData to getUserData for clarity
  • Updated country flag mapping to dynamically build from countries.json
  • Removed unused ContributionTotals type from GitHub types and fixtures
  • Enhanced error handling in tests for GitHub API rate limits
  • Added dotenv configuration to test files
  • Improved localization for leaderboard features (Arabic & English)
  • Increased default pull request count from 250 to 300
  • Enhanced logging for better tracking of calculation process and results

ws-rush and others added 7 commits June 26, 2026 06:08
…QL schema

- Enhanced GitHub user data model to include `login` and `location` fields.
- Implemented a location detector to normalize user-provided locations into country slugs.
- Updated GraphQL queries to fetch the new `login` and `location` fields.
- Increased default pull request count from 250 to 300.
- Added a script to initialize the PostgreSQL database schema.
- Updated package dependencies, including adding `pg` for PostgreSQL support.
- Refactored error handling and improved code formatting for better readability.

Co-authored-by: Copilot <copilot@github.com>
- Updated country flag mapping to dynamically build from countries.json.
- Introduced leaderboard_calculation table to track country calculations.
- Added methods for seeding, starting, and finishing leaderboard calculations in DatabaseStore.
- Enhanced location detection to utilize updated country data structure.
- Improved localization for leaderboard features in Arabic and English.
- Implemented `calculate-next-country.ts` to automate leaderboard calculations.
- The script connects to the PostgreSQL database and processes the next country in line.
- Added logging for better tracking of the calculation process and results.

refactor: update GitHub data fetching in tests

- Renamed `fetchGitHubUserData` to `getUserData` for clarity.
- Adjusted tests to use the new `getUserData` mock function.
- Enhanced error handling in tests for GitHub API rate limits and resource limits.

chore: remove unused ContributionTotals type

- Deleted `ContributionTotals` type from GitHub types and related fixtures.
- Updated user score input to remove contributions from its structure.
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dev-impact Ready Ready Preview, Comment Jul 21, 2026 3:57am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants