Skip to content

Repository files navigation

AI-Enhanced Note Editor

A modern note-taking application built with Laravel, React, and OpenAI integration, featuring Google OAuth authentication and AI-powered note enhancement.

🚀 Features

Authentication

  • Google OAuth integration for seamless login
  • Secure user profile management
  • Protected routes and API endpoints

Note Management

  • Create, read, update, and delete notes
  • Clean and intuitive editor interface
  • Auto-save functionality
  • Tag-based organization

AI Enhancement

  • OpenAI integration for intelligent note analysis
  • Automatic tag generation based on note content
  • Real-time AI response streaming
  • Powered by GPT-3.5 Turbo model

Raw PHP Component

  • Note Statistics component built with raw PHP
  • Provides insights on note creation patterns
  • Seamlessly integrates with the Laravel application

🛠️ Tech Stack

  • Frontend: React, Inertia.js, TailwindCSS
  • Backend: Laravel 10.x
  • Database: MySQL
  • Authentication: Google OAuth
  • AI Integration: OpenAI API
  • Raw PHP Component: Note Statistics

📋 Prerequisites

  • PHP 8.1 or higher
  • Composer
  • Node.js and NPM
  • MySQL
  • Google Cloud Platform account (for OAuth)
  • OpenAI API key

🚀 Installation

  1. Clone the repository:
git clone [repository-url]
cd [project-directory]
  1. Install PHP dependencies:
composer install
  1. Install JavaScript dependencies:
npm install
  1. Create environment file:
cp .env.example .env
  1. Generate application key:
php artisan key:generate
  1. Configure your .env file with the following variables:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password

GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=http://localhost:8000/auth/google/callback

OPENAI_API_KEY=your_openai_api_key
  1. Run migrations:
php artisan migrate
  1. Build assets:
npm run build
  1. Start the development server:
php artisan serve

🔧 Configuration

Google OAuth Setup

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials
  5. Add authorized redirect URI: http://localhost:8000/auth/google/callback
  6. Copy Client ID and Client Secret to .env file

OpenAI Setup

  1. Get your API key from OpenAI Platform
  2. Add the API key to your .env file

📁 Project Structure

├── app/
│   ├── Http/
│   │   ├── Controllers/
│   │   │   ├── Auth/
│   │   │   │   └── GoogleController.php
│   │   │   └── NoteController.php
│   │   │   
│   │   └── Services/
│   │       └── NoteStatistics.php
│   ├── config/
│   │   ├── services.php
│   │   └── openai.php
│   ├── database/
│   │   └── migrations/
│   ├── public/
│   │   └── NoteStatistics.php
│   ├── resources/
│   │   └── js/
│   │       ├── Components/
│   │       │   └── GoogleLoginButton.jsx
│   │       └── Pages/
│   │           └── Notes/
│   └── routes/
│       └── web.php

🔍 Raw PHP Component

The Note Statistics component (public/NoteStatistics.php) is built using raw PHP and provides:

  • Note creation statistics
  • Tag usage analysis
  • Integration with the main Laravel application through a service class

🚀 Deployment

  1. Set up your production environment variables
  2. Configure your web server (Apache/Nginx)
  3. Set up SSL certificates
  4. Update Google OAuth redirect URIs
  5. Run production build:
npm run build
php artisan config:cache
php artisan route:cache

📝 API Documentation

Note Management

  • GET /notes - List all notes
  • POST /notes - Create a new note
  • GET /notes/{id} - View a note
  • PUT /notes/{id} - Update a note
  • DELETE /notes/{id} - Delete a note

AI Features

  • POST /notes/{id}/generate-tags - Generate AI tags for a note

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📄 License

This project is licensed under the MIT License.

👥 Author

AI-Enhanced-Note-Editor

Releases

Packages

Used by

Contributors

Languages