A modern full-stack application combining Laravel backend with Vue 3 (TypeScript) frontend for semantic document search using TF-IDF and cosine similarity.
- π Semantic Search: TF-IDF-based search with cosine similarity scoring
- οΏ½ Data Sources: Connect to external APIs, URLs, RSS feeds, and databases
- οΏ½π User Dashboard: Interactive Vue 3 dashboard with TypeScript
- ποΈ SQLite Database: Lightweight database for document storage
- π REST API: Complete API for searching and managing documents
- π Python Integration: Enhanced AI search script with API support
- π¨ Modern UI: Beautiful, responsive interface with gradient designs
- π Smart Caching: Configurable cache TTL with automatic background refresh
- π API Authentication: Support for Bearer, API Key, Basic Auth, and OAuth2
- Laravel 10+
- SQLite Database
- PHP 8.1+
- Vue 3 with Composition API
- TypeScript
- Vite
- Modern CSS with gradients and animations
- Python 3.8+
- scikit-learn (TF-IDF vectorization)
- NumPy (numerical operations)
Search across multiple data sources simultaneously!
The Data Sources feature allows you to integrate external data into your AI search:
- Database ποΈ - Execute SQL queries against any database
- URL/File π - Fetch JSON, XML, CSV, RSS feeds, or plain text
- API π - Connect to REST APIs with authentication
# Seed sample data sources
php artisan db:seed --class=DataSourceSeeder
# Refresh all data sources
php artisan data-sources:refresh --all
# View in browser
# Navigate to: /data-sources- Fetch product catalogs from external APIs
- Import RSS news feeds
- Query remote databases
- Aggregate data from multiple sources
- Cache frequently accessed external data
See docs/DATA_SOURCES_GUIDE.md for detailed documentation.
- PHP >= 8.1
- Composer
- Node.js >= 18
- npm or yarn
- Python 3.8+
- pip
-
Clone the repository
git clone https://github.com/net-shell/kepler.git
-
Install PHP dependencies
composer install
-
Install Node dependencies
npm install
-
Install Python dependencies
pip3 install scikit-learn numpy dotenv
-
Set up environment
cp .env.example .env python3 -m venv scripts/venv php artisan key:generate
-
Create SQLite database
touch database/database.sqlite
-
Run migrations
php artisan migrate
-
Build frontend assets
npm run build # Or for development with hot reload: npm run dev -
Start the Laravel server
php artisan serve
-
Access the application Open your browser to: http://localhost:8000
-
POST /api/search- Search documents{ "query": "your search query", "limit": 5 } -
GET /api/search/stats- Get search statistics
-
GET /api/data- List all documents (paginated) -
POST /api/data- Create a new document{ "title": "Document Title", "body": "Document content", "tags": ["tag1", "tag2"], "metadata": {"key": "value"} } -
POST /api/data/batch- Batch create documents -
GET /api/data/{id}- Get a specific document -
PUT /api/data/{id}- Update a document -
DELETE /api/data/{id}- Delete a document
python3 scripts/ai_search_api.pyThe script is automatically called by Laravel when performing searches.
echo '{"data": [...], "query": "search term", "limit": 5}' | python3 scripts/ai_search_api.pykepler/
βββ ai/
β βββ ai_search.py # AI search implementation
β
βββ www/ # Main Laravel application
β βββ app/
β β βββ Actions/
β β β βββ Fortify/ # Authentication actions
β β βββ Console/
β β β βββ Commands/
β β β β βββ SearchStats.php # Search statistics command
β β β βββ Kernel.php
β β βββ Exceptions/
β β β βββ Handler.php
β β βββ Http/
β β β βββ Controllers/
β β β β βββ Controller.php
β β β β βββ DataController.php # Document CRUD & bulk upload
β β β β βββ SearchController.php # AI search API
β β β β βββ Settings/ # User settings controllers
β β β βββ Middleware/ # HTTP middleware
β β β βββ Requests/
β β β β βββ Settings/ # Form requests
β β β βββ Kernel.php
β β βββ Models/
β β β βββ Document.php # Document model with folder path
β β β βββ User.php # User model with 2FA
β β βββ Providers/
β β β βββ AppServiceProvider.php
β β β βββ FortifyServiceProvider.php
β β β βββ RouteServiceProvider.php
β β βββ Services/
β β βββ FileProcessingService.php # File parsing service
β β
β βββ config/
β β βββ aisearch.php # AI search configuration
β β βββ app.php
β β βββ auth.php
β β βββ database.php
β β βββ fortify.php
β β βββ inertia.php
β β
β βββ database/
β β βββ migrations/
β β β βββ create_users_table.php
β β β βββ create_documents_table.php
β β β βββ add_two_factor_columns_to_users_table.php
β β β βββ add_path_to_documents_table.php
β β βββ factories/
β β βββ seeders/
β β
β βββ docs/
β β βββ ARCHITECTURE.md # System architecture
β β βββ BULK_UPLOAD_GUIDE.md # Bulk upload documentation
β β βββ BULK_UPLOAD_QUICKSTART.md # Quick start guide
β β βββ DOCUMENTATION_INDEX.md # Documentation index
β β βββ FOLDER_TREE_FEATURE.md # Folder tree documentation
β β βββ INSTALLATION_GUIDE.md # Installation guide
β β βββ PROJECT_SUMMARY.md # Project summary
β β βββ QUICKSTART.md # Quick start
β β βββ README_BULK_UPLOAD.md # Bulk upload README
β β βββ VISUAL_GUIDE.md # Visual guide
β β
β βββ resources/
β β βββ css/
β β β βββ app.css
β β βββ js/
β β β βββ actions/ # Auto-generated Wayfinder actions
β β β βββ components/
β β β β βββ AlertError.vue
β β β β βββ AppContent.vue
β β β β βββ AppHeader.vue
β β β β βββ AppLogo.vue
β β β β βββ AppShell.vue
β β β β βββ AppSidebar.vue
β β β β βββ BulkUploadComponent.vue # Bulk upload interface
β β β β βββ Dashboard.vue # Main dashboard
β β β β βββ DataFeedComponent.vue # Data input form
β β β β βββ DocumentCard.vue
β β β β βββ DocumentList.vue # Document list
β β β β βββ FolderTree.vue # Folder navigation
β β β β βββ SearchComponent.vue # Search interface
β β β β βββ TwoFactorSetupModal.vue # 2FA setup
β β β β βββ ui/ # shadcn/ui components
β β β βββ composables/ # Vue composables
β β β βββ layouts/ # Page layouts
β β β β βββ AppLayout.vue
β β β β βββ AuthLayout.vue
β β β β βββ settings/
β β β βββ lib/
β β β β βββ utils.ts
β β β βββ pages/
β β β β βββ auth/ # Authentication pages
β β β β βββ settings/ # User settings pages
β β β β βββ Dashboard.vue
β β β β βββ DocumentShow.vue
β β β β βββ Welcome.vue
β β β βββ routes/ # Wayfinder routes
β β β βββ types/ # TypeScript definitions
β β β βββ wayfinder/ # Wayfinder config
β β β βββ app.ts # Vue app entry
β β β βββ ssr.ts # SSR entry
β β βββ views/
β β βββ app.blade.php
β β
β βββ routes/
β β βββ api.php # API routes
β β βββ console.php # Console routes
β β βββ settings.php # Settings routes
β β βββ web.php # Web routes
β β
β βββ scripts/
β β βββ ai_search_api.py # Python AI search script
β β
β βββ storage/
β β βββ app/
β β β βββ public/
β β β βββ uploads/ # Uploaded files
β β βββ framework/
β β βββ logs/
β β
β βββ tests/
β β βββ Feature/
β β βββ Unit/
β β βββ Pest.php
β β
β βββ composer.json # PHP dependencies
β βββ package.json # Node dependencies
β βββ vite.config.ts # Vite configuration
β βββ tsconfig.json # TypeScript configuration
β βββ components.json # shadcn/ui config
β βββ README.md # This file
# Terminal 1: Laravel server
php artisan serve
# Terminal 2: Vite dev server (hot reload)
npm run devnpm run buildpython3 scripts/ai_search_api.py- View total document count
- Quick statistics overview
- Enter search queries
- Adjust result limit
- View ranked results with scores
- See document tags and metadata
- Create new documents
- Add tags
- Add custom metadata
- Batch operations support
- Browse all documents
- Pagination support
- Delete documents
- View creation dates
Edit scripts/ai_search_api.py to adjust:
- TF-IDF parameters
- Scoring weights (title, body, tags)
- n-gram ranges
- Minimum score thresholds
Edit resources/js/style.css and component styles to change:
- Color schemes
- Gradients
- Animations
- Layout
- Create new Vue components in
resources/js/components/ - Add new API routes in
routes/api.php - Create corresponding controllers in
app/Http/Controllers/
- Ensure Python 3 is installed and in PATH
- Verify script path in
SearchController.php
- Check SQLite database exists:
database/database.sqlite - Run migrations:
php artisan migrate
- Build assets:
npm run build - Check Vite is running:
npm run dev - Clear cache:
php artisan cache:clear
This project is open-source and available for educational purposes.
Feel free to submit issues and enhancement requests!