|
| 1 | +# Grammr |
| 2 | + |
| 3 | +## Project Overview |
| 4 | +**Grammr** is a web application built with **Next.js**, **JavaScript**, **Tailwind CSS**, and **Material-UI (MUI)** and **Gemini Api**. |
| 5 | + |
| 6 | +## Table of Contents |
| 7 | +1. [Installation](#installation) |
| 8 | +2. [Usage](#usage) |
| 9 | +3. [Tech Stack](#tech-stack) |
| 10 | +4. [Features](#features) |
| 11 | +5. [Contributing](#contributing) |
| 12 | +6. [License](#license) |
| 13 | + |
| 14 | +## Screenshots |
| 15 | + |
| 16 | +Here’s a preview of the Grammr interface: |
| 17 | + |
| 18 | + |
| 19 | +## Installation |
| 20 | +To set up the Grammr Checking App, follow these steps: |
| 21 | + |
| 22 | +1. **Clone the Repository** |
| 23 | + ```bash |
| 24 | + git clone https://github.com/sreyas-b-anand/grammr.git |
| 25 | + cd grammr |
| 26 | +2. **Install Dependencies** |
| 27 | + - Ensure you have Node.js installed, then run: |
| 28 | + ```bash |
| 29 | + npm install |
| 30 | +3. **Run the Application** |
| 31 | + Start the development server: |
| 32 | + ```bash |
| 33 | + npm run dev |
| 34 | + |
| 35 | +## API Integration |
| 36 | + |
| 37 | +To utilize the Gemini API, you'll need to follow these steps to set up your API key: |
| 38 | +
|
| 39 | +1. **Obtain Your API Key** |
| 40 | + - Sign up at [Google AI Studio](https://ai.google.dev/api) to obtain your API key. |
| 41 | +
|
| 42 | +2. **Set Up Your API Key** |
| 43 | + - Create a `.env.local` file in the root of your project directory if you haven't already. |
| 44 | + - Add your API key to the `.env.local` file: |
| 45 | + ```plaintext |
| 46 | + NEXT_PUBLIC_API_KEY=your_api_key_here |
| 47 | + ``` |
| 48 | + |
| 49 | +3. **Install the Gemini API SDK** |
| 50 | + - If you haven't installed it yet, add the Google AI JavaScript SDK to your project: |
| 51 | + ```bash |
| 52 | + npm install @google/generative-ai |
| 53 | + ``` |
| 54 | +
|
| 55 | +4. **Import the Library and Configure Your Key** |
| 56 | + - In your application code, import the library and configure it with your API key: |
| 57 | + ```javascript |
| 58 | + import { GenerativeAI } from '@google/generative-ai'; |
| 59 | +
|
| 60 | + const aiClient = new GenerativeAI({ |
| 61 | + apiKey: process.env.NEXT_PUBLIC_API_KEY, |
| 62 | + }); |
| 63 | + ``` |
| 64 | +
|
| 65 | +5. **Make Your First Request** |
| 66 | + - Use the `generateContent` method to generate text: |
| 67 | + ```javascript |
| 68 | + const response = await aiClient.generateContent({ |
| 69 | + prompt: "Your prompt here", |
| 70 | + // Other parameters as needed |
| 71 | + }); |
| 72 | + console.log(response); |
| 73 | + ``` |
| 74 | +
|
| 75 | +6. **Restart Your Development Server** |
| 76 | + - After setting up your API key and making changes, restart your development server: |
| 77 | + ```bash |
| 78 | + npm run dev |
| 79 | + ``` |
| 80 | +
|
| 81 | +Make sure to keep your `.env.local` file secure and do not share it publicly. |
| 82 | + - Access the app in your web browser at http://localhost:3000. |
| 83 | +## Tech Stack |
| 84 | + - Next.js: A React framework for server-side rendering and static site generation. |
| 85 | + - JavaScript: The programming language used for building interactive features. |
| 86 | + - Tailwind CSS: A utility-first CSS framework for rapid UI development. |
| 87 | + - Material-UI (MUI): A React UI framework that implements Material Design principles. |
| 88 | +## Features |
| 89 | + - Real-time Grammar Correction: Utilizes Gramformer to provide immediate feedback on grammar errors. |
| 90 | + - Responsive Design: Built with Tailwind CSS for a mobile-friendly experience. |
| 91 | + - Customizable Components: Leverages MUI for pre-designed, accessible UI components. |
| 92 | + - Open Source: The application is open for contributions and improvements. |
| 93 | +
|
| 94 | +## Contributing |
| 95 | + - Contributions are welcome! Please follow these steps: |
| 96 | + |
| 97 | +## License |
| 98 | + - This project is licensed under the MIT License - see the LICENSE file for details. |
0 commit comments