A React-based web application to discover trending repositories on GitHub, allowing users to view and manage their favorite repositories.
Diagram of the app logic composition
- Display a list of trending repositories created in the last 7 days, sorted by the number of stars.
- Allow users to mark a repository as a favorite.
- View favorite repositories using a filter or a separate tab.
- Show basic information about the repository, including the name, link to GitHub, description, and number of stars.
- Store favorite repositories locally using local storage.
- (Bonus) Filter repositories by programming languages.
These instructions will help you set up the project on your local machine for development and testing purposes.
Node.js (version 16 or higher)
Clone the repository:
git clone https://github.com/karliky/gh-trends
Change to the project directory:
cd gh-trends
Install dependencies:
npm install
Start the development server:
npm run dev
The application should now be running on http://localhost:3000.
Live application can be found at https://gh-trends.vercel.app/
Visit the application in your browser.
Browse the list of trending repositories and mark your favorites by clicking the bookmark icon.
Use the "Trending" and "Favorites" tabs to switch between the full list of repositories and your favorite repositories.
Filter repositories by programming languages using the dropdown menu.
- React
- Next.js
- TypeScript
- CSS Modules
- GitHub REST API
Tests are written using React Testing Library under the src\__tests__
folder.
$ npm run test
PASS src/__tests__/components/filter.test.tsx
PASS src/__tests__/components/repositoryList.test.tsx
PASS src/__tests__/index.test.tsx
Test Suites: 3 passed, 3 total
Tests: 8 passed, 8 total
Snapshots: 0 total
Time: 2.82 s
Ran all test suites.
This project is licensed under the MIT License. See the LICENSE file for details.