diff --git a/README.md b/README.md index c4963af..caf0c09 100644 --- a/README.md +++ b/README.md @@ -1,71 +1,99 @@ -
- Lexit Logo -
+## Lexit -# Lexit - Personal Vocabulary Builder +Lexit is a web application designed to help you expand your vocabulary. Effortlessly define and discover new words with AI-powered definitions and examples. It's built for a user-friendly experience, making vocabulary building engaging and accessible. -A web app for building your personal vocabulary with AI-powered definitions and examples. +## Built With -## Local Setup +* **Next.js:** A React framework for building fast, interactive web applications. +* **Convex:** A real-time backend platform for building scalable applications with a managed database and serverless functions. +* **Google Gemini API:** Powers AI-driven definitions and example sentence generation. -### Prerequisites - -- Node.js 18+ -- Bun (recommended) or npm/yarn -- Convex account - -### 1. Install Dependencies - -```bash -bun install -# or -npm install -``` - -### 2. Setup Convex Backend - -```bash -# Install Convex CLI globally -npm install -g convex - -# Login to Convex -npx convex login - -# Initialize Convex project -npx convex dev -``` - -### 3. Environment Variables +## Getting Started -Create `.env.local` with: - -``` -CONVEX_DEPLOYMENT= -NEXT_PUBLIC_CONVEX_URL= -GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_key -``` - -### 4. Run Development Server - -```bash -bun dev -# or -npm run dev -``` - -Open [http://localhost:3000](http://localhost:3000) - -## Features - -- Add words with AI-generated definitions and examples -- Search through your vocabulary -- Real-time database with Convex -- Google Gemini AI integration - -## Tech Stack +### Prerequisites -- Next.js 16 + React 19 -- Convex (database & real-time) -- Google Gemini AI -- Tailwind CSS -- TypeScript +* Node.js (v18 or higher) +* Convex CLI installed (`npm install -g convex`) + +### Setup + +1. **Clone the repository:** + ```bash + git clone https://github.com/your-username/lexit.git + cd lexit + ``` +2. **Install dependencies:** + ```bash + npm install + ``` +3. **Log in to Convex:** + ```bash + npx convex auth login + ``` +4. **Deploy to Convex:** + ```bash + npx convex deploy + ``` + +## Usage + +Lexit makes it easy to expand your vocabulary and share new words. + +* **Add a New Word:** Navigate to the "Add Word" page. Enter the word, its definition, and optionally, example sentences. Click "Add Word" to contribute. +* **View Definitions:** Simply type a word into the search bar on the homepage to see its definition and example sentences. +* **Explore Examples:** Browse existing words to discover how they're used in context. + +**Keyboard Shortcuts:** + +* `Ctrl + K` (or `Cmd + K` on Mac): Focus the search bar to quickly look up definitions. + +# Contributing + +We welcome contributions to Lexit! Here's how you can help: + +* **Reporting Bugs:** + * Please check if the bug has already been reported. + * If not, open a new issue with a clear description, steps to reproduce, and your environment details. + +* **Feature Requests:** + * Suggest new features by opening an issue. + * Describe the feature and explain its benefit. + +* **Submitting Pull Requests:** + * Fork the repository and create a new branch for your changes. + * Make your changes and ensure they are well-tested. + * Submit a pull request with a clear description of your contributions. + +## API + +The `lexit` API provides endpoints for generating linguistic content. + +### `/api/generate-meaning` + +This endpoint generates a definition for a given word. + +* **Method:** `POST` +* **Rate Limiting:** Implemented per IP address to prevent abuse. Exceeding the limit will result in a `429 Too Many Requests` response. +* **Request Body:** + ```json + { + "word": "example" + } + ``` +* **Response Body (Success):** + ```json + { + "meaning": "A thing characteristic which is representative of its kind or group." + } + ``` +* **Response Body (Rate Limited):** + ```json + { + "error": "Rate limit exceeded. Please try again later.", + "reset": 1678886400 // Timestamp when the limit resets + } + ``` + +--- + +*This README was generated by [DevDoq](https://devdoq.com)* \ No newline at end of file