A modern Laravel-based budget application with intelligent receipt processing capabilities. This app allows users to upload receipts via camera or file upload, automatically extracts text using OCR, and intelligently categorizes expenses using AI.
- Smart Receipt Processing: Upload receipts via mobile camera or file upload
- OCR Integration: Automatic text extraction from images and PDFs
- AI-Powered Categorization: Intelligent expense categorization using OpenAI
- Line Item Extraction: Automatic parsing of individual items from receipts
- Dynamic Category Management: Auto-creation of new categories and subcategories
- Real-time Processing: Background job processing with status tracking
- Mobile-First Design: Optimized for mobile camera capture
- Modern React Frontend: Built with Inertia.js and React
- Responsive Design: Tailwind CSS for beautiful, responsive UI
- Real-time Updates: Live status updates during processing
- Laravel 12: Latest Laravel framework with modern PHP 8.2+
- Inertia.js: Seamless SPA experience without API complexity
- React 18: Modern React with hooks and functional components
- Queue Processing: Background job processing for OCR and AI tasks
- File Storage: Secure file handling with public access
- Authentication: Laravel Breeze with Google OAuth integration
- Laravel 12 - PHP web framework
- PHP 8.2+ - Modern PHP with latest features
- MySQL 8.0 - Primary database
- Laravel Sanctum - API authentication
- Laravel Socialite - OAuth integration
- Laravel Queues - Background job processing
- React 18 - Modern JavaScript library
- Inertia.js - SPA without API complexity
- Tailwind CSS - Utility-first CSS framework
- Headless UI - Accessible UI components
- Vite - Fast build tool and dev server
- OCR Service - Text extraction from images/PDFs
- OpenAI API - AI-powered categorization and parsing
- Google OAuth - Social authentication
- Docker Desktop - For running the application in containers
- Docker Compose - Usually included with Docker Desktop
- PHP 8.2 or higher
- Composer
- Node.js 18+ and npm
- MySQL 8.0+
Laravel Sail provides a Docker-based development environment for Laravel applications.
-
Clone the repository
git clone <repository-url> cd budget-app
-
Install PHP dependencies
composer install
-
Environment setup
cp .env.example .env
-
Configure environment variables Edit
.envfile with your configuration:# Database (Sail will handle these automatically) DB_CONNECTION=mysql DB_HOST=mysql DB_PORT=3306 DB_DATABASE=budget_app DB_USERNAME=sail DB_PASSWORD=password # OCR Service OCR_NEXT_SERVER=http://ocr-next-api OCR_NEXT_API_KEY=your_api_key OCR_NEXT_API_TOKEN=your_api_token # OpenAI OPENAI_API_KEY=your_openai_api_key # Google OAuth GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret GOOGLE_REDIRECT_URI=http://localhost/auth/google/callback
-
Start Laravel Sail
./vendor/bin/sail up -d
-
Install Node.js dependencies
./vendor/bin/sail npm install
-
Generate application key
./vendor/bin/sail artisan key:generate
-
Run database migrations and seeders
./vendor/bin/sail artisan migrate --seed
-
Start development servers
./vendor/bin/sail npm run dev
-
Access the application
- Web Application: http://localhost
- MinIO Console: http://localhost:8900 (sail/password)
If you prefer to run the application locally without Docker, you'll need to set up PHP, MySQL, and Node.js manually.
Prerequisites: PHP 8.2+, Composer, Node.js 18+, MySQL 8.0+
-
Clone and install dependencies
git clone <repository-url> cd budget-app composer install npm install
-
Environment setup
cp .env.example .env php artisan key:generate
-
Configure local database Update
.envfile:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=budget_app DB_USERNAME=root DB_PASSWORD=your_password
-
Database setup
php artisan migrate --seed
-
Start development servers
# Terminal 1: Laravel server php artisan serve # Terminal 2: Vite dev server npm run dev # Terminal 3: Queue worker php artisan queue:work
When using Laravel Sail, prefix your commands with ./vendor/bin/sail:
# Start containers
./vendor/bin/sail up -d
# Stop containers
./vendor/bin/sail down
# View container logs
./vendor/bin/sail logs
# Access application container shell
./vendor/bin/sail shell
# Run Artisan commands
./vendor/bin/sail artisan migrate
./vendor/bin/sail artisan queue:work
./vendor/bin/sail artisan test
# Run Composer commands
./vendor/bin/sail composer install
./vendor/bin/sail composer update
# Run NPM commands
./vendor/bin/sail npm install
./vendor/bin/sail npm run dev
./vendor/bin/sail npm run build
# Access MySQL database
./vendor/bin/sail mysql# Start development environment
./vendor/bin/sail up -d
# Install dependencies (first time only)
./vendor/bin/sail composer install
./vendor/bin/sail npm install
# Run migrations
./vendor/bin/sail artisan migrate --seed
# Start development server
./vendor/bin/sail npm run dev
# Run tests
./vendor/bin/sail test
# Stop environment
./vendor/bin/sail downbudget-app/
βββ app/
β βββ Http/Controllers/ # API controllers
β βββ Jobs/ # Background jobs
β βββ Models/ # Eloquent models
β βββ Services/ # Business logic services
β βββ Providers/ # Service providers
βββ database/
β βββ migrations/ # Database migrations
β βββ seeders/ # Database seeders
βββ resources/
β βββ js/
β β βββ Components/ # Reusable React components
β β βββ Layouts/ # Layout components
β β βββ Pages/ # Page components
β βββ css/ # Stylesheets
βββ routes/ # Route definitions
βββ storage/ # File storage
βββ tests/ # Test files
Categories
- Hierarchical category system (parent/child relationships)
- Auto-created categories from AI processing
- Pre-seeded with Groceries and Building categories
Receipts
- File storage and metadata
- OCR text and processing status
- Vendor, currency, and total amount
- Overall receipt information (no categories)
Receipt Items
- Individual line items from receipts
- Quantity, unit price, and total calculations
- Category and subcategory associations
- Linked to parent receipts
| Variable | Description | Required | Sail Default |
|---|---|---|---|
DB_HOST |
Database host | Yes | mysql |
DB_USERNAME |
Database username | Yes | sail |
DB_PASSWORD |
Database password | Yes | password |
OCR_NEXT_SERVER |
OCR service base URL | Yes | - |
OCR_NEXT_API_KEY |
OCR service API key | Yes | - |
OCR_NEXT_API_TOKEN |
OCR service bearer token | Yes | - |
OPENAI_API_KEY |
OpenAI API key for AI processing | Yes | - |
GOOGLE_CLIENT_ID |
Google OAuth client ID | Yes | - |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret | Yes | - |
When using Laravel Sail, the following services are automatically configured:
- MySQL: Available at
mysql:3306(internal) orlocalhost:3306(external) - MinIO: Available at
minio:9000(internal) orlocalhost:9000(external) - MinIO Console: Available at
localhost:8900(username:sail, password:password)
- Maximum file size: 15MB
- Supported formats: JPG, JPEG, PNG, HEIC, WEBP, PDF
- Storage location:
storage/app/public/receipts/
-
Mobile Camera Capture
- Tap "Scan with Camera" button
- Capture receipt directly with device camera
- Automatic file validation and upload
-
File Upload
- Tap "Upload Photo/PDF" button
- Select file from device storage
- Preview before submission
- Upload β File validation and storage
- OCR Processing β Text extraction from image/PDF
- AI Analysis β Category classification for each item and item extraction
- Data Persistence β Save structured data to database with categories on items
- Status Updates β Real-time processing status
- View All Receipts: Paginated list with status badges
- Receipt Details: View OCR text, edit item categories, modify items
- Retry Processing: Retry failed receipts
- File Access: Direct file viewing and download
# Run PHP tests
./vendor/bin/sail test
# Run with coverage
./vendor/bin/sail test --coverage
# Run specific test suite
./vendor/bin/sail test --testsuite=Feature# Run PHP tests
php artisan test
# Run with coverage
php artisan test --coverage
# Run specific test suite
php artisan test --testsuite=Feature- Set
APP_ENV=production - Configure production database
- Set up file storage (S3, etc.)
- Configure queue workers
- Set up SSL certificates
- Configure caching (Redis/Memcached)
- Set up monitoring and logging
For production, ensure queue workers are running:
# Using Supervisor (recommended)
php artisan queue:work --daemon
# Or using Laravel Horizon (if installed)
php artisan horizon| Method | Endpoint | Description |
|---|---|---|
| GET | /receipts |
List all receipts |
| POST | /receipts |
Upload new receipt |
| GET | /receipts/{id} |
Show receipt details |
| PATCH | /receipts/{id} |
Update receipt data |
| POST | /receipts/{id}/retry |
Retry processing |
| GET | /receipts/{id}/file |
Access receipt file |
| GET | /categories |
List categories |
- File Validation: MIME type and size restrictions
- Rate Limiting: Upload endpoint protection
- Authentication: Laravel Sanctum + OAuth
- CSRF Protection: Built-in Laravel protection
- Input Sanitization: Automatic data cleaning
- Secure Storage: Protected file access
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the documentation in
/docsfolder - Review the Laravel documentation for framework-specific questions
- Initial release with core receipt processing functionality
- OCR integration with external service
- AI-powered categorization using OpenAI
- Mobile-first responsive design
- Background job processing
- Google OAuth authentication
Built with β€οΈ using Laravel, React, and modern web technologies.