A full-stack application to collect, store, and view GitHub starred repositories with advanced filtering capabilities.
- ✅ Fetch and store GitHub starred repositories
- ✅ Advanced filtering by stars, language, and tags
- ✅ Scheduled automatic collection
- ✅ Web UI for easy viewing and searching
- ✅ RESTful API for programmatic access
- ✅ GitHub Actions integration for automated collection
- PocketBase - Go-based backend as a service
- GitHub API - Fetch starred repositories
- SQLite - Embedded database
- Next.js 14 - React framework with App Router
- TypeScript - Type safety
- shadcn-ui - Beautiful UI components
- Tailwind CSS - Styling
- Axios - HTTP client
- GitHub Actions - Scheduled collection
- Docker - Containerization
github-collectors/
├── backend/
│ ├── main.go # Main application entry
│ ├── go.mod # Go dependencies
│ ├── pb_migrations/ # Database migrations
│ └── pb_data/ # PocketBase data (created at runtime)
├── frontend/
│ ├── src/
│ │ ├── app/ # Next.js App Router pages
│ │ ├── components/ # React components
│ │ └── lib/ # Utilities and API client
│ ├── package.json
│ └── tsconfig.json
├── .github/
│ └── workflows/
│ └── collect-starred.yml # GitHub Action workflow
├── API.md # API documentation
├── build.sh # Build script
├── setup.sh # Setup script
├── deploy.sh # Deployment script
├── Dockerfile.backend # Backend Docker image
└── Dockerfile.frontend # Frontend Docker image
- Go 1.21 or later
- Node.js 18 or later
- GitHub Personal Access Token (optional, for higher rate limits)
-
Clone and setup:
cd github-collectors chmod +x *.sh ./setup.sh
-
Configure environment:
# Edit .env file with your GitHub token GITHUB_TOKEN=your_github_token_here NEXT_PUBLIC_API_URL=http://localhost:8090 -
Start the backend:
cd backend go run main.go serve -
Start the frontend:
cd frontend npm run dev -
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8090
- PocketBase Admin: http://localhost:8090/_/
- Open http://localhost:3000
- Enter a GitHub username (default: qdriven)
- Click "Collect Repos" to fetch starred repositories
- Use filters to search by:
- Star count range
- Programming language
- Tags/topics
See API.md for complete API documentation.
Quick examples:
# Collect starred repos
curl -X POST http://localhost:8090/api/github/collect/qdriven
# Search with filters
curl "http://localhost:8090/api/starred/search?github_user=qdriven&min_stars=100&language=TypeScript"- Access PocketBase admin at http://localhost:8090/_/
- Create a new collection config in
collection_configs - Set
github_userandenabledtotrue - The system will collect daily at midnight UTC
The repository includes a GitHub Action workflow that:
- Runs daily at midnight UTC
- Collects starred repositories for configured users
- Saves data to a JSON file
- Commits changes to the repository
To enable:
- Push this repository to GitHub
- Set
GITHUB_TOKENsecret in repository settings - The workflow will run automatically or can be triggered manually
./build.sh./test.sh./deploy.sh| Variable | Description | Default |
|---|---|---|
GITHUB_TOKEN |
GitHub Personal Access Token | None |
NEXT_PUBLIC_API_URL |
Backend API URL | http://localhost:8090 |
BACKEND_PORT |
Backend server port | 8090 |
FRONTEND_PORT |
Frontend server port | 3000 |
- starred_repos - Stores collected repositories
- collection_configs - Scheduled collection configuration
GET /api/github/starred/:username- Fetch starred reposPOST /api/github/collect/:username- Collect and save reposGET /api/starred/search- Search with filtersGET /api/starred/languages/:username- Get language statisticsGET /api/starred/tags/:username- Get tag statistics
See API.md for detailed documentation.
- User triggers collection via API or scheduled job
- Backend fetches all starred repos from GitHub (with pagination)
- Repos are saved to PocketBase database
- Data is available for search and filtering
- User enters GitHub username
- Frontend calls backend API to collect or search
- Results are displayed with filtering options
- Real-time updates as user applies filters
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
./test.sh - Submit a pull request
MIT
For issues and feature requests, please create an issue in the repository.