A modern Next.js application for tracking expenses using AWS Textract OCR. Upload receipt images and automatically extract expense data.
- Upload Receipt: Drag-and-drop receipt images with automatic OCR processing
- Expense Management: View, filter, and search through all expenses
- Dashboard: Visualize spending patterns with interactive charts
- Responsive Design: Works seamlessly on desktop and mobile devices
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- Recharts
- Lucide React Icons
-
Install Dependencies:
npm install
-
Configure Environment Variables: Create a
.env.localfile in the root directory:NEXT_PUBLIC_API_BASE_URL=https://your-api-gateway-url.execute-api.us-east-1.amazonaws.com/ProdReplace with your actual API Gateway URL from the backend deployment.
-
Run Development Server:
npm run dev
npm run build
npm start/- Homepage with feature overview/upload- Upload receipt images/expenses- View and filter all expenses/dashboard- Analytics and spending trends
The frontend connects to the AWS backend using the following endpoints:
POST /upload-url- Get S3 signed URLGET /expenses- Retrieve all expensesGET /summary?month=YYYY-MM- Get monthly summary
- Push code to GitHub
- Import project to Vercel
- Add
NEXT_PUBLIC_API_BASE_URLenvironment variable - Deploy
- Connect GitHub repository
- Configure build settings
- Add environment variables
- Deploy
npm run build
# Upload the 'out' directory to S3
# Configure CloudFront distribution| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_API_BASE_URL |
Backend API Gateway URL | https://abc123.execute-api.us-east-1.amazonaws.com/Prod |
- Ensure the backend is deployed and accessible before running the frontend
- The app uses polling to detect when OCR processing is complete
- Receipt images are stored in S3 and accessible via the backend