forked from Ajeet1606/roast-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,63 @@ | ||
# React + TypeScript + Vite | ||
# Roast Github | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
It's a fun and interactive tool that fetches GitHub profile details based on a user's GitHub username and then generates a roast message using the Gemini API. The roast message is streamed as a response, adding a touch of humor to your experience. | ||
|
||
Currently, two official plugins are available: | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
## Tech Stack 🚀 | ||
|
||
## Expanding the ESLint configuration | ||
- ReactJS | ||
- Tailwind CSS | ||
- Github API for getting the profile details | ||
- Gemini API for generating the roast message | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
## Features ⭐ | ||
- Fetches GitHub profile details using the GitHub API. | ||
- Generates a roast message with the Gemini API. | ||
- Streams the roast message for an interactive experience. | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
## Installation 🛠️ | ||
To get started with RoastGithub, follow these steps: | ||
|
||
```js | ||
export default { | ||
// other rules... | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json', './tsconfig.node.json', './tsconfig.app.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
} | ||
### Prerequisites | ||
- Node.js: Ensure that you have Node.js installed. You can download it from nodejs.org. | ||
- pnpm: A package manager to install dependencies. | ||
|
||
## Clone the Repository | ||
``` | ||
git clone https://github.com/Ajeet1606/roast-github.git | ||
cd roast-github | ||
``` | ||
|
||
## Install Dependencies | ||
``` | ||
pnpm install | ||
``` | ||
|
||
## Configuration ⚙️ | ||
Before running the application, you need to configure the environment variables: | ||
|
||
Create a .env file in the root of the project directory. | ||
Add your GitHub API token and Gemini API key to the .env file: | ||
``` | ||
VITE_GITHUB_TOKEN= | ||
VITE_GITHUB_GRAPHQL_API=https://api.github.com/graphql | ||
VITE_GEMINI_API_KEY= | ||
VITE_GEMINI_MODEL=gemini-1.5-flash | ||
``` | ||
|
||
Once you have installed the dependencies and configured the environment variables, you can start the application using the following command: | ||
``` | ||
pnpm dev | ||
``` | ||
|
||
## Contributing 🤝 | ||
We welcome contributions to RoastGithub! If you would like to contribute, please follow these guidelines: | ||
|
||
1. Fork the repository. | ||
2. Create a new branch for your feature or fix. | ||
3. Make your changes and ensure that they are well-tested. | ||
4. Submit a pull request with a clear description of your changes. | ||
|
||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list | ||
## Acknowledgments 🙏 | ||
- GitHub API | ||
- Gemini API |