├── .env.example ├── .eslintrc.cjs ├── .github ├── FUNDING.yml ├── dependabot.yml └── images │ ├── img1.png │ ├── img2.png │ ├── img3.png │ ├── img_main.png │ ├── stats.svg │ └── step_api.png ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── SECURITY.md ├── index.html ├── package.json ├── postcss.config.js ├── public ├── _redirects ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── browserconfig.xml ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── googled107292f58992e0e.html ├── manifest.json ├── mstile-144x144.png ├── mstile-150x150.png ├── mstile-310x150.png ├── mstile-310x310.png ├── mstile-70x70.png ├── robots.txt └── safari-pinned-tab.svg ├── src ├── App.css ├── App.jsx ├── assets │ ├── copy.svg │ ├── grid.svg │ ├── index.js │ ├── link.svg │ ├── loader.svg │ ├── logo.svg │ └── tick.svg ├── components │ ├── Demo.jsx │ └── Hero.jsx ├── constants │ └── index.jsx ├── main.jsx └── services │ ├── article.js │ └── store.js ├── tailwind.config.js ├── vite.config.js └── yarn.lock /.env.example: -------------------------------------------------------------------------------- 1 | VITE_RAPIDAPI_ARTICLE_KEY=XXXXXXXXXXXXXXXXXXXXXXX -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { browser: true, es2020: true }, 3 | extends: [ 4 | 'eslint:recommended', 5 | 'plugin:react/recommended', 6 | 'plugin:react/jsx-runtime', 7 | 'plugin:react-hooks/recommended', 8 | ], 9 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 10 | settings: { react: { version: '18.2' } }, 11 | plugins: ['react-refresh'], 12 | rules: { 13 | 'react-refresh/only-export-components': 'warn', 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [sanidhyy]# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: sanidhy 5 | custom: https://www.buymeacoffee.com/sanidhy 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.github/images/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/.github/images/img1.png -------------------------------------------------------------------------------- /.github/images/img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/.github/images/img2.png -------------------------------------------------------------------------------- /.github/images/img3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/.github/images/img3.png -------------------------------------------------------------------------------- /.github/images/img_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/.github/images/img_main.png -------------------------------------------------------------------------------- /.github/images/stats.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 122 | 123 | 124 | 125 | 100 126 | Performance 127 | 128 | 129 | 130 | 131 | 100 132 | Accessibility 133 | 134 | 135 | 136 | 137 | 100 138 | Best Practices 139 | 140 | 141 | 142 | 143 | 100 144 | SEO 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | Progressive 211 | Web App 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 0-49 227 | 50-89 228 | 90-100 229 | 230 | 231 | -------------------------------------------------------------------------------- /.github/images/step_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/.github/images/step_api.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | # Modules 11 | node_modules 12 | dist 13 | dist-ssr 14 | *.local 15 | 16 | # Environment Variables 17 | .env 18 | .env.local 19 | .env.development 20 | .env.production 21 | .env.staging 22 | .env.qa 23 | 24 | # Editor directories and files 25 | .vscode/* 26 | !.vscode/extensions.json 27 | .idea 28 | .DS_Store 29 | *.suo 30 | *.ntvs* 31 | *.njsproj 32 | *.sln 33 | *.sw? 34 | 35 | # Local Netlify folder 36 | .netlify 37 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | issues. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | [fork]: https://github.com/Technical-Shubham-tech/ai-summarizer/fork 4 | [pr]: https://github.com/Technical-Shubham-tech/ai-summarizer/compare 5 | [style]: https://standardjs.com/ 6 | [code-of-conduct]: CODE_OF_CONDUCT.md 7 | 8 | Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. 9 | 10 | Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. 11 | 12 | ## Issues and PRs 13 | 14 | If you have suggestions for how this project could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you have questions, too, we'd love to hear them. 15 | 16 | We'd also love PRs. If you're thinking of a large PR, we advise opening up an issue first to talk about it, though! Look at the links below if you're not sure how to open a PR. 17 | 18 | ## Submitting a pull request 19 | 20 | 1. [Fork][fork] and clone the repository. 21 | 1. Configure and install the dependencies: `npm install`. 22 | 1. Make sure the tests pass on your machine: `npm test`, note: these tests also apply the linter, so there's no need to lint separately. 23 | 1. Create a new branch: `git checkout -b my-branch-name`. 24 | 1. Make your change, add tests, and make sure the tests still pass. 25 | 1. Push to your fork and [submit a pull request][pr]. 26 | 1. Pat your self on the back and wait for your pull request to be reviewed and merged. 27 | 28 | Here are a few things you can do that will increase the likelihood of your pull request being accepted: 29 | 30 | - Follow the [style guide][style] which is using standard. Any linting errors should be shown when running `npm test`. 31 | - Write and update tests. 32 | - Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. 33 | - Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). 34 | 35 | Work in Progress pull requests are also welcome to get feedback early on, or if there is something blocked you. 36 | 37 | ## Resources 38 | 39 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) 40 | - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) 41 | - [GitHub Help](https://help.github.com) 42 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Sanidhya Kr. Verma 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Summise - Modern OpenAI GPT-4 Article Summarizer 2 | 3 | ![Modern OpenAI GPT-4 Article Summarizer](/.github/images/img_main.png "Modern OpenAI GPT-4 Article Summarizer") 4 | 5 | [![Ask Me Anything!](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](https://github.com/Technical-Shubham-tech "Ask Me Anything!") 6 | [![GitHub license](https://img.shields.io/github/license/Technical-Shubham-tech/ai-summarizer)](https://github.com/Technical-Shubham-tech/ai-summarizer/blob/main/LICENSE.md "GitHub license") 7 | [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/Technical-Shubham-tech/ai-summarizer/commits/main "Maintenance") 8 | [![GitHub branches](https://badgen.net/github/branches/Technical-Shubham-tech/ai-summarizer)](https://github.com/Technical-Shubham-tech/ai-summarizer/branches "GitHub branches") 9 | [![Github commits](https://badgen.net/github/commits/Technical-Shubham-tech/ai-summarizer/main)](https://github.com/Technical-Shubham-tech/ai-summarizer/commits "Github commits") 10 | [![Netlify Status](https://api.netlify.com/api/v1/badges/4b406197-21d8-4e96-9fdd-52c782540f0e/deploy-status)](https://summise.netlify.app/ "Netlify Status") 11 | [![GitHub issues](https://img.shields.io/github/issues/Technical-Shubham-tech/ai-summarizer)](https://github.com/Technical-Shubham-tech/ai-summarizer/issues "GitHub issues") 12 | [![GitHub pull requests](https://img.shields.io/github/issues-pr/Technical-Shubham-tech/ai-summarizer)](https://github.com/Technical-Shubham-tech/ai-summarizer/pulls "GitHub pull requests") 13 | 14 | ## ⚠️ Before you start 15 | 16 | 1. Make sure **Git** and **NodeJS** is installed. 17 | 2. Clone this repository to your local computer. 18 | 3. Create .env file in root folder. 19 | 4. Contents of **.env**: 20 | 21 | ``` 22 | VITE_RAPIDAPI_ARTICLE_KEY=XXXXXXXXXXXXXXXXXXXXXXX 23 | ``` 24 | 25 | 5. Now, to setup Article Summarizer API, go to [Rapid API Website](https://rapidapi.com/) and create an account. 26 | 27 | 6. Enable this API to fetch music data: [API: Article Extractor and Summarizer by Anthony](https://rapidapi.com/restyler/api/article-extractor-and-summarizer "API: Article Extractor and Summarizer by Anthony"). 28 | 29 | ![Copy API Key](/.github/images/step_api.png "Copy API Key") 30 | 31 | 7. After enabling you can get your API Keys and paste them in `.env` file in `VITE_RAPIDAPI_ARTICLE_KEY`. 32 | 33 | 8. Open terminal and run `npm install` or `yarn install` in root folder to install necessary packages. 34 | 35 | 9. Now app is fully configured :+1: and you can start using this app using `npm run dev` or `yarn dev`. 36 | 37 | **NOTE:** Make sure you don't share these keys publicaly. 38 | 39 | ## :camera: Screenshots: 40 | 41 | ![Modern UI/UX](/.github/images/img1.png "Modern UI/UX") 42 | 43 | ![Generate Article Summary](/.github/images/img2.png "Generate Article Summary") 44 | 45 | ![Chat GPT-4 AI Model](/.github/images/img3.png "Chat GPT-4 AI Model") 46 | 47 | ## :gear: Built with 48 | 49 | [![JavaScript](https://skillicons.dev/icons?i=js)](https://developer.mozilla.org/en-US/docs/Web/JavaScript "JavaScript") [![React JS](https://skillicons.dev/icons?i=react)](https://react.dev/ "React JS") [![Tailwind CSS](https://skillicons.dev/icons?i=tailwind)](https://tailwindcss.com/ "Tailwind CSS") [![Vite](https://skillicons.dev/icons?i=vite)](https://vitejs.dev/ "Vite") 50 | 51 | ## :wrench: Stats 52 | 53 | [![Stats for this App](/.github/images/stats.svg)](https://pagespeed.web.dev/ "Stats for this App") 54 | 55 | ## :raised_hands: Contribute 56 | 57 | You might encounter some bugs while using this app. You are more than welcome to contribute. Just submit changes via pull request and I will review them before merging. Make sure you follow community guidelines. 58 | 59 | ## Buy Me a Coffee 🍺 60 | 61 | [](https://www.buymeacoffee.com/sanidhy "Buy me a Coffee") 62 | 63 | ## :rocket: Follow Me 64 | 65 | [![GitHub followers](https://img.shields.io/github/followers/Technical-Shubham-tech?style=social&label=Follow&maxAge=2592000)](https://github.com/Technical-Shubham-tech "Follow Me") 66 | [![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2FTechnicalShubam)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FTechnical-Shubham-tech%2Fmedical-chat-app "Tweet") 67 | [![YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UCNAz_hUVBG2ZUN8TVm0bmYw "Subscribe my Channel") 68 | 69 | ## :star: Give A Star 70 | 71 | You can also give this repository a star to show more people and they can use this repository. 72 | 73 | ## :books: Available Scripts 74 | 75 | In the project directory, you can run: 76 | 77 | ### `yarn run dev` 78 | 79 | Runs the app in the development mode.\ 80 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser. 81 | 82 | The page will reload when you make changes.\ 83 | You may also see any lint errors in the console. 84 | 85 | ### `yarn test` 86 | 87 | Launches the test runner in the interactive watch mode.\ 88 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 89 | 90 | ### `yarn run build` 91 | 92 | Builds the app for production to the `dist` folder.\ 93 | It correctly bundles React in production mode and optimizes the build for the best performance. 94 | 95 | The build is minified and the filenames include the hashes.\ 96 | Your app is ready to be deployed! 97 | 98 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 99 | 100 | ### `yarn eject` 101 | 102 | **Note: this is a one-way operation. Once you `eject`, you can't go back!** 103 | 104 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 105 | 106 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. 107 | 108 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. 109 | 110 | ## :page_with_curl: Learn More 111 | 112 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 113 | 114 | To learn React, check out the [React documentation](https://reactjs.org/). 115 | 116 | ### Code Splitting 117 | 118 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 119 | 120 | ### Analyzing the Bundle Size 121 | 122 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 123 | 124 | ### Making a Progressive Web App 125 | 126 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 127 | 128 | ### Advanced Configuration 129 | 130 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 131 | 132 | ### Deployment 133 | 134 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 135 | 136 | ### `yarn run build` fails to minify 137 | 138 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 139 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 35 | 41 | 42 | 43 | 49 | 55 | 56 | 57 | 63 | 68 | 69 | 70 | 71 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | OpenAI Article Summarizer 84 | 85 | 86 | 92 | 93 | 94 | 100 | 101 | 102 | 103 |
104 | 105 | 106 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ai-summarizer", 3 | "private": true, 4 | "version": "0.1.0", 5 | "license": "MIT", 6 | "author": "Sanidhya Kr. Verma", 7 | "description": "Modern OpenAI GPT-4 Article Summarizer", 8 | "keywords": [ 9 | "html", 10 | "css", 11 | "react", 12 | "reactjs", 13 | "ai", 14 | "chatgpt", 15 | "gpt", 16 | "gpt-4", 17 | "article summarizer", 18 | "modern", 19 | "modern-ui", 20 | "modern-ux", 21 | "tailwindcss", 22 | "javascript", 23 | "js", 24 | "typescript", 25 | "ts" 26 | ], 27 | "type": "module", 28 | "scripts": { 29 | "dev": "vite", 30 | "build": "vite build", 31 | "lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0", 32 | "preview": "vite preview" 33 | }, 34 | "dependencies": { 35 | "@reduxjs/toolkit": "^2.8.2", 36 | "react": "^19.1.0", 37 | "react-dom": "^19.1.0", 38 | "react-redux": "^9.2.0", 39 | "react-toastify": "^11.0.5", 40 | "valid-url": "^1.0.9" 41 | }, 42 | "devDependencies": { 43 | "@types/react-dom": "^19.1.5", 44 | "@types/react": "^19.1.6", 45 | "@vitejs/plugin-react": "^4.5.0", 46 | "eslint": "^9.28.0", 47 | "autoprefixer": "^10.4.21", 48 | "eslint-plugin-react": "^7.37.5", 49 | "eslint-plugin-react-hooks": "^5.2.0", 50 | "eslint-plugin-react-refresh": "^0.4.20", 51 | "postcss": "^8.5.4", 52 | "vite": "^6.3.5", 53 | "tailwindcss": "^3.4.17" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/_redirects: -------------------------------------------------------------------------------- 1 | /* /index.html 200 -------------------------------------------------------------------------------- /public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #DA532C 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/favicon-16x16.png -------------------------------------------------------------------------------- /public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/favicon-32x32.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/favicon.ico -------------------------------------------------------------------------------- /public/googled107292f58992e0e.html: -------------------------------------------------------------------------------- 1 | google-site-verification: googled107292f58992e0e.html -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Summize", 3 | "short_name": "Summize", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "/android-chrome-192x192.png", 12 | "sizes": "192x192", 13 | "type": "image/png" 14 | }, 15 | { 16 | "src": "/android-chrome-512x512.png", 17 | "sizes": "512x512", 18 | "type": "image/png" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#ffffff", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/mstile-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/mstile-144x144.png -------------------------------------------------------------------------------- /public/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/mstile-150x150.png -------------------------------------------------------------------------------- /public/mstile-310x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/mstile-310x150.png -------------------------------------------------------------------------------- /public/mstile-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/mstile-310x310.png -------------------------------------------------------------------------------- /public/mstile-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanidhyy/ai-summarizer/7b6a3e7c1eb582f3defeb50a1d0fb6670294f5e0/public/mstile-70x70.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by potrace 1.14, written by Peter Selinger 2001-2017 9 | 10 | 12 | 29 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | /* tailwind */ 2 | @tailwind base; 3 | @tailwind components; 4 | @tailwind utilities; 5 | 6 | /* default */ 7 | * { 8 | margin: 0; 9 | padding: 0; 10 | box-sizing: border-box; 11 | } 12 | 13 | /* main */ 14 | .main { 15 | width: 100vw; 16 | min-height: 100vh; 17 | position: fixed; 18 | display: flex; 19 | justify-content: center; 20 | padding: 120px 24px 160px 24px; 21 | pointer-events: none; 22 | } 23 | 24 | .main:before { 25 | background: radial-gradient(circle, rgba(2, 0, 36, 0) 0, #fafafa 100%); 26 | position: absolute; 27 | content: ""; 28 | z-index: 2; 29 | width: 100%; 30 | height: 100%; 31 | top: 0; 32 | } 33 | 34 | .main:after { 35 | content: ""; 36 | background-image: url("/src/assets/grid.svg"); 37 | z-index: 1; 38 | position: absolute; 39 | width: 100%; 40 | height: 100%; 41 | top: 0; 42 | opacity: 0.4; 43 | filter: invert(1); 44 | } 45 | 46 | /* gradient */ 47 | .gradient { 48 | height: fit-content; 49 | z-index: 3; 50 | width: 100%; 51 | max-width: 640px; 52 | background-image: radial-gradient( 53 | at 27% 37%, 54 | hsla(215, 98%, 61%, 1) 0px, 55 | transparent 0% 56 | ), 57 | radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 1) 0px, transparent 50%), 58 | radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 1) 0px, transparent 50%), 59 | radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 1) 0px, transparent 50%), 60 | radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 1) 0px, transparent 50%), 61 | radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 1) 0px, transparent 50%), 62 | radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 1) 0px, transparent 50%); 63 | position: absolute; 64 | content: ""; 65 | width: 100%; 66 | height: 100%; 67 | filter: blur(100px) saturate(150%); 68 | top: 80px; 69 | opacity: 0.15; 70 | } 71 | 72 | /* mobile responsiveness */ 73 | @media screen and (max-width: 640px) { 74 | .main { 75 | padding: 0; 76 | } 77 | } 78 | 79 | /* tailwind styles */ 80 | 81 | .app { 82 | @apply relative z-10 flex justify-center items-center flex-col max-w-7xl mx-auto sm:px-16 px-6; 83 | } 84 | 85 | .black_btn { 86 | @apply rounded-full border border-black bg-black py-1.5 px-5 text-base text-white transition-all hover:bg-white hover:text-black; 87 | } 88 | 89 | .head_text { 90 | @apply mt-5 text-5xl font-extrabold leading-[1.15] text-black sm:text-6xl text-center; 91 | } 92 | 93 | .orange_gradient { 94 | @apply bg-gradient-to-r from-amber-500 via-orange-600 to-yellow-500 bg-clip-text text-transparent; 95 | } 96 | 97 | .desc { 98 | @apply mt-5 text-lg text-gray-600 sm:text-xl text-center max-w-2xl; 99 | } 100 | 101 | .url_input { 102 | @apply block w-full rounded-md border border-gray-200 bg-white py-2.5 pl-10 pr-12 text-sm shadow-lg font-satoshi font-medium focus:border-black focus:outline-none focus:ring-0; 103 | } 104 | 105 | .submit_btn { 106 | @apply hover:border-gray-700 hover:text-gray-700 absolute inset-y-0 right-0 my-1.5 mr-1.5 flex w-10 items-center justify-center rounded border border-gray-200 font-sans text-sm font-medium text-gray-400; 107 | } 108 | 109 | .link_card { 110 | @apply p-3 flex justify-start items-center flex-row bg-white border border-gray-200 gap-3 rounded-lg; 111 | } 112 | 113 | .copy_btn { 114 | @apply w-7 h-7 rounded-full bg-white/10 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur flex justify-center items-center cursor-pointer; 115 | } 116 | 117 | .blue_gradient { 118 | @apply font-black bg-gradient-to-r from-blue-600 to-cyan-600 bg-clip-text text-transparent; 119 | } 120 | 121 | .summary_box { 122 | @apply rounded-xl border border-gray-200 bg-white/20 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur p-4; 123 | } 124 | -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | import { ToastContainer } from "react-toastify"; 2 | 3 | import Hero from "./components/Hero"; 4 | import Demo from "./components/Demo"; 5 | 6 | // styles 7 | import "./App.css"; 8 | 9 | // app 10 | const App = () => { 11 | return ( 12 |
13 | {/* main */} 14 |
15 |
16 |
17 | 18 | {/* app */} 19 |
20 | 21 | 22 |
23 | 24 | {/* toast */} 25 | 40 |
41 | ); 42 | }; 43 | 44 | export default App; 45 | -------------------------------------------------------------------------------- /src/assets/copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 30 | 33 | 34 | -------------------------------------------------------------------------------- /src/assets/grid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/assets/index.js: -------------------------------------------------------------------------------- 1 | // contains all image assets imports 2 | // dont' remove anything from here if not sure 3 | 4 | import linkIcon from "./link.svg"; 5 | import loader from "./loader.svg"; 6 | import copy from "./copy.svg"; 7 | import logo from "./logo.svg"; 8 | import tick from "./tick.svg"; 9 | 10 | // export assets 11 | export { linkIcon, loader, copy, logo, tick }; 12 | -------------------------------------------------------------------------------- /src/assets/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 30 | 33 | 36 | 37 | -------------------------------------------------------------------------------- /src/assets/loader.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 21 | 22 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /src/assets/tick.svg: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 30 | 33 | 34 | -------------------------------------------------------------------------------- /src/components/Demo.jsx: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from "react"; 2 | import { isWebUri } from "valid-url"; 3 | import { toast } from "react-toastify"; 4 | 5 | import { useLazyGetSummaryQuery } from "../services/article"; 6 | import { copy, linkIcon, loader, tick } from "../assets"; 7 | import { 8 | MAX_ARTICLE_HISTORY, 9 | INVALID_URL_MSG, 10 | ARTICLE_SUMMARISED_MSG, 11 | LOCALSTORAGE_ARTICLES_KEY, 12 | } from "../constants"; 13 | 14 | // toast css 15 | import "react-toastify/dist/ReactToastify.css"; 16 | 17 | // demo 18 | const Demo = () => { 19 | // states 20 | const [article, setArticle] = useState({ 21 | url: "", 22 | summary: "", 23 | }); 24 | const [allArticles, setAllArticles] = useState([]); 25 | const [copied, setCopied] = useState(""); 26 | 27 | // article api handler/fetcher 28 | const [getSummary, { error, isFetching }] = useLazyGetSummaryQuery(); 29 | 30 | // fetch articles from local storage 31 | useEffect(() => { 32 | const articlesFromLocalStorage = JSON.parse( 33 | localStorage.getItem(LOCALSTORAGE_ARTICLES_KEY) 34 | ); 35 | 36 | // if articles exists 37 | if (articlesFromLocalStorage) { 38 | setAllArticles(articlesFromLocalStorage); 39 | } 40 | }, []); 41 | 42 | // handle summarize input submit 43 | const handleSubmit = async (e) => { 44 | // prevent default page reload 45 | e.preventDefault(); 46 | 47 | // already fetching data 48 | if (isFetching) return; 49 | 50 | // invalid url 51 | if (!isWebUri(article.url)) { 52 | toast.error(INVALID_URL_MSG); 53 | return; 54 | } 55 | 56 | // fetch summary from article api 57 | const { data } = await getSummary({ articleUrl: article.url }); 58 | 59 | // unable to fetch summary 60 | if (!data?.summary) return; 61 | 62 | // get new article 63 | const newArticle = { ...article, summary: data.summary }; 64 | 65 | // update old articles 66 | let updatedAllArticles = [newArticle, ...allArticles]; 67 | 68 | // set new article 69 | setArticle(newArticle); 70 | 71 | // remove last element if articles are more than 4 72 | if (updatedAllArticles.length > MAX_ARTICLE_HISTORY) { 73 | updatedAllArticles.pop(); 74 | } 75 | 76 | // set all articles 77 | setAllArticles(updatedAllArticles); 78 | 79 | // update local storage 80 | localStorage.setItem( 81 | LOCALSTORAGE_ARTICLES_KEY, 82 | JSON.stringify(updatedAllArticles) 83 | ); 84 | 85 | // toast success msg 86 | toast.success(ARTICLE_SUMMARISED_MSG); 87 | }; 88 | 89 | // handle copy to clipboard 90 | const handleCopy = (copyUrl) => { 91 | // set copy state 92 | setCopied(copyUrl); 93 | // copy to clipboard 94 | navigator.clipboard.writeText(copyUrl); 95 | // show copied msg to user 96 | setTimeout(() => setCopied(false), 3000); 97 | }; 98 | 99 | return ( 100 |
101 | {/* search */} 102 |
103 | {/* form */} 104 |
111 | {/* link icon */} 112 | Link 119 | 120 | {/* article link input */} 121 | setArticle({ ...article, url: e.target.value })} 127 | className="url_input peer" 128 | required 129 | /> 130 | 131 | {/* Submit Button */} 132 | {!isFetching && ( 133 | 150 | )} 151 |
152 | 153 | {/* Browse URL History */} 154 | {!isFetching && ( 155 |
156 | {/* map over articles */} 157 | {allArticles.map((article, i) => ( 158 |
159 | 177 | 178 | {/* article url */} 179 | 186 |
187 | ))} 188 |
189 | )} 190 |
191 | 192 | {/* Display Results */} 193 |
194 | {isFetching ? ( 195 | // loader 196 | Loading... 202 | ) : error ? ( 203 | // error 204 |

205 | Well, that wasn't supposed to happen... 206 |
207 | 208 | {error?.data?.error} 209 | 210 |

211 | ) : ( 212 | article.summary && ( 213 | // article summary 214 |
215 | {/* title */} 216 |

217 | Article Summary 218 |

219 | 220 | {/* summary */} 221 |
222 |

223 | {article.summary} 224 |

225 |
226 |
227 | ) 228 | )} 229 |
230 |
231 | ); 232 | }; 233 | 234 | export default Demo; 235 | -------------------------------------------------------------------------------- /src/components/Hero.jsx: -------------------------------------------------------------------------------- 1 | import { logo } from "../assets"; 2 | import { 3 | PROJECT_NAME, 4 | PROJECT_GITHUB_LINK, 5 | HERO_TITLE_LEFT, 6 | HERO_TITLE_RIGHT, 7 | HERO_SUBTITLE_LEFT, 8 | HERO_SUBTITLE_RIGHT, 9 | } from "../constants"; 10 | 11 | // hero 12 | const Hero = () => { 13 | return ( 14 |
15 | 49 | 50 | {/* title */} 51 |

52 | {HERO_TITLE_LEFT}
53 | {HERO_TITLE_RIGHT} 54 |

55 | 56 | {/* subtitle */} 57 |

58 | {HERO_SUBTITLE_LEFT}{" "} 59 | {PROJECT_NAME},{" "} 60 | {HERO_SUBTITLE_RIGHT} 61 |

62 |
63 | ); 64 | }; 65 | 66 | export default Hero; 67 | -------------------------------------------------------------------------------- /src/constants/index.jsx: -------------------------------------------------------------------------------- 1 | // Project Info 2 | const PROJECT_NAME = "Summize"; 3 | const PROJECT_GITHUB_LINK = 4 | "https://github.com/sanidhyy/ai-summarizer"; 5 | 6 | // Hero Section 7 | const HERO_TITLE_LEFT = "Summarize Articles with"; 8 | const HERO_TITLE_RIGHT = "OpenAI GPT-4"; 9 | const HERO_SUBTITLE_LEFT = "Simplify your reading with"; 10 | const HERO_SUBTITLE_RIGHT = 11 | "an open-source article summarizer that transforms lengthy articles into clear and concise summaries."; 12 | 13 | // Article History Limit 14 | const MAX_ARTICLE_HISTORY = 4; 15 | 16 | // copied to clipboard msg timeout (in milliseconds ms) 17 | const MAX_CLIPBOARD_TIMEOUT = 3000; 18 | 19 | // Local Storage Articles Key 20 | const LOCALSTORAGE_ARTICLES_KEY = "articles"; 21 | 22 | // Toast Messages 23 | const INVALID_URL_MSG = "Invalid URL"; 24 | const ARTICLE_SUMMARISED_MSG = "Article Summarized"; 25 | 26 | export { 27 | PROJECT_NAME, 28 | PROJECT_GITHUB_LINK, 29 | HERO_TITLE_LEFT, 30 | HERO_TITLE_RIGHT, 31 | HERO_SUBTITLE_LEFT, 32 | HERO_SUBTITLE_RIGHT, 33 | MAX_ARTICLE_HISTORY, 34 | MAX_CLIPBOARD_TIMEOUT, 35 | LOCALSTORAGE_ARTICLES_KEY, 36 | INVALID_URL_MSG, 37 | ARTICLE_SUMMARISED_MSG, 38 | }; 39 | -------------------------------------------------------------------------------- /src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import { Provider } from "react-redux"; 4 | 5 | // app 6 | import App from "./App"; 7 | import { store } from "./services/store"; 8 | 9 | // render app 10 | ReactDOM.createRoot(document.getElementById("root")).render( 11 | 12 | {/* redux store */} 13 | 14 | 15 | 16 | 17 | ); 18 | -------------------------------------------------------------------------------- /src/services/article.js: -------------------------------------------------------------------------------- 1 | import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react"; 2 | 3 | // article 4 | export const articleApi = createApi({ 5 | reducerPath: "articleApi", 6 | // base query 7 | baseQuery: fetchBaseQuery({ 8 | // url 9 | baseUrl: "https://article-extractor-and-summarizer.p.rapidapi.com/", 10 | // headers 11 | prepareHeaders: (headers) => { 12 | headers.set( 13 | "X-RapidAPI-Key", 14 | import.meta.env.VITE_RAPIDAPI_ARTICLE_KEY || "" 15 | ); 16 | headers.set( 17 | "X-RapidAPI-Host", 18 | "article-extractor-and-summarizer.p.rapidapi.com" 19 | ); 20 | 21 | return headers; 22 | }, 23 | }), 24 | // endpoints 25 | endpoints: (builder) => ({ 26 | getSummary: builder.query({ 27 | query: (params) => 28 | `/summarize?url=${encodeURIComponent(params.articleUrl)}&length=3`, 29 | }), 30 | }), 31 | }); 32 | 33 | export const { useLazyGetSummaryQuery } = articleApi; 34 | -------------------------------------------------------------------------------- /src/services/store.js: -------------------------------------------------------------------------------- 1 | import { configureStore } from "@reduxjs/toolkit"; 2 | 3 | import { articleApi } from "./article"; 4 | 5 | // store 6 | export const store = configureStore({ 7 | // reducer 8 | reducer: { 9 | [articleApi.reducerPath]: articleApi.reducer, 10 | }, 11 | // middleware 12 | middleware: (getDefaultMiddleware) => 13 | getDefaultMiddleware().concat(articleApi.middleware), 14 | }); 15 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], 4 | theme: { 5 | extend: { 6 | fontFamily: { 7 | satoshi: ["Satoshi", "sans-serif"], 8 | inter: ["Inter", "sans-serif"], 9 | }, 10 | }, 11 | }, 12 | plugins: [], 13 | }; 14 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | --------------------------------------------------------------------------------