A modern, responsive web application for managing sales invoices with file attachments, built with Next.js 16, React 19, and TypeScript.
- Invoice Management: Create, edit, view, and delete sales invoices
- File Attachments: Upload one file per invoice (PDF, images, documents up to 10MB)
- Payment Tracking: Track payment status (Paid, Unpaid, Partially Paid, Overdue)
- Advanced Filtering: Filter invoices by date range and payment status
- Real-time Updates: Instant UI updates without page refreshes
- Data Persistence: Local storage with automatic data migration
- Responsive Design: Mobile-first design that works on all devices
- Modern UI: Clean, intuitive interface with Tailwind CSS
- Toast Notifications: Real-time feedback for user actions
- Confirmation Modals: Safe deletion with confirmation dialogs
- Loading States: Smooth loading indicators and skeleton screens
- Error Handling: Comprehensive error handling with user-friendly messages
- Type Safety: Full TypeScript implementation with strict typing
- Form Validation: Robust form validation with Zod schemas
- Testing: Comprehensive test suite with Jest and React Testing Library
- Performance: Optimized with React 19 features and Next.js 16
- Accessibility: WCAG compliant with proper ARIA labels and keyboard navigation
- Next.js 16 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript - Type-safe JavaScript
- Tailwind CSS 4 - Utility-first CSS framework
- Radix UI - Accessible component primitives
- React Hook Form - Performant forms with easy validation
- Zod - TypeScript-first schema validation
- Jest - JavaScript testing framework
- React Testing Library - Simple and complete testing utilities
- ESLint - Code linting and formatting
- PostCSS - CSS processing
- Fast-Check - Property-based testing
- date-fns - Modern JavaScript date utility library
- react-day-picker - Flexible date picker component
- lucide-react - Beautiful & consistent icon toolkit
- clsx - Utility for constructing className strings
- Node.js 18+
- npm, yarn, or pnpm
-
Clone the repository
git clone <repository-url> cd sales-webapp
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Start development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run test- Run testsnpm run test:watch- Run tests in watch mode
src/
├── app/ # Next.js App Router pages
│ ├── create/ # Create invoice page
│ ├── edit/[id]/ # Edit invoice page
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── components/ # React components
│ ├── demo/ # Demo components
│ ├── forms/ # Form components
│ ├── invoice/ # Invoice-specific components
│ ├── layout/ # Layout components
│ ├── providers/ # Context providers
│ └── ui/ # Reusable UI components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
├── types/ # TypeScript type definitions
└── __tests__/ # Test files
- Click "Create Invoice" on the home page
- Fill in invoice details (number, date, customer info)
- Add line items with descriptions, quantities, and prices
- Set payment status
- Optionally upload one file attachment
- Click "Create Invoice" to save
- View: Browse all invoices on the home page
- Filter: Use the filter panel to find specific invoices
- Edit: Click the edit button on any invoice
- Delete: Click delete and confirm to remove an invoice
- Each invoice can have one file attachment (max 10MB)
- Supported formats: PDF, images, Word docs, Excel files, text files
- Files are stored locally and persist between sessions
- Delete current file to upload a different one
The project includes comprehensive tests covering:
- Component rendering and interactions
- Custom hooks functionality
- Form validation
- File upload/download operations
- Error handling scenarios
Run tests:
npm test # Run all tests
npm run test:watch # Run tests in watch modeNo environment variables are required for basic functionality. All data is stored locally in the browser.
- Styling: Modify
tailwind.config.jsfor theme customization - Validation: Update schemas in
src/lib/validations.ts - Storage: Extend
src/hooks/useLocalStorage.tsfor different storage backends
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
- 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
- Follow TypeScript best practices
- Write tests for new features
- Use conventional commit messages
- Ensure accessibility compliance
- Test on multiple devices/browsers
This project is licensed under the ISC License - see the LICENSE file for details.
- File attachments are stored in browser local storage (limited by browser storage quotas)
- Data is not synchronized across devices or browsers
- No user authentication or multi-tenancy support
- Cloud storage integration for file attachments
- User authentication and authorization
- Multi-tenant support
- Invoice templates and customization
- Email integration for sending invoices
- Reporting and analytics dashboard
- Export functionality (PDF, CSV)
- Recurring invoice support
- Integration with payment processors
For support, please open an issue on the GitHub repository or contact the development team.
Built with ❤️ using Next.js, React, and TypeScript