Skip to content

davgonsan/github-user-activity

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

GitHub User Activity CLI

This project is a Command-Line Interface (CLI) application built with NestJS that fetches and displays user activity data from the GitHub API. The application allows users to input a GitHub username, retrieves the latest activities for that user, and displays them in a structured format in the terminal. See other projects and ideas in roadmap.sh.

Features

  • Fetch GitHub Activity: Retrieves recent events such as repository watching, code pushes, and public activity for a specified GitHub user.
  • Customizable Event Limit: Users can specify a maximum number of events to display, providing flexibility in the amount of data returned.
  • Formatted Output: Each event is displayed with a clear timestamp, event type, and repository name to make the output easy to read.

Error Handling: Gracefully handles various error scenarios

  • Invalid usernames
  • Exceeding the GitHub API rate limit
  • Network and API errors with user-friendly messages

Technical Details

  • NestJS: A scalable and maintainable framework, ideal for structuring the CLI as a modular, testable application.
  • TypeScript: Ensures type safety, improving code reliability and maintainability.
  • date-fns: Formats event timestamps to make them human-readable.

Project setup

$ npm install

How to use

  1. Run the Application: After compiling the project, run it from the terminal with:
node dist/main.js <username> <maxEvents>

Replace username with the GitHub username you want to check and maxEvents (optional) with the number of recent events to fetch.

  1. Example:
npm run start:cli -- octocat 5

Potential Future Enhancements

  • Filter by Event Type: Allow users to specify event types they’re interested in (e.g., PushEvent).
  • Save Output to File: Add an option to save activity logs to a file for later review.
  • Extended Data: Retrieve additional details about each event, like commit messages or repository descriptions.

Deployment

When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.

If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:

$ npm install -g mau
$ mau deploy

With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.
  • Looking for a job, or have a job to offer? Check out our official Jobs board.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

License

Nest is MIT licensed.

About

A way to get the last GitHub User Activity from the CLI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published