A modern, full-stack invoice and customer management dashboard built with Next.js 16, React 19, and TypeScript. Manage customers, create and track invoices, and monitor revenue with a clean, responsive UI powered by Tailwind CSS.
- Dashboard Overview - Real-time revenue charts and latest invoices at a glance
- Customer Management - View, search, and manage all customers
- Invoice Management - Create, edit, view, and delete invoices
- Authentication - Secure login with NextAuth.js
- Responsive Design - Mobile-friendly interface with Tailwind CSS
- Search & Filtering - Fast, debounced search across customers and invoices
- Pagination - Efficient data pagination for large datasets
- Status Tracking - Track invoice status (pending/paid) with visual indicators
- Type-Safe - Full TypeScript support for reliability
- Database - PostgreSQL integration for persistent data storage
| Technology | Version | Purpose |
|---|---|---|
| Next.js | ^16.0.10 | React framework with App Router |
| React | ^19.2.0 | UI library |
| TypeScript | ^6.0.2 | Type safety |
| Tailwind CSS | 3.4.17 | Styling |
| NextAuth.js | 5.0.0-beta.25 | Authentication |
| PostgreSQL | ^3.4.6 | Database |
| Zod | ^3.25.17 | Schema validation |
| bcryptjs | ^2.4.3 | Password hashing |
| Heroicons | ^2.2.0 | UI icons |
- Node.js 18+
- pnpm (or npm/yarn)
- PostgreSQL database
-
Clone the repository
git clone <repository-url> cd nextjs-dashboard
-
Install dependencies
pnpm install
-
Set up environment variables Create a
.env.localfile in the root directory:DATABASE_URL=postgresql://user:password@localhost:5432/dashboard NEXTAUTH_SECRET=your-secret-key-here NEXTAUTH_URL=http://localhost:3000
-
Set up the database
# Run seed script to populate sample data pnpm run seed -
Start the development server
pnpm dev
Open http://localhost:3000 in your browser.
# Development server with Turbopack
pnpm dev
# Production build
pnpm build
# Start production server
pnpm start
# Run linting
pnpm lintnextjs-dashboard/
├── app/ # Next.js App Router
│ ├── dashboard/ # Dashboard routes
│ │ ├── customers/ # Customer management
│ │ ├── invoices/ # Invoice management
│ │ └── (overview)/ # Dashboard overview
│ ├── lib/ # Utilities & data access
│ │ ├── actions.ts # Server actions
│ │ ├── data.ts # Database queries
│ │ ├── definitions.ts # Type definitions
│ │ └── utils.ts # Helper functions
│ └── ui/ # React components
│ ├── dashboard/ # Dashboard components
│ └── invoices/ # Invoice components
├── public/ # Static assets
├── types/ # TypeScript type definitions
└── tailwind.config.ts # Tailwind configuration
This project uses NextAuth.js for authentication. Users must log in to access the dashboard.
The seed script creates a test user:
- Email: user@example.com
- Password: password123
Note: Change these credentials in production!
The application manages three main entities:
- Users - Authentication credentials and user info
- Customers - Customer details and contact information
- Invoices - Invoice records with amounts, dates, and status
All data is stored in PostgreSQL with proper indexing for performance.
Key reusable components:
Button- Customizable button componentSearch- Debounced search inputPagination- Data pagination controlStatusBadge- Invoice status indicatorBreadcrumbs- Navigation breadcrumbsSideNav- Sidebar navigationCards- Dashboard metric cardsRevenueChart- Revenue visualizationTable- Data table component
- ESLint - Code linting and quality checks
- TypeScript - Static type checking
- Accessibility - WCAG compliance for UI components
Run linting:
pnpm lintIf you encounter ESLint errors with eslint-plugin-react, ensure you're using ESLint 9.x (not 10.x) for compatibility with the current eslint-config-next version.
- Verify PostgreSQL is running
- Check
DATABASE_URLin.env.local - Ensure database credentials are correct
If port 3000 is busy:
pnpm dev -- -p 3001- Push your code to GitHub/GitLab
- Import the project in Vercel Dashboard
- Add environment variables
- Deploy with one click
- Docker - Build a Docker image for containerized deployment
- AWS, GCP, Azure - Use their Node.js hosting options
- Self-hosted - Run on any server with Node.js support
Build for production:
pnpm build
pnpm startContributions are welcome! Please feel free to submit a Pull Request.
- 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 open source and available under the MIT License.
For issues and feature requests, please use the GitHub Issues page.
Happy invoicing! 🎉