A modern Next.js application that allows users to upload accounting documents, extract data using OCR (Optical Character Recognition), and generate Excel files for financial record management.
- Image Upload: Drag and drop or click to upload accounting documents (JPG, PNG, etc.)
- OCR Processing: Uses Tesseract.js to extract text from images
- Data Analysis: Review, edit, and categorize extracted financial data
- Excel Generation: Export processed data to Excel format for use in accounting software
- Modern UI: Beautiful, responsive interface built with Tailwind CSS
- Real-time Processing: Live data extraction and analysis
- Next.js 14: React framework with App Router
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first CSS framework
- Tesseract.js: OCR library for text extraction
- SheetJS (XLSX): Excel file generation
- Lucide React: Beautiful icons
- Node.js 18+
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd rechnai
- Install dependencies:
npm install
- Run the development server:
npm run dev
- Open http://localhost:3000 in your browser.
- Drag and drop an accounting document or click to browse
- Supported formats: JPG, PNG, and other image formats
- The app will show a preview of the uploaded image
- Click "Extract Data" to process the image using OCR
- The app will analyze the image and extract text
- You can view the raw extracted text if needed
- Review the extracted data in a table format
- Edit any fields directly in the table
- Add categories to organize your data
- Add new rows or delete existing ones
- Click "Generate XLS" to create a downloadable Excel file
- Customize the filename if needed
- Download the Excel file for use in accounting software
rechnai/
├── app/
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main page component
├── components/
│ ├── ImageUpload.tsx # Image upload and OCR processing
│ ├── DataAnalysis.tsx # Data review and editing
│ └── CSVDownload.tsx # CSV generation and download
├── package.json # Dependencies and scripts
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
- Uses Tesseract.js for accurate text extraction
- Supports multiple languages (currently English)
- Handles various document layouts and formats
- Automatically detects dates, amounts, and descriptions
- Uses regex patterns to identify financial data
- Allows manual editing and categorization
- Generates properly formatted Excel files (.xlsx)
- Includes headers for easy import into accounting software
- Supports custom filenames
Edit the categories
array in components/DataAnalysis.tsx
:
const categories = [
'Income',
'Expenses',
'Utilities',
'Rent',
'Food',
'Transportation',
'Entertainment',
'Healthcare',
'Insurance',
'Other',
'Your New Category' // Add your custom categories here
]
Update the parseAccountingData
function in components/ImageUpload.tsx
to match your specific document formats.
- Push your code to GitHub
- Connect your repository to Vercel
- Deploy automatically
The app can be deployed to any platform that supports Next.js:
- Netlify
- AWS Amplify
- Railway
- Heroku
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is open source and available under the MIT License.
For support or questions, please open an issue on GitHub or contact the development team.