Access link: http://docassistant.linkpc.net/
A web application for revising and improving text using AI assistance, with multi-tab support and version history tracking.
- Text highlighting and annotation system
- AI-powered revision suggestions
- Multi-tab document management
- Revision history tracking
- Dark/light theme support
- Real-time content updates
- PHP 8.2 or higher
- Node.js & npm
- Composer
- SQLite (or your preferred database)
- OpenAI API Key
docker-compose up --build -dsudo docker-compose exec db bash
mysql -u root -p
CREATE DATABASE docassistant;sudo docker-compose exec app bash
php artisan migratephp artisan key:generate
docker-compose exec --user root app bash
rm -rf /var/www/docAssistant/node_modules
npm cache clean --force
chown -R www-data:www-data /var/www/.npm
npm install
npm run buildOpen your web browser and navigate to http://localhost:8090 or the port specified in your docker-compose.yml
git clone https://github.com/Sergey-Mr/docAssistant.git
cd docAssistant
composer install
npm install- Copy the example environment file and generate the application key:
cp .env.example .env php artisan key:generate
- Add the following to the
.envfile:- Database configuration: Set up your database connection. For example:
(Alternatively, configure MySQL or another database of your choice.)
DB_DATABASE={your_db_name} DB_USERNAME={username} DB_PASSWORD={password} DB_CONNECTION=sqlite DB_DATABASE=/absolute/path/to/your/database.sqlite
- OpenAI API Key: Add your OpenAI API key:
OPENAI_API_KEY=your-api-key-here
- Database configuration: Set up your database connection. For example:
- Run the database migrations:
php artisan migrate
- Launch the backend:
php artisan serve
- Run the frontend:
npm run dev
Your project should now be available at http://localhost:8000 (by default).
The application uses GPT-4 with a specific prompt designed to handle text revisions. The prompt was derived emprically. The model receives the following data:
- Context: the whole text of the user.
- Annotations: the portions of text selected by the user and user`s instructions.
Temperature = 0.7 was derived emperically and proved to be the most suitable level for the purpouse of the web application.
The model is instructed to act as a text revision assistant and performs the following tasks:
- Revise specific annotated text portions while keeping the rest intact.
- Ensure revisions blend seamlessly with the original text.
- Return a JSON response containing:
- The full revised text.
- Original and revised sections.
- Explanations for each change.
Please find more details on prompt implementations: ChatGPT Service Implementation
- Framework: Laravel.
- Database Structure:
tabs: Manages multiple document contexts.text_changes: Records version history with explanations.user_texts: Stores current text content.
- Framework: Alpine.js, a lightweight JavaScript library for reactive components.
- Handles real-time UI updates.
- Manages tab switching and content state.
- Minimal overhead compared to larger frameworks.
- Styling: Tailwind CSS, a utility-first framework.
- Enables rapid UI development.
- Built-in dark mode support.
- Ensures consistent component styling.
- JavaScript Classes:
TextEditor: Core editing functionality with annotation support.TabManager: Handles tab CRUD operations.DashboardNotifications: User feedback system.
- Laravel Controllers:
TabController: Manages document organization.TextController: Handles text processing and history.
- External Libraries:
- Laravel Breeze: Authentication scaffolding.
- OpenAI API: AI-powered text suggestions.
- Axios: HTTP client for API requests.
- AlpineJS: Minimal reactive framework.
- TailwindCSS: Utility-first styling.
This project is licensed under the MIT License.
To make the application work:
- Ensure that the OpenAI API key is added to your
.envfile under theOPENAI_API_KEYvariable. - Make sure your database connection is correctly set in the
.envfile.